text:
using System;
using System.Collections.Generic;
using System.Linq;
using Foundation;
using UIKit;

namespace OpenGLES20Example
{
	[Register ("AppDelegate")]
	public partial class AppDelegate : UIApplicationDelegate
	{
		UIWindow window;

		public override bool FinishedLaunching (UIApplication app, NSDictionary options)
		{
			window = new UIWindow (UIScreen.MainScreen.Bounds);

			GLViewController root = new GLViewController ();
			root.View.Frame = window.Frame;
			root.View.ContentScaleFactor = window.ContentScaleFactor;

			window.RootViewController = root;

			window.MakeKeyAndVisible ();

			(root.View as GLView).StartAnimation ();

			return true;
		}
	}
}

redpajama_set_name: RedPajamaGithub


text:
class OutputMap {
	public:
		OutputMap();
		~OutputMap();
		void Initialize(std::vector<std::string> & outputs);
		outputref_t GetOut(std::string name);
		const char ** GetOutputList(int & size);
	private:
		std::map<std::string, outputref_t> map;
		const char ** outputs;
		int count;
};


text:
<?xml version="1.0" encoding="utf-8"?>
<scenario xmlns="urn:perfcake:scenario:6.0">
   <run type="${perfcake.run.type:time}" value="${perfcake.run.duration:20000}"/>
   <generator class="DefaultMessageGenerator" threads="${perfcake.thread.count:10}"/>
   <sender class="HttpSender">
      <target>http://${server.host:localhost}:8181/cpt-jetty-spring</target>
      <property name="method" value="POST"/>
   </sender>
   <reporting>
      <reporter class="IterationsPerSecondReporter">
         <destination class="ConsoleDestination">
            <period type="time" value="5000"/>
         </destination>
         <destination class="ChartDestination">
            <period type="time" value="1000"/>
            <property name="attributes" value="Result"/>
            <property name="outputDir" value="${perfcake.scenario}-charts"/>
            <property name="yAxis" value="Iterations per second"/>
            <property name="name" value="REST Throughput (${tag})"/>
         </destination>
         <destination class="PerfRepoDestination">
            <period type="percentage" value="100"/>
            <property name="metric" value="throughput"/>
            <property name="repositoryUrl" value="${perfrepo.host:localhost}:${perfrepo.port:8080}"/>
            <property name="username" value="perfrepouser"/>
            <property name="password" value="perfrepouser1."/>
            <property name="testUID" value="${perfcake.scenario}"/>
            <property name="tags" value="OpenAlt2015;IoT;${tag}"/>
            <property name="testExecutionName" value="OpenAlt 2015: IoT REST (${tag})"/>
            <property name="reporterResultName" value="Result"/>
         </destination>
      </reporter>
   </reporting>
   <messages>
      <message content="Hello!"/>
   </messages>
</scenario>


text:
"""Integration tests with urllib2"""

import ssl
from six.moves.urllib.request import urlopen
from six.moves.urllib_parse import urlencode
import pytest_httpbin.certs

# Internal imports
import vcr

from assertions import assert_cassette_has_one_response

def urlopen_with_cafile(*args, **kwargs):
    context = ssl.create_default_context(cafile=pytest_httpbin.certs.where())
    context.check_hostname = False
    kwargs["context"] = context
    try:
        return urlopen(*args, **kwargs)
    except TypeError:
        # python2/pypi don't let us override this
        del kwargs["cafile"]
        return urlopen(*args, **kwargs)

def test_response_code(httpbin_both, tmpdir):
    """Ensure we can read a response code from a fetch"""
    url = httpbin_both.url
    with vcr.use_cassette(str(tmpdir.join("atts.yaml"))):
        code = urlopen_with_cafile(url).getcode()

    with vcr.use_cassette(str(tmpdir.join("atts.yaml"))):
        assert code == urlopen_with_cafile(url).getcode()

def test_random_body(httpbin_both, tmpdir):
    """Ensure we can read the content, and that it's served from cache"""
    url = httpbin_both.url + "/bytes/1024"
    with vcr.use_cassette(str(tmpdir.join("body.yaml"))):
        body = urlopen_with_cafile(url).read()

    with vcr.use_cassette(str(tmpdir.join("body.yaml"))):
        assert body == urlopen_with_cafile(url).read()

def test_response_headers(httpbin_both, tmpdir):
    """Ensure we can get information from the response"""
    url = httpbin_both.url
    with vcr.use_cassette(str(tmpdir.join("headers.yaml"))):
        open1 = urlopen_with_cafile(url).info().items()

    with vcr.use_cassette(str(tmpdir.join("headers.yaml"))):
        open2 = urlopen_with_cafile(url).info().items()

        assert sorted(open1) == sorted(open2)

def test_effective_url(httpbin_both, tmpdir):
    """Ensure that the effective_url is captured"""
    url = httpbin_both.url + "/redirect-to?url=/html"
    with vcr.use_cassette(str(tmpdir.join("headers.yaml"))):
        effective_url = urlopen_with_cafile(url).geturl()
        assert effective_url == httpbin_both.url + "/html"

    with vcr.use_cassette(str(tmpdir.join("headers.yaml"))):
        assert effective_url == urlopen_with_cafile(url).geturl()

def test_multiple_requests(httpbin_both, tmpdir):
    """Ensure that we can cache multiple requests"""
    urls = [httpbin_both.url, httpbin_both.url, httpbin_both.url + "/get", httpbin_both.url + "/bytes/1024"]
    with vcr.use_cassette(str(tmpdir.join("multiple.yaml"))) as cass:
        [urlopen_with_cafile(url) for url in urls]
    assert len(cass) == len(urls)

def test_get_data(httpbin_both, tmpdir):
    """Ensure that it works with query data"""
    data = urlencode({"some": 1, "data": "here"})
    url = httpbin_both.url + "/get?" + data
    with vcr.use_cassette(str(tmpdir.join("get_data.yaml"))):
        res1 = urlopen_with_cafile(url).read()

    with vcr.use_cassette(str(tmpdir.join("get_data.yaml"))):
        res2 = urlopen_with_cafile(url).read()
    assert res1 == res2

def test_post_data(httpbin_both, tmpdir):
    """Ensure that it works when posting data"""
    data = urlencode({"some": 1, "data": "here"}).encode("utf-8")
    url = httpbin_both.url + "/post"
    with vcr.use_cassette(str(tmpdir.join("post_data.yaml"))):
        res1 = urlopen_with_cafile(url, data).read()

    with vcr.use_cassette(str(tmpdir.join("post_data.yaml"))) as cass:
        res2 = urlopen_with_cafile(url, data).read()
        assert len(cass) == 1

    assert res1 == res2
    assert_cassette_has_one_response(cass)

def test_post_unicode_data(httpbin_both, tmpdir):
    """Ensure that it works when posting unicode data"""
    data = urlencode({"snowman": u"☃".encode("utf-8")}).encode("utf-8")
    url = httpbin_both.url + "/post"
    with vcr.use_cassette(str(tmpdir.join("post_data.yaml"))):
        res1 = urlopen_with_cafile(url, data).read()

    with vcr.use_cassette(str(tmpdir.join("post_data.yaml"))) as cass:
        res2 = urlopen_with_cafile(url, data).read()
        assert len(cass) == 1

    assert res1 == res2
    assert_cassette_has_one_response(cass)

def test_cross_scheme(tmpdir, httpbin_secure, httpbin):
    """Ensure that requests between schemes are treated separately"""
    # First fetch a url under https, and then again under https and then
    # ensure that we haven't served anything out of cache, and we have two
    # requests / response pairs in the cassette
    with vcr.use_cassette(str(tmpdir.join("cross_scheme.yaml"))) as cass:
        urlopen_with_cafile(httpbin_secure.url)
        urlopen_with_cafile(httpbin.url)
        assert len(cass) == 2
        assert cass.play_count == 0

def test_decorator(httpbin_both, tmpdir):
    """Test the decorator version of VCR.py"""
    url = httpbin_both.url

    @vcr.use_cassette(str(tmpdir.join("atts.yaml")))
    def inner1():
        return urlopen_with_cafile(url).getcode()

    @vcr.use_cassette(str(tmpdir.join("atts.yaml")))
    def inner2():
        return urlopen_with_cafile(url).getcode()

    assert inner1() == inner2()


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Septoria gei f. immarginata Brunaud

### Remarks
null


text:
module Lang.LamIf.Examples where

import Lang.LamIf
import FP
import qualified FP.Pretty as P

examplesMain :: IO ()
examplesMain = flowSensitivityMain

makeOptions :: [String] -> [String] -> [String] -> [String] -> [String] -> [String] -> [String] -> [String] -> [(Doc, Options)]
makeOptions ltime dtime val monad gc closure lfilter dfilter = do
  lt <- ltime
  dt <- dtime
  v <- val
  m <- monad
  g <- gc
  c <- closure
  lf <- lfilter
  df <- dfilter
  let d = P.hsep $ map P.heading
        [ concat [ "LT=", lt ]
        , concat [ "DT=", dt ]
        , concat [ "V=", v ]
        , concat [ "M=", m ]
        , concat [ "G=", g ]
        , concat [ "C=", c ]
        , concat [ "LF=", lf ]
        , concat [ "DF=", df ]
        ]
      o = Options (timeChoices       #! lt)
                  (timeChoices       #! dt)
                  (valChoices        #! v )
                  (monadChoices      #! m )
                  (gcChoices         #! g )
                  (closureChoices    #! c )
                  (timeFilterChoices #! lf)
                  (timeFilterChoices #! df)
  return (d, o)

runOptions :: [(Doc, Options)] -> RawExp -> Doc
runOptions os e =
  let (se, c) = stampCPS e
  in P.vsep
    [ P.heading "Source"
    , localSetL P.maxRibbonWidthL 40 $ pretty e
    , P.heading "Stamped"
    , localSetL P.maxRibbonWidthL 40 $ pretty se
    , P.heading "CPS"
    , localSetL P.maxRibbonWidthL 40 $ pretty c
    , P.vsep $ mapOn os $ \ (info, o) -> withOptions o $ \ gc cc ltf dtf ->
        let ς = execOnlyStuck gc cc ltf dtf c
        in P.vsep
            [ pretty info
            , pretty ς
            ]
    ]

flowSensitivityMain :: IO ()
flowSensitivityMain = do
  e <- parseFile "data/lamif-src/flow-sensitivity.lam"
  let os = makeOptions ["0"] ["0"] ["abstract"] ["fi", "fs", "ps"] ["yes"] ["link"] ["app"] ["app"]
  pprint $ runOptions os e

callSiteSensitivityMain :: IO ()
callSiteSensitivityMain = do
  e <- parseFile "data/lamif-src/call-site-sensitivity.lam"
  let os = makeOptions ["0"] ["0", "1"] ["abstract"] ["fi"] ["yes"] ["link"] ["app"] ["app"]
  pprint $ runOptions os e

objectSensitivityMain :: IO ()
objectSensitivityMain = do
  e <- parseFile "data/lamif-src/object-sensitivity.lam"
  let os = makeOptions ["0", "1"] ["0"] ["abstract"] ["fi"] ["yes"] ["link"] ["app"] ["app"]
  pprint $ runOptions os e


text:
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')

require 'db_refactor/move_column'

describe DbRefactor::MoveColumn do
  load_rails_environment

  class Invocator < ActiveRecord::Migration
    include DbRefactor::MoveColumn # notice this ends up on ActiveRecord::Migration, see init.rb

    def self.up
      move_column 'favorite_color', :fancy_users, :target_profiles
    end

    def self.down
      move_column 'favorite_color', :target_profiles, :fancy_users
    end
  end

  describe "include hook" do
    it "should respond to method from module" do
      Invocator.new.should respond_to(:move_column)
      Invocator.new.should respond_to(:each_row)
    end
  end

  describe "integration test with database" do
    class FancyUser < ActiveRecord::Base
      has_one :target_profile
    end
    class TargetProfile < ActiveRecord::Base
      belongs_to :fancy_user
    end

    before :each do
      setup_rails_database
      FancyUser.reset_column_information
      TargetProfile.reset_column_information
    end

    after :each do
      drop_rails_database
    end

    describe "initial condition" do
      it "should have a fancy_users table" do
        user = FancyUser.create(:name => 'the first')
        user.target_profile.should be_blank
      end

      it "should have sane target_profiles table" do
        user = FancyUser.create(:name => 'him')
        profile = TargetProfile.create(:name => 'the first', :fancy_user => user)
        profile.fancy_user.should == user
      end
    end

    describe ".move_column()" do
      before :each do
        @user = FancyUser.create(:name => 'Peter Griffin', :favorite_color => 'blue')
        @user.create_target_profile(:name => 'some profile setting')
      end

      def do_invoke
        Invocator.up
      end

      it "should have favorite_color on user" do
        @user.should respond_to(:favorite_color)
      end

      it "should not have favorite_color on profile" do
        @user.target_profile.should_not respond_to(:favorite_color)
      end

      it "should automatically reload columns for user" do
        FancyUser.expects(:reset_column_information)
        do_invoke
      end

      it "should automatically reload columns for target" do
        TargetProfile.expects(:reset_column_information)
        do_invoke
      end

      it "should move column to target" do
        do_invoke
        @user.target_profile.should respond_to(:favorite_color)
      end

      describe 'the new column in the target table' do
        it 'should have the same attributes as the column in the from table' do
          from_column_attributes = FancyUser.new.column_for_attribute('favorite_number')
          Invocator.move_column 'favorite_number', :fancy_users, :target_profiles
          TargetProfile.new.column_for_attribute('favorite_number').to_yaml.should == from_column_attributes.to_yaml
        end
      end

      it "should no longer be on user when creating new" do
        do_invoke
        FancyUser.new.should_not respond_to(:favorite_color)
      end

      it "should not fix existing instances" do
        do_invoke
        @user.should respond_to(:favorite_color) #notice: @user.favorite_color still exist
        @user.favorite_color.should == 'blue'
      end

      it "should retain the value" do
        do_invoke
        reloaded_user = FancyUser.find(@user)
        reloaded_user.target_profile.favorite_color.should == 'blue'
      end

      it "should create the referenced object if it is missing" do
        no_profile = FancyUser.create(:name => 'No profile here', :favorite_color => 'red')
        do_invoke
        no_profile.target_profile.favorite_color.should == 'red'
      end

      describe "paginated find" do
        before :each do
          FancyUser.delete_all; TargetProfile.delete_all
          1.upto(60) do |i|
            FancyUser.create(:name => "fancy #{i}", :favorite_color => "super intelligent shade of blue ##{i + 42}")
          end
        end

        it "should page through all source-objects 50 at a time" do
          FancyUser.expects(:all).returns([])
          FancyUser.expects(:all).with(has_entry(:limit => 50)).times(2).returns([FancyUser.create]).times(2)
          do_invoke
        end

        it "should create a profile for each" do
          do_invoke
          TargetProfile.count.should == 60
        end
      end
    end

    describe "moving multiple columns at a time" do
      class MultiColumnInvocator < ActiveRecord::Migration
        include DbRefactor::MoveColumn # notice this ends up on ActiveRecord::Migration, see init.rb

        def self.up
          move_column [:favorite_color, :favorite_number], :fancy_users, :target_profiles
        end

        def self.down
          move_column [:favorite_color, :favorite_number], :target_profiles, :fancy_users
        end
      end

      before :each do
        @user = FancyUser.create(:name => 'Peter Griffin',
          :favorite_color => 'blue',
          :favorite_number => 42
        )
      end

      def do_invoke
        MultiColumnInvocator.up
      end

      it "moves favorite color" do
        do_invoke
        @user = FancyUser.find(@user)  # reload after column information has changed
        @user.should_not respond_to(:favorite_color)
        @user.target_profile.should respond_to(:favorite_color)
      end

      it "moves favorite color" do
        do_invoke
        @user = FancyUser.find(@user)
        @user.should_not respond_to(:favorite_number)
        @user.target_profile.should respond_to(:favorite_number)
      end

      it "should reset source column information once" do
        FancyUser.expects(:reset_column_information).once
        do_invoke
      end

      it "should reset target column information once" do
        TargetProfile.expects(:reset_column_information).once
        do_invoke
      end
    end
    describe ".each_row()" do
      before :each do
        FancyUser.delete_all; TargetProfile.delete_all
        @users = []
        1.upto(60) do |i|
          @users << FancyUser.create(:name => "fancy #{i}", :favorite_color => "super intelligent shade of blue ##{i + 42}")
        end
      end

      def do_invoke
        Invocator.each_row(FancyUser) do |row|
          # skip
        end
      end

      it "should page through all source-objects 50 at a time" do
        FancyUser.expects(:all).returns([])
        FancyUser.expects(:all).with(has_entry(:limit => 50)).times(2).returns([FancyUser.create]).times(2)
        do_invoke
      end

      it "should order by id" do
        FancyUser.expects(:all).returns([])
        FancyUser.expects(:all).with(has_entry(:order => 'id')).times(2).returns([FancyUser.create]).times(2)
        do_invoke
      end

      it "should yield each row" do
        Invocator.each_row(FancyUser) do |row|
          row.should == @users.shift
        end
        @users.should be_blank
      end
    end
  end
end


text:
from CIM14.IEC61970.Core.EquipmentContainer import EquipmentContainer

class VoltageLevel(EquipmentContainer):
    """A collection of equipment at one common system voltage forming a switchgear. The equipment typically consist of breakers, busbars, instrumentation, control, regulation and protection devices as well as assemblies of all these.
    """

    def __init__(self, highVoltageLimit=0.0, lowVoltageLimit=0.0, Substation=None, Bays=None, BaseVoltage=None, *args, **kw_args):
        """Initialises a new 'VoltageLevel' instance.

        @param highVoltageLimit: The bus bar's high voltage limit
        @param lowVoltageLimit: The bus bar's low voltage limit
        @param Substation: The association is used in the naming hierarchy.
        @param Bays: The association is used in the naming hierarchy.
        @param BaseVoltage: The base voltage used for all equipment within the VoltageLevel.
        """
        #: The bus bar's high voltage limit
        self.highVoltageLimit = highVoltageLimit

        #: The bus bar's low voltage limit
        self.lowVoltageLimit = lowVoltageLimit

        self._Substation = None
        self.Substation = Substation

        self._Bays = []
        self.Bays = [] if Bays is None else Bays

        self._BaseVoltage = None
        self.BaseVoltage = BaseVoltage

        super(VoltageLevel, self).__init__(*args, **kw_args)

    _attrs = ["highVoltageLimit", "lowVoltageLimit"]
    _attr_types = {"highVoltageLimit": float, "lowVoltageLimit": float}
    _defaults = {"highVoltageLimit": 0.0, "lowVoltageLimit": 0.0}
    _enums = {}
    _refs = ["Substation", "Bays", "BaseVoltage"]
    _many_refs = ["Bays"]

    def getSubstation(self):
        """The association is used in the naming hierarchy.
        """
        return self._Substation

    def setSubstation(self, value):
        if self._Substation is not None:
            filtered = [x for x in self.Substation.VoltageLevels if x != self]
            self._Substation._VoltageLevels = filtered

        self._Substation = value
        if self._Substation is not None:
            if self not in self._Substation._VoltageLevels:
                self._Substation._VoltageLevels.append(self)

    Substation = property(getSubstation, setSubstation)

    def getBays(self):
        """The association is used in the naming hierarchy.
        """
        return self._Bays

    def setBays(self, value):
        for x in self._Bays:
            x.VoltageLevel = None
        for y in value:
            y._VoltageLevel = self
        self._Bays = value

    Bays = property(getBays, setBays)

    def addBays(self, *Bays):
        for obj in Bays:
            obj.VoltageLevel = self

    def removeBays(self, *Bays):
        for obj in Bays:
            obj.VoltageLevel = None

    def getBaseVoltage(self):
        """The base voltage used for all equipment within the VoltageLevel.
        """
        return self._BaseVoltage

    def setBaseVoltage(self, value):
        if self._BaseVoltage is not None:
            filtered = [x for x in self.BaseVoltage.VoltageLevel if x != self]
            self._BaseVoltage._VoltageLevel = filtered

        self._BaseVoltage = value
        if self._BaseVoltage is not None:
            if self not in self._BaseVoltage._VoltageLevel:
                self._BaseVoltage._VoltageLevel.append(self)

    BaseVoltage = property(getBaseVoltage, setBaseVoltage)


text:
/*
 * syslinux/pxe.h
 *
 * PXE definitions and function prototypes for SYSLINUX
 */

#ifndef _SYSLINUX_PXE_H
#define _SYSLINUX_PXE_H

#include <syslinux/pxe_api.h>

/* SYSLINUX-defined PXE utility functions */
int pxe_get_cached_info(int level, void **buf, size_t *len);
int pxe_get_nic_type(t_PXENV_UNDI_GET_NIC_TYPE * gnt);
uint32_t pxe_dns(const char *hostname);

#endif /* _SYSLINUX_PXE_H */


text:
import { connect } from 'react-redux';
import { createStructuredSelector } from 'reselect';

import {
  getCurrentEntity,
  getCurrentEntityType,
  getCurrentEntityChildren,
} from 'store/selectors/entity.selectors';
import { isViewingSharedSector } from 'store/selectors/sector.selectors';
import { isSidebarEditActiveSelector } from 'store/selectors/base.selectors';

import DefaultSidebar from './default-sidebar';

const mapStateToProps = createStructuredSelector({
  isShared: isViewingSharedSector,
  isSidebarEditActive: isSidebarEditActiveSelector,
  entity: getCurrentEntity,
  entityType: getCurrentEntityType,
  entityChildren: getCurrentEntityChildren,
});

export default connect(mapStateToProps)(DefaultSidebar);


text:
/*
Package sessions provides information and interaction with the Session
Persistence feature of the Rackspace Cloud Load Balancer service.

Session persistence is a feature of the load balancing service that forces
multiple requests from clients (of the same protocol) to be directed to the
same node. This is common with many web applications that do not inherently
share application state between back-end servers.

There are two modes to choose from: HTTP_COOKIE and SOURCE_IP. You can only set
one of the session persistence modes on a load balancer, and it can only
support one protocol. If you set HTTP_COOKIE mode for an HTTP load balancer, it
supports session persistence for HTTP requests only. Likewise, if you set
SOURCE_IP mode for an HTTPS load balancer, it supports session persistence for
only HTTPS requests.

To support session persistence for both HTTP and HTTPS requests concurrently,
choose one of the following options:

- Use two load balancers, one configured for session persistence for HTTP
requests and the other configured for session persistence for HTTPS requests.
That way, the load balancers support session persistence for both HTTP and
HTTPS requests concurrently, with each load balancer supporting one of the
protocols.

- Use one load balancer, configure it for session persistence for HTTP requests,
and then enable SSL termination for that load balancer. The load balancer
supports session persistence for both HTTP and HTTPS requests concurrently.
*/
package sessions


text:
+++
date = "2015-12-14T08:36:54-03:00"
draft = false
title = "How to complain about Go"
slug = "go_complain_howto"
tags = ["golang"]

+++
Over the years of existence of Go programming language, the articles with its critique was always popular, bringing a lot of discussion from both sides. Recently, [Maksim Kochkin](https://github.com/ksimka) even created GitHub repo with [curated list](https://github.com/ksimka/go-is-not-good) of articles complaining about golang's imperfection.

So, is it true that ranting about Go flaws is a trend nowadays? With carefully gathered links in the repository above, we can check this! :) Unfortunately, there are only 17 articles in the list, which is a bit disappointing because it's not enough for fine statistical analysis, but we can use this anyway.

Here is a trending line for the [number of Go complaints written per year](https://docs.google.com/spreadsheets/d/1qKFykmm0yapLq1FKuouvqVZkWo-HHCfJnrTikqRoAfs/edit#gid=1956718702):

![Trending](/images/go_rants_trend.png)

The trending is obvious - from one in 2009 to five in 2015. Hopefully, the next 2016 year will continue this trend line.

But what I liked most about this list - is a brief resume on the major authors' points. We can measure the popularity of users' complaints by counting aggregated points. Again, let's do it in our Google Sheet document, which is written in Google, and probably involves a lot of production Go code to let us enjoy this:

![Trending](/images/go_rants_top.png)

Let me write again the top-5 winners:

 - error handling / no exceptions
 - no generics
 - stuck in 70's
 - no OOP
 - too opinionated

Again, it's a bit disappointing that absolute winner (*"error handling"*) is mentioned only 7 times. Many thousands of people are using Go every day and only 7 put their major complaint into words in the form of a blog post? This flank definitely needs more support.

If you don't like Go, you may contribute here. Especially if you tried Go before you started complaining about its design. But how to start the  article to make a proper effect? Take a look at these 5 top complaints and choose on which one you want elaborate.

Keep in mind, *"error handling"* and *"no generics"* are absolute winners - you have absolutely no excuse not to add them to your list. Next, be careful with *"no OOP"* because it's easy to attack by quoting Alan Kay. *"Too opinionated"* is a good choice, but should be carefully argued so you don't look like a grouchy geek rather than a thoughtful hacker. *"Stuck in 70's"* works best if you want not only complain about Go but popularize another modern and objectively good programming language.

But what if it's not enough? There are 41 more other complaints scored 1 or 2 in the list, not including ones you can make up on your own! So, to help you make a choice, here are some rules and guidelines on how to properly complain about Go, depending on you previous background and experience.

For example, if you come from...

## ...Python
We all love Python, so the attack vector should be on the maturity and abundance of libraries. NumPy is a must have point - Go still don't have a scientific library of that quality. Not sure how SpaceX is able to use Go without one, but whatever, NumPy sells well.

Try not to mention mature libraries like Twisted, Requests and various solutions for solving the 10K problem. Just don't mention it. Instead, try to disprove relatively high memory usage in Python. For example, you can say that Python memory usage after goroutines leakage is competitive with Go. Someone from Mozilla [said this](https://docs.google.com/presentation/d/1LO_WI3N-3p2Wp9PDWyv5B6EGFZ8XTOTNJ7Hd40WOUHo/mobilepresent?pli=1&slide=id.g70b0035b2_1_119), so can you.

As a bonus, mention that Go slice indexing doesn't have convenient -1 index. *"Is compiled"* flaw also works here, without any explanation. Just because.

## ...C++
If you're C++ developer, you are in the most vulnerable position, because Go was created as an answer to the C++ problems. Which easily can be muted or presented as powerful features.

Start by demonizing GC. Everyone knows that Garbage Collection is an evil and every CPU tact matters. Even if you write simple REST-backend in C++ and it takes 6 months of your life to accomplish it - you still have speed and no-GC blissfulness. Stick with that.

As a logical continuation - tell that Go is not good for embedded. Don't mention that authors explicitly said that it was never meant as a language for embedded. It's a great point anyway. And if your commenters will send you links to [Embd](http://embd.kidoman.io), [Gobot](http://gobot.io) or [gomobile](https://github.com/golang/mobile), just say that it's not True Embedded™ or just disable comments.

And, of course, all rants about how Go restricting you from shooting yourself in the foot are also great here. Go doesn't make you feel clever than your coworker that bangs his head against the wall trying to understand your code. Why do you need such a language after all?

## ...Rust
Despite the fact that there aren't many people in the wild who can claim "background in Rust", there are still a bunch of people from C++ background who are totally in love with Rust. They didn't try it in production or even for pet projects, but that's not important. Pure love doesn't need logic. So, many points valid for C++ developers will work for you also. Don't forget *"zero-cost abstraction"* phrase after mentioning how evil GC is.

Cargo is considered to be a good solution for dependency management, so attack this side of Go aggressively. No chance to lose here. Also, your key points should be Go's simple type system and lack of pattern matching. Basically, everything that differs in Go from Rust will work here. And that's a lot, so you can write a solid longread. Or two.

## ...Java
After mentioning generics and exceptions, punch them in the guts and smash them by comparing Java's IDE with Go's IDE. Of course, there is no Go IDE, because Go is too simple to require one, but it's bad also. Double kick. It's "advanced" vs "primitive" and you're a winner here.

Next, write about the lack of good debugger (integrated into IDE, of course). How can someone write even simple code without a debugger? Don't ask if you really need debugger in Go that much as you need it in Java and why. Stay away from this subject, it's slippery.

And the whole range of 'features' that you can use to make people understand why Go is bad - from lack of JVM to *"lack of basic data structures"*. Take your time and improvise while your IDE starts.

## ...Ruby
If you come from Ruby and don't really like Go, I probably won't help you. Go is quite popular in Ruby community and many Ruby developers, being non-arrogant and pragmatic, fall into Go pretty easily, so you're in trouble. Even Basecamp, the guys that made Ruby on Rails, [love Go](https://signalvnoise.com/posts/3897-go-at-basecamp) and use it inside. Sorry.

## ...D
Without any doubts, your main argument (after generics and exceptions, of course) should be the name of Google. It's pretty much obvious that popularity of Go is simply a result of a huge money support by Google. Of course, Google pays people a lot to write articles about Go and to organize conferences and meetups. They are so rich, that next year Go community will have [6 international conferences](https://github.com/golang/go/wiki/Conferences) including one in [Dubai](http://www.gophercon.ae/)! When D have a company that can do the same for D, the world will understand that Go's popularity is a fake.

Also, Go is not a real system programming language. You can't write your own memory allocator with Go. So switch to D. Please.

## ...Perl
Emm..

## ...C\#
Probably the best strategy here is to attack the simplicity of Go. Simplicity equals primitivity, everyone knows in MS world. Also Go is made by Google, not by MS, so it's doomed. There are so many good solutions for modern programming language theory you learn in the college course of C#! But poor people behind Go just are not aware of them. Don't hesitate to teach them. You can't do pretty much anything with a language that primitive as Go.

Also, mention the most relevant things - no Visual Studio support ([Visual Studio Code's Go plugin](https://github.com/microsoft/vscode-go) doesn't count). No debugger in IDE, of course. And no DirectX support, that's important.

## ...Haskell
If you come from Haskell, I shouldn't give you any advice. You already must be a professional in mocking Go. It's in Haskell 101 course. New Haskell books contain special chapter "How to laugh on Go", after all.

Even if you [intuitively understand](https://honza.ca/2015/11/language-choice) that Go is way more practical than Haskell and entry barrier really matters - keep insisting that it has "objectively poor design". Because everyone knows which language has objectively good design.

Bonus points can be earned by [using](https://twitter.com/bhurt42/status/940629768126521344) thought-terminating cliché that Go authors think developers are not smart enough to understand brilliant language, which there only one and only. Benefits of using this soundbite "[were demonstrated over and over](https://twitter.com/puffnfresh/status/940829295290830849)".

# Conclusion
I hope this article will find its readers. In 2016, we need more articles with rants on Go - at least 6 to keep the trend. Some of the articles in the list above written by students and schoolboys, so if you just started CS class and don't have any real-life experience - don't hesitate to tell the world how bad Go is.

After all, the viral effect of the articles with criticism is well known - colleagues and managers send you the link as a prove that you shouldn't use Go in production, without even reading or analyzing its content. The title is usually enough, so don't be afraid.

Or.. you can just write some good code in the language that works best for your case.


text:
package fr.tolc.jahia.intellij.plugin.cnd.psi.identifiers;

import com.intellij.psi.PsiNameIdentifierOwner;

public interface CndNodeTypeIdentifierElement extends PsiNameIdentifierOwner {
}


text:
export OMP_NUM_THREADS=JOB.THREADS
JOB.OPTION
sh JOB.JOB


text:
{-# OPTIONS_GHC -fwarn-safe #-}
-- | Basic test to see if Safe warning flags compile
-- Warn if module is inferred safe
-- In this test the warning _should_ fire
module SafeFlags25 where

f :: Int
f = 1


text:
{% extends "layout.html" %}

{% block page_title %}
  Sprint {{sprint}} - Funding
{% endblock %}

{% block inside_header %}

{% endblock %}

{% block after_header %}
{% include "sprint/"+sprint+"/includes/header.html" %}
{% endblock %}

{% block content %}

  {% include "includes/link-back.html" %}

          zxcvbn experiment

I am trying to discover if users can find anomolies in their password entry quicker than they can read similar length and types of words

The experiment aims to prove that a user can identify an issue in a pattern of words quicker than a third party can understand those words when spelt correctly.

The aim is to build a 'peek' feature on a password input that visibly shows a user their password only for as long as they need to see it, making it impossible for a user to use over the shoulder tactics to steal the password. Even taking a photo would require the hacker to capture an image with split second reaction times. A video would be required and as in entering a pin people should/can protect their input from prolonged view. This statement makes it clear this is not a solution but an enhancement to an issue that plagues many a user in their day to day lives.

    <form>

            Real word
            Enter the word the user wrote down as is.

          <input class="form-control" id="real-word" type="text">

            fake word
            Make only a small typical keyboard entry error

          <input class="form-control" id="fake-word" type="text">

        Continue
    </form>

{% endblock %}


text:
import {Component} from '@angular/core';
import {LoginService} from '../services/login.service';

@Component({
  selector: 'nav-bar',
  templateUrl: './nav-bar.component.html'
})
export class NavBar{

  myLocalStorage;

  constructor (private loginService:LoginService) {
    this.myLocalStorage=localStorage;
  }

  onClick() {
    if (this.loginService.checkLogin()) {
      this.loginService.logout();
    }
  }

}


text:
package chunk

import (
	"fmt"
	"math/bits"
	"reflect"
	"time"
	"unsafe"

	"github.com/pingcap/tidb/types"
	"github.com/pingcap/tidb/types/json"
	"github.com/pingcap/tidb/util/hack"
)

// AppendDuration appends a duration value into this Column.
// Fsp is ignored.
func (c *Column) AppendDuration(dur types.Duration) {
	c.AppendInt64(int64(dur.Duration))
}

// AppendMyDecimal appends a MyDecimal value into this Column.
func (c *Column) AppendMyDecimal(dec *types.MyDecimal) {
	*(*types.MyDecimal)(unsafe.Pointer(&c.elemBuf[0])) = *dec
	c.finishAppendFixed()
}

func (c *Column) appendNameValue(name string, val uint64) {
	var buf [8]byte
	copy(buf[:], (*[8]byte)(unsafe.Pointer(&val))[:])
	c.data = append(c.data, buf[:]...)
	c.data = append(c.data, name...)
	c.finishAppendVar()
}

// AppendJSON appends a BinaryJSON value into this Column.
func (c *Column) AppendJSON(j json.BinaryJSON) {
	c.data = append(c.data, j.TypeCode)
	c.data = append(c.data, j.Value...)
	c.finishAppendVar()
}

// AppendSet appends a Set value into this Column.
func (c *Column) AppendSet(set types.Set) {
	c.appendNameValue(set.Name, set.Value)
}

// Column stores one column of data in Apache Arrow format.
// See https://arrow.apache.org/docs/format/Columnar.html#format-columnar
type Column struct {
	length     int
	nullBitmap []byte  // bit 0 is null, 1 is not null
	offsets    []int64 // used for varLen column. Row i starts from data[offsets[i]]
	data       []byte
	elemBuf    []byte

	avoidReusing bool // avoid reusing the Column by allocator
}

// ColumnAllocator defines an allocator for Column.
type ColumnAllocator interface {
	NewColumn(ft *types.FieldType, count int) *Column
}

// DefaultColumnAllocator is the default implementation of ColumnAllocator.
type DefaultColumnAllocator struct{}

// NewColumn implements the ColumnAllocator interface.
func (DefaultColumnAllocator) NewColumn(ft *types.FieldType, capacity int) *Column {
	return newColumn(getFixedLen(ft), capacity)
}

// NewColumn creates a new column with the specific type and capacity.
func NewColumn(ft *types.FieldType, capacity int) *Column {
	return newColumn(getFixedLen(ft), capacity)
}

func newColumn(ts, capacity int) *Column {
	var col *Column
	if ts == varElemLen {
		col = newVarLenColumn(capacity)
	} else {
		col = newFixedLenColumn(ts, capacity)
	}
	return col
}

// newFixedLenColumn creates a fixed length Column with elemLen and initial data capacity.
func newFixedLenColumn(elemLen, capacity int) *Column {
	return &Column{
		elemBuf:    make([]byte, elemLen),
		data:       make([]byte, 0, capacity*elemLen),
		nullBitmap: make([]byte, 0, (capacity+7)>>3),
	}
}

// newVarLenColumn creates a variable length Column with initial data capacity.
func newVarLenColumn(capacity int) *Column {
	estimatedElemLen := 8
	// For varLenColumn (e.g. varchar), the accurate length of an element is unknown.
	// Therefore, in the first executor.Next we use an experience value -- 8 (so it may make runtime.growslice)

	return &Column{
		offsets:    make([]int64, 1, capacity+1),
		data:       make([]byte, 0, capacity*estimatedElemLen),
		nullBitmap: make([]byte, 0, (capacity+7)>>3),
	}
}

func (c *Column) typeSize() int {
	if len(c.elemBuf) > 0 {
		return len(c.elemBuf)
	}
	return varElemLen
}

func (c *Column) isFixed() bool {
	return c.elemBuf != nil
}

// Reset resets this Column according to the EvalType.
// Different from reset, Reset will reset the elemBuf.
func (c *Column) Reset(eType types.EvalType) {
	switch eType {
	case types.ETInt:
		c.ResizeInt64(0, false)
	case types.ETReal:
		c.ResizeFloat64(0, false)
	case types.ETDecimal:
		c.ResizeDecimal(0, false)
	case types.ETString:
		c.ReserveString(0)
	case types.ETDatetime, types.ETTimestamp:
		c.ResizeTime(0, false)
	case types.ETDuration:
		c.ResizeGoDuration(0, false)
	case types.ETJson:
		c.ReserveJSON(0)
	default:
		panic(fmt.Sprintf("invalid EvalType %v", eType))
	}
}

// reset resets the underlying data of this Column but doesn't modify its data type.
func (c *Column) reset() {
	c.length = 0
	c.nullBitmap = c.nullBitmap[:0]
	if len(c.offsets) > 0 {
		// The first offset is always 0, it makes slicing the data easier, we need to keep it.
		c.offsets = c.offsets[:1]
	}
	c.data = c.data[:0]
}

// IsNull returns if this row is null.
func (c *Column) IsNull(rowIdx int) bool {
	nullByte := c.nullBitmap[rowIdx/8]
	return nullByte&(1<<(uint(rowIdx)&7)) == 0
}

// CopyConstruct copies this Column to dst.
// If dst is nil, it creates a new Column and returns it.
func (c *Column) CopyConstruct(dst *Column) *Column {
	if dst != nil {
		dst.length = c.length
		dst.nullBitmap = append(dst.nullBitmap[:0], c.nullBitmap...)
		dst.offsets = append(dst.offsets[:0], c.offsets...)
		dst.data = append(dst.data[:0], c.data...)
		dst.elemBuf = append(dst.elemBuf[:0], c.elemBuf...)
		return dst
	}
	newCol := &Column{length: c.length}
	newCol.nullBitmap = append(newCol.nullBitmap, c.nullBitmap...)
	newCol.offsets = append(newCol.offsets, c.offsets...)
	newCol.data = append(newCol.data, c.data...)
	newCol.elemBuf = append(newCol.elemBuf, c.elemBuf...)
	return newCol
}

func (c *Column) appendNullBitmap(notNull bool) {
	idx := c.length >> 3
	if idx >= len(c.nullBitmap) {
		c.nullBitmap = append(c.nullBitmap, 0)
	}
	if notNull {
		pos := uint(c.length) & 7
		c.nullBitmap[idx] |= byte(1 << pos)
	}
}

// appendMultiSameNullBitmap appends multiple same bit value to `nullBitMap`.
// notNull means not null.
// num means the number of bits that should be appended.
func (c *Column) appendMultiSameNullBitmap(notNull bool, num int) {
	numNewBytes := ((c.length + num + 7) >> 3) - len(c.nullBitmap)
	b := byte(0)
	if notNull {
		b = 0xff
	}
	for i := 0; i < numNewBytes; i++ {
		c.nullBitmap = append(c.nullBitmap, b)
	}
	if !notNull {
		return
	}
	// 1. Set all the remaining bits in the last slot of old c.numBitMap to 1.
	numRemainingBits := uint(c.length % 8)
	bitMask := byte(^((1 << numRemainingBits) - 1))
	c.nullBitmap[c.length/8] |= bitMask
	// 2. Set all the redundant bits in the last slot of new c.numBitMap to 0.
	numRedundantBits := uint(len(c.nullBitmap)*8 - c.length - num)
	bitMask = byte(1<<(8-numRedundantBits)) - 1
	c.nullBitmap[len(c.nullBitmap)-1] &= bitMask
}

// AppendNull appends a null value into this Column.
func (c *Column) AppendNull() {
	c.appendNullBitmap(false)
	if c.isFixed() {
		c.data = append(c.data, c.elemBuf...)
	} else {
		c.offsets = append(c.offsets, c.offsets[c.length])
	}
	c.length++
}

func (c *Column) finishAppendFixed() {
	c.data = append(c.data, c.elemBuf...)
	c.appendNullBitmap(true)
	c.length++
}

// AppendInt64 appends an int64 value into this Column.
func (c *Column) AppendInt64(i int64) {
	*(*int64)(unsafe.Pointer(&c.elemBuf[0])) = i
	c.finishAppendFixed()
}

// AppendUint64 appends a uint64 value into this Column.
func (c *Column) AppendUint64(u uint64) {
	*(*uint64)(unsafe.Pointer(&c.elemBuf[0])) = u
	c.finishAppendFixed()
}

// AppendFloat32 appends a float32 value into this Column.
func (c *Column) AppendFloat32(f float32) {
	*(*float32)(unsafe.Pointer(&c.elemBuf[0])) = f
	c.finishAppendFixed()
}

// AppendFloat64 appends a float64 value into this Column.
func (c *Column) AppendFloat64(f float64) {
	*(*float64)(unsafe.Pointer(&c.elemBuf[0])) = f
	c.finishAppendFixed()
}

func (c *Column) finishAppendVar() {
	c.appendNullBitmap(true)
	c.offsets = append(c.offsets, int64(len(c.data)))
	c.length++
}

// AppendString appends a string value into this Column.
func (c *Column) AppendString(str string) {
	c.data = append(c.data, str...)
	c.finishAppendVar()
}

// AppendBytes appends a byte slice into this Column.
func (c *Column) AppendBytes(b []byte) {
	c.data = append(c.data, b...)
	c.finishAppendVar()
}

// AppendTime appends a time value into this Column.
func (c *Column) AppendTime(t types.Time) {
	*(*types.Time)(unsafe.Pointer(&c.elemBuf[0])) = t
	c.finishAppendFixed()
}

// AppendEnum appends a Enum value into this Column.
func (c *Column) AppendEnum(enum types.Enum) {
	c.appendNameValue(enum.Name, enum.Value)
}

const (
	sizeInt64      = int(unsafe.Sizeof(int64(0)))
	sizeUint64     = int(unsafe.Sizeof(uint64(0)))
	sizeFloat32    = int(unsafe.Sizeof(float32(0)))
	sizeFloat64    = int(unsafe.Sizeof(float64(0)))
	sizeMyDecimal  = int(unsafe.Sizeof(types.MyDecimal{}))
	sizeGoDuration = int(unsafe.Sizeof(time.Duration(0)))
	sizeTime       = int(unsafe.Sizeof(types.ZeroTime))
)

var (
	emptyBuf = make([]byte, 4*1024)
)

// resize resizes the column so that it contains n elements, only valid for fixed-length types.
func (c *Column) resize(n, typeSize int, isNull bool) {
	sizeData := n * typeSize
	if cap(c.data) >= sizeData {
		(*reflect.SliceHeader)(unsafe.Pointer(&c.data)).Len = sizeData
	} else {
		c.data = make([]byte, sizeData)
	}
	if !isNull {
		for j := 0; j < sizeData; j += len(emptyBuf) {
			copy(c.data[j:], emptyBuf)
		}
	}

	newNulls := false
	sizeNulls := (n + 7) >> 3
	if cap(c.nullBitmap) >= sizeNulls {
		(*reflect.SliceHeader)(unsafe.Pointer(&c.nullBitmap)).Len = sizeNulls
	} else {
		c.nullBitmap = make([]byte, sizeNulls)
		newNulls = true
	}
	if !isNull || !newNulls {
		var nullVal byte
		if !isNull {
			nullVal = 0xFF
		}
		for i := range c.nullBitmap {
			c.nullBitmap[i] = nullVal
		}
	}

	if cap(c.elemBuf) >= typeSize {
		(*reflect.SliceHeader)(unsafe.Pointer(&c.elemBuf)).Len = typeSize
	} else {
		c.elemBuf = make([]byte, typeSize)
	}

	c.length = n
}

// reserve makes the column capacity be at least enough to contain n elements.
// this method is only valid for var-length types and estElemSize is the estimated size of this type.
func (c *Column) reserve(n, estElemSize int) {
	sizeData := n * estElemSize
	if cap(c.data) >= sizeData {
		c.data = c.data[:0]
	} else {
		c.data = make([]byte, 0, sizeData)
	}

	sizeNulls := (n + 7) >> 3
	if cap(c.nullBitmap) >= sizeNulls {
		c.nullBitmap = c.nullBitmap[:0]
	} else {
		c.nullBitmap = make([]byte, 0, sizeNulls)
	}

	sizeOffs := n + 1
	if cap(c.offsets) >= sizeOffs {
		c.offsets = c.offsets[:1]
	} else {
		c.offsets = make([]int64, 1, sizeOffs)
	}

	c.elemBuf = nil
	c.length = 0
}

// SetNull sets the rowIdx to null.
func (c *Column) SetNull(rowIdx int, isNull bool) {
	if isNull {
		c.nullBitmap[rowIdx>>3] &= ^(1 << uint(rowIdx&7))
	} else {
		c.nullBitmap[rowIdx>>3] |= 1 << uint(rowIdx&7)
	}
}

// SetNulls sets rows in [begin, end) to null.
func (c *Column) SetNulls(begin, end int, isNull bool) {
	i := ((begin + 7) >> 3) << 3
	for ; begin < i && begin < end; begin++ {
		c.SetNull(begin, isNull)
	}
	var v uint8
	if !isNull {
		v = (1 << 8) - 1
	}
	for ; begin+8 <= end; begin += 8 {
		c.nullBitmap[begin>>3] = v
	}
	for ; begin < end; begin++ {
		c.SetNull(begin, isNull)
	}
}

// nullCount returns the number of nulls in this Column.
func (c *Column) nullCount() int {
	var cnt, i int
	for ; i+8 <= c.length; i += 8 {
		// 0 is null and 1 is not null
		cnt += 8 - bits.OnesCount8(c.nullBitmap[i>>3])
	}
	for ; i < c.length; i++ {
		if c.IsNull(i) {
			cnt++
		}
	}
	return cnt
}

// ResizeInt64 resizes the column so that it contains n int64 elements.
func (c *Column) ResizeInt64(n int, isNull bool) {
	c.resize(n, sizeInt64, isNull)
}

// ResizeUint64 resizes the column so that it contains n uint64 elements.
func (c *Column) ResizeUint64(n int, isNull bool) {
	c.resize(n, sizeUint64, isNull)
}

// ResizeFloat32 resizes the column so that it contains n float32 elements.
func (c *Column) ResizeFloat32(n int, isNull bool) {
	c.resize(n, sizeFloat32, isNull)
}

// ResizeFloat64 resizes the column so that it contains n float64 elements.
func (c *Column) ResizeFloat64(n int, isNull bool) {
	c.resize(n, sizeFloat64, isNull)
}

// ResizeDecimal resizes the column so that it contains n decimal elements.
func (c *Column) ResizeDecimal(n int, isNull bool) {
	c.resize(n, sizeMyDecimal, isNull)
}

// ResizeGoDuration resizes the column so that it contains n duration elements.
func (c *Column) ResizeGoDuration(n int, isNull bool) {
	c.resize(n, sizeGoDuration, isNull)
}

// ResizeTime resizes the column so that it contains n Time elements.
func (c *Column) ResizeTime(n int, isNull bool) {
	c.resize(n, sizeTime, isNull)
}

// ReserveString changes the column capacity to store n string elements and set the length to zero.
func (c *Column) ReserveString(n int) {
	c.reserve(n, 8)
}

// ReserveBytes changes the column capacity to store n bytes elements and set the length to zero.
func (c *Column) ReserveBytes(n int) {
	c.reserve(n, 8)
}

// ReserveJSON changes the column capacity to store n JSON elements and set the length to zero.
func (c *Column) ReserveJSON(n int) {
	c.reserve(n, 8)
}

// ReserveSet changes the column capacity to store n set elements and set the length to zero.
func (c *Column) ReserveSet(n int) {
	c.reserve(n, 8)
}

// ReserveEnum changes the column capacity to store n enum elements and set the length to zero.
func (c *Column) ReserveEnum(n int) {
	c.reserve(n, 8)
}

func (c *Column) castSliceHeader(header *reflect.SliceHeader, typeSize int) {
	header.Data = (*reflect.SliceHeader)(unsafe.Pointer(&c.data)).Data
	header.Len = c.length
	header.Cap = cap(c.data) / typeSize
}

// Int64s returns an int64 slice stored in this Column.
func (c *Column) Int64s() []int64 {
	var res []int64
	c.castSliceHeader((*reflect.SliceHeader)(unsafe.Pointer(&res)), sizeInt64)
	return res
}

// Uint64s returns a uint64 slice stored in this Column.
func (c *Column) Uint64s() []uint64 {
	var res []uint64
	c.castSliceHeader((*reflect.SliceHeader)(unsafe.Pointer(&res)), sizeUint64)
	return res
}

// Float32s returns a float32 slice stored in this Column.
func (c *Column) Float32s() []float32 {
	var res []float32
	c.castSliceHeader((*reflect.SliceHeader)(unsafe.Pointer(&res)), sizeFloat32)
	return res
}

// Float64s returns a float64 slice stored in this Column.
func (c *Column) Float64s() []float64 {
	var res []float64
	c.castSliceHeader((*reflect.SliceHeader)(unsafe.Pointer(&res)), sizeFloat64)
	return res
}

// GoDurations returns a Golang time.Duration slice stored in this Column.
// Different from the Row.GetDuration method, the argument Fsp is ignored, so the user should handle it outside.
func (c *Column) GoDurations() []time.Duration {
	var res []time.Duration
	c.castSliceHeader((*reflect.SliceHeader)(unsafe.Pointer(&res)), sizeGoDuration)
	return res
}

// Decimals returns a MyDecimal slice stored in this Column.
func (c *Column) Decimals() []types.MyDecimal {
	var res []types.MyDecimal
	c.castSliceHeader((*reflect.SliceHeader)(unsafe.Pointer(&res)), sizeMyDecimal)
	return res
}

// Times returns a Time slice stored in this Column.
func (c *Column) Times() []types.Time {
	var res []types.Time
	c.castSliceHeader((*reflect.SliceHeader)(unsafe.Pointer(&res)), sizeTime)
	return res
}

// GetInt64 returns the int64 in the specific row.
func (c *Column) GetInt64(rowID int) int64 {
	return *(*int64)(unsafe.Pointer(&c.data[rowID*8]))
}

// GetUint64 returns the uint64 in the specific row.
func (c *Column) GetUint64(rowID int) uint64 {
	return *(*uint64)(unsafe.Pointer(&c.data[rowID*8]))
}

// GetFloat32 returns the float32 in the specific row.
func (c *Column) GetFloat32(rowID int) float32 {
	return *(*float32)(unsafe.Pointer(&c.data[rowID*4]))
}

// GetFloat64 returns the float64 in the specific row.
func (c *Column) GetFloat64(rowID int) float64 {
	return *(*float64)(unsafe.Pointer(&c.data[rowID*8]))
}

// GetDecimal returns the decimal in the specific row.
func (c *Column) GetDecimal(rowID int) *types.MyDecimal {
	return (*types.MyDecimal)(unsafe.Pointer(&c.data[rowID*types.MyDecimalStructSize]))
}

// GetString returns the string in the specific row.
func (c *Column) GetString(rowID int) string {
	return string(hack.String(c.data[c.offsets[rowID]:c.offsets[rowID+1]]))
}

// GetJSON returns the JSON in the specific row.
func (c *Column) GetJSON(rowID int) json.BinaryJSON {
	start := c.offsets[rowID]
	return json.BinaryJSON{TypeCode: c.data[start], Value: c.data[start+1 : c.offsets[rowID+1]]}
}

// GetBytes returns the byte slice in the specific row.
func (c *Column) GetBytes(rowID int) []byte {
	return c.data[c.offsets[rowID]:c.offsets[rowID+1]]
}

// GetEnum returns the Enum in the specific row.
func (c *Column) GetEnum(rowID int) types.Enum {
	name, val := c.getNameValue(rowID)
	return types.Enum{Name: name, Value: val}
}

// GetSet returns the Set in the specific row.
func (c *Column) GetSet(rowID int) types.Set {
	name, val := c.getNameValue(rowID)
	return types.Set{Name: name, Value: val}
}

// GetTime returns the Time in the specific row.
func (c *Column) GetTime(rowID int) types.Time {
	return *(*types.Time)(unsafe.Pointer(&c.data[rowID*sizeTime]))
}

// GetDuration returns the Duration in the specific row.
func (c *Column) GetDuration(rowID int, fillFsp int) types.Duration {
	dur := *(*int64)(unsafe.Pointer(&c.data[rowID*8]))
	return types.Duration{Duration: time.Duration(dur), Fsp: fillFsp}
}

func (c *Column) getNameValue(rowID int) (string, uint64) {
	start, end := c.offsets[rowID], c.offsets[rowID+1]
	if start == end {
		return "", 0
	}
	var val uint64
	copy((*[8]byte)(unsafe.Pointer(&val))[:], c.data[start:])
	return string(hack.String(c.data[start+8 : end])), val
}

// GetRaw returns the underlying raw bytes in the specific row.
func (c *Column) GetRaw(rowID int) []byte {
	var data []byte
	if c.isFixed() {
		elemLen := len(c.elemBuf)
		data = c.data[rowID*elemLen : rowID*elemLen+elemLen]
	} else {
		data = c.data[c.offsets[rowID]:c.offsets[rowID+1]]
	}
	return data
}

// SetRaw sets the raw bytes for the rowIdx-th element.
// NOTE: Two conditions must be satisfied before calling this function:
// 1. The column should be stored with variable-length elements.
// 2. The length of the new element should be exactly the same as the old one.
func (c *Column) SetRaw(rowID int, bs []byte) {
	copy(c.data[c.offsets[rowID]:c.offsets[rowID+1]], bs)
}

// reconstruct reconstructs this Column by removing all filtered rows in it according to sel.
func (c *Column) reconstruct(sel []int) {
	if sel == nil {
		return
	}
	if c.isFixed() {
		elemLen := len(c.elemBuf)
		for dst, src := range sel {
			idx := dst >> 3
			pos := uint16(dst & 7)
			if c.IsNull(src) {
				c.nullBitmap[idx] &= ^byte(1 << pos)
			} else {
				copy(c.data[dst*elemLen:dst*elemLen+elemLen], c.data[src*elemLen:src*elemLen+elemLen])
				c.nullBitmap[idx] |= byte(1 << pos)
			}
		}
		c.data = c.data[:len(sel)*elemLen]
	} else {
		tail := 0
		for dst, src := range sel {
			idx := dst >> 3
			pos := uint(dst & 7)
			if c.IsNull(src) {
				c.nullBitmap[idx] &= ^byte(1 << pos)
				c.offsets[dst+1] = int64(tail)
			} else {
				start, end := c.offsets[src], c.offsets[src+1]
				copy(c.data[tail:], c.data[start:end])
				tail += int(end - start)
				c.offsets[dst+1] = int64(tail)
				c.nullBitmap[idx] |= byte(1 << pos)
			}
		}
		c.data = c.data[:tail]
		c.offsets = c.offsets[:len(sel)+1]
	}
	c.length = len(sel)

	// clean nullBitmap
	c.nullBitmap = c.nullBitmap[:(len(sel)+7)>>3]
	idx := len(sel) >> 3
	if idx < len(c.nullBitmap) {
		pos := uint16(len(sel) & 7)
		c.nullBitmap[idx] &= byte((1 << pos) - 1)
	}
}

// CopyReconstruct copies this Column to dst and removes unselected rows.
// If dst is nil, it creates a new Column and returns it.
func (c *Column) CopyReconstruct(sel []int, dst *Column) *Column {
	if sel == nil {
		return c.CopyConstruct(dst)
	}

	selLength := len(sel)
	if selLength == c.length {
		// The variable 'ascend' is used to check if the sel array is in ascending order
		ascend := true
		for i := 1; i < selLength; i++ {
			if sel[i] < sel[i-1] {
				ascend = false
				break
			}
		}
		if ascend {
			return c.CopyConstruct(dst)
		}
	}

	if dst == nil {
		dst = newColumn(c.typeSize(), len(sel))
	} else {
		dst.reset()
	}

	if c.isFixed() {
		elemLen := len(c.elemBuf)
		dst.elemBuf = make([]byte, elemLen)
		for _, i := range sel {
			dst.appendNullBitmap(!c.IsNull(i))
			dst.data = append(dst.data, c.data[i*elemLen:i*elemLen+elemLen]...)
			dst.length++
		}
	} else {
		dst.elemBuf = nil
		if len(dst.offsets) == 0 {
			dst.offsets = append(dst.offsets, 0)
		}
		for _, i := range sel {
			dst.appendNullBitmap(!c.IsNull(i))
			start, end := c.offsets[i], c.offsets[i+1]
			dst.data = append(dst.data, c.data[start:end]...)
			dst.offsets = append(dst.offsets, int64(len(dst.data)))
			dst.length++
		}
	}
	return dst
}

// MergeNulls merges these columns' null bitmaps.
// For a row, if any column of it is null, the result is null.
// It works like: if col1.IsNull || col2.IsNull || col3.IsNull.
// The caller should ensure that all these columns have the same
// length, and data stored in the result column is fixed-length type.
func (c *Column) MergeNulls(cols ...*Column) {
	if !c.isFixed() {
		panic("result column should be fixed-length type")
	}
	for _, col := range cols {
		if c.length != col.length {
			panic(fmt.Sprintf("should ensure all columns have the same length, expect %v, but got %v", c.length, col.length))
		}
	}
	for _, col := range cols {
		for i := range c.nullBitmap {
			// bit 0 is null, 1 is not null, so do AND operations here.
			c.nullBitmap[i] &= col.nullBitmap[i]
		}
	}
}


text:
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="ISelectDirectoryService.cs" company="Catel development team">
//   Copyright (c) 2008 - 2015 Catel development team. All rights reserved.
// </copyright>
// --------------------------------------------------------------------------------------------------------------------
namespace Catel.Services
{
    /// <summary>
    /// Interface for the Select Directory service.
    /// </summary>
    public interface ISelectDirectoryService
    {
        #region Properties
        /// <summary>
        /// Gets or sets the name of the file.
        /// </summary>
        /// <value>The name of the file.</value>
        string FileName { get; set; }

        /// <summary>
        /// Gets or sets the filter to use when opening or saving the file.
        /// </summary>
        /// <value>The filter.</value>
        string Filter { get; set; }

        /// <summary>
        /// Gets the directory name.
        /// </summary>
        string DirectoryName { get; }

        /// <summary>
        /// Gets or sets a value indicating whether to show the new folder button to be able to create new folders while browsing.
        /// </summary>
        /// <value><c>true</c> if the new folder button should be shown; otherwise, <c>false</c>.</value>
        bool ShowNewFolderButton { get; set; }

        /// <summary>
        /// Gets or sets the initial directory.
        /// </summary>
        /// <value>The initial directory.</value>
        string InitialDirectory { get; set; }

        /// <summary>
        /// Gets or sets the title which will be used for display.
        /// </summary>
        /// <value>The title.</value>
        string Title { get; set; }
        #endregion

        #region Methods
        /// <summary>
        /// Determines the name of the directory what will be used.
        /// </summary>
        /// <returns>
        /// <c>true</c> if a directory is selected; otherwise <c>false</c>.
        /// </returns>
        /// <remarks>
        /// If this method returns <c>true</c>, the <see cref="DirectoryName"/> property will be filled with the directory name. Otherwise,
        /// no changes will occur to the data of this object.
        /// </remarks>
        bool DetermineDirectory();
        #endregion
    }
}


text:
#ifdef _MSC_VER
  #pragma warning( disable : 4503 )     //truncated name decoration
#endif

#include "viennagrid/forwards.hpp"
#include "viennagrid/config/default_configs.hpp"
#include "viennagrid/io/netgen_reader.hpp"
#include "viennagrid/io/vtk_reader.hpp"
#include "viennagrid/algorithm/interface.hpp"
#include "viennagrid/algorithm/volume.hpp"

template <typename MeshType, typename ReaderType>
void test(ReaderType & my_reader, std::string const & infile)
{
  typedef typename viennagrid::result_of::segmentation<MeshType>::type      SegmentationType;
  typedef typename viennagrid::result_of::segment_handle<SegmentationType>::type     SegmentHandleType;

  typedef typename viennagrid::result_of::vertex_range<MeshType>::type        VertexContainer;
  typedef typename viennagrid::result_of::iterator<VertexContainer>::type       VertexIterator;

  typedef typename viennagrid::result_of::facet_range<MeshType>::type         FacetContainer;
  typedef typename viennagrid::result_of::iterator<FacetContainer>::type        FacetIterator;

  MeshType mesh;
  SegmentationType segmentation(mesh);

  //read from file:
  try
  {
    my_reader(mesh, segmentation, infile);
  }
  catch (std::exception const & ex)
  {
    std::cout << "what(): " << ex.what() << std::endl;
    std::cerr << "File-Reader failed. Aborting program..." << std::endl;
    exit(EXIT_FAILURE);
  }

  assert(segmentation.size() > 1 && "Not enough segments!");

  typename SegmentationType::iterator it = segmentation.begin();
  SegmentHandleType const & seg1 = *it; ++it;
  SegmentHandleType const & seg2 = *it;

  //
  // Test 1: Iterate over all interface facets:
  //
  std::cout << "*" << std::endl;
  std::cout << "* Test 1: Iteration over all facets on the boundary:" << std::endl;
  std::cout << "*" << std::endl;
  double surface = 0;
  FacetContainer facets(mesh);
  for (FacetIterator fit = facets.begin();
       fit != facets.end();
       ++fit)
  {
    if (viennagrid::is_interface(seg1, seg2, *fit))
    {
      std::cout << *fit << std::endl;
      surface += viennagrid::volume(*fit);
    }
  }

  std::cout << "Volume of interface elements: " << surface << std::endl;

  /*if ( fabs(reference_surface - surface) / reference_surface > 1e-6 )
  {
    std::cout << "Surface area incorrect! Should: " << reference_surface << ", is: " << surface << std::endl;
    exit(EXIT_FAILURE);
  }*/

  //
  // Test 2: Print all vertices on the interface:
  //
  std::cout << "*" << std::endl;
  std::cout << "* Test 2: Iteration over all vertices on the interface" << std::endl;
  std::cout << "*" << std::endl;
  bool vertices_found = false;
  VertexContainer vertices(mesh);
  for (VertexIterator vit = vertices.begin();
       vit != vertices.end();
       ++vit)
  {
    if (viennagrid::is_interface(seg1, seg2, *vit))
    {
      assert( viennagrid::point(mesh ,*vit)[0] == 0.5 && "Invalid point detected on interface!");
      std::cout << *vit << std::endl;
      vertices_found = true;
    }
  }

  if (!vertices_found)
  {
    std::cerr << "ERROR: No vertices found!" << std::endl;
    exit(EXIT_FAILURE);
  }
}

int main()
{
  typedef viennagrid::triangular_2d_mesh        MeshTri;
  typedef viennagrid::tetrahedral_3d_mesh       MeshTet;
  typedef viennagrid::quadrilateral_2d_mesh     MeshQuad;
  typedef viennagrid::hexahedral_3d_mesh        MeshHex;

  std::cout << "*****************" << std::endl;
  std::cout << "* Test started! *" << std::endl;
  std::cout << "*****************" << std::endl;

  std::string path = "../examples/data/";

  std::cout << "*********** triangular, 2d ***********" << std::endl;
  viennagrid::io::vtk_reader<MeshTri>  vtk_reader_tri;
  test<MeshTri>(vtk_reader_tri, path + "multi_segment_tri_main.pvd");

  std::cout << "*********** tetrahedral, 3d ***********" << std::endl;
  viennagrid::io::vtk_reader<MeshTet>  vtk_reader_tet;
  test<MeshTet>(vtk_reader_tet, path + "multi_segment_tet_main.pvd");

  std::cout << "*********** quadrilateral, 2d ***********" << std::endl;
  viennagrid::io::vtk_reader<MeshQuad>  vtk_reader_quad;
  test<MeshQuad>(vtk_reader_quad, path + "multi_segment_quad_main.pvd");

  std::cout << "*********** hexahedral, 3d ***********" << std::endl;
  viennagrid::io::vtk_reader<MeshHex>  vtk_reader_hex;
  test<MeshHex>(vtk_reader_hex, path + "multi_segment_hex_main.pvd");

  std::cout << "*******************************" << std::endl;
  std::cout << "* Test finished successfully! *" << std::endl;
  std::cout << "*******************************" << std::endl;

  return EXIT_SUCCESS;
}


text:
<?xml version="1.0"?>
<!-- ----------------------------------------------------------------------------
Copyright 2020-2022 Bo Zimmerman

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
--------------------------------------------------------------------------------

See guides/RandomAreas.html for information about documents of this type.

template: auto_collect5
vars:
    template(quest_template)
    category(whatevs)
    targetskill(ANY or a skill ID)
    targetresource(Any or name of a raw resource)
    targetmaterial(Any or name of a raw material)
    num_targets(num money to collect)
	xp_amount_awarded
	quest_point_awarded(YES,NO)
	reward_items()
	target_min_arealevel(#), target_max_arealevel(#)
	quest_multiple(YES, NO, or PREV)
-->

<QUEST ID="auto_collect5" QUEST_TEMPLATE_ID="auto_collect5">
	<QUEST_ID DEFINE="quest_id">${h:quest_template}_R$[100000000?999999999]</QUEST_ID>
	<QUEST_CRITERIA  SELECT="Pick-1">
		<QUEST_CRITERIA CONDITION="$target_min_arealevel = ''">+SYSOP +LEVELS -<$[$target_level - $level_span] ->$[$target_level + $level_span]</QUEST_CRITERIA>
		<QUEST_CRITERIA CONDITION="$target_min_arealevel != ''">+LEVEL -<$target_min_arealevel ->$target_max_arealevel </QUEST_CRITERIA>
	</QUEST_CRITERIA>
	<FREQUENCY>1</FREQUENCY>
	<DURATION>90 minutes</DURATION>
	<CATEGORY>$quest_category</CATEGORY>
	<NUM_COLLECTABLES>$num_targets</NUM_COLLECTABLES>
	<QUEST_POINT>$quest_point_awarded</QUEST_POINT>
	<EXP>$xp_amount_awarded</EXP>
	<MULTIPLE>$quest_multiple</MULTIPLE>
	<NEXT_QUEST>$next_quest_id</NEXT_QUEST>
	<FACTION>$target_faction</FACTION>
	<NUMFACTION>$[$target_faction_amt / -500]</NUMFACTION>
	<QUEST_NAME SELECT="Any-1">
		<QUEST_NAME>You need $num_targets ${target_item_name} $reason_verbed</QUEST_NAME>
		<QUEST_NAME>You want $num_targets ${target_item_name} $reason_verbed</QUEST_NAME>
		<QUEST_NAME>You must $reason_verb $num_targets ${target_item_name}</QUEST_NAME>
		<QUEST_NAME>${C:reason_verb} $num_targets ${target_item_name}</QUEST_NAME>
	</QUEST_NAME>
	<QUEST_INSTRUCTIONSSTRING>${j:1:quest_instructionstring}</QUEST_INSTRUCTIONSSTRING>
	<QUEST_WINSPEECH_TEXT>${j:1:quest_winspeech}</QUEST_WINSPEECH_TEXT>
	<WRONG_COLLECTABLE_SAY>This is not what I asked for.</WRONG_COLLECTABLE_SAY>
	<REWARD_ITEMS>${SELECT: ANY\. FROM $dungeon_treasure_items}</REWARD_ITEMS>

	<STRING load="/resources/quests/random/inc_questcommon.xml" />

	<STRING ID="num_targets" SELECT="any-1" DEFINE="num_targets" MERGE=override>
		<STRING>$[1 + ($target_level*20)]</STRING>
	</STRING>

	<STRING ID="reason_verbed" define="reason_verbed">$verb_donated</STRING>
	<STRING ID="reason_verb" define="reason_verb">$verb_donate</STRING>
	<STRING ID="reason_desc" PREDEFINE="reason=$reason">$reason_desc</STRING>
	<STRING ID="reason" DEFINE="reason" SELECT="Any-1">
		<STRING>$reason_ilostthem</STRING>
		<STRING>$reason_welosteachother</STRING>
		<STRING>$reason_gencollect</STRING>
		<STRING>$reason_idoforthem</STRING>
		<STRING>$reason_wedotoeachother</STRING>
	</STRING>

	<STRING ID="reason_short" define="reason_short" SELECT="Any-1">
		<STRING>You need $num_targets ${target_item_name} $reason_verbed!</STRING>
		<STRING>You must get $reason_verb $num_targets ${target_item_name}!</STRING>
		<STRING>Assistance required with some $num_targets ${target_item_name}!</STRING>
		<STRING>${c:reason_verb} $num_targets ${target_item_name} to me!</STRING>
		<STRING>${c:reason_verb} $num_targets ${target_item_name}, quickly!</STRING>
		<STRING>You want $num_targets ${target_item_name} $reason_verbed! </STRING>
	</STRING>

	<STRING ID="quest_instructionstring" SELECT="ALL">
		<STRING ACTION="PREPEND">$reason_desc</STRING>
		<STRING ACTION="APPEND">$reason_short</STRING>
	</STRING>

	<STRING ID="quest_winspeech" PREDEFINE="reason=$reason">$quest_winspeech</STRING>

	<STRING id="quest_generic_winner_speeches" SELECT="Any-1">
		<STRING>${c:reason_verbed! That's all you need!</STRING>
		<STRING>${c:reason_verbed} at last!</STRING>
		<STRING>Congratulations for having $reason_verbed.</STRING>
		<STRING>Congratulations adventurer, you have ${reason_verbed}, and that will be all.</STRING>
	</STRING>

	<STRING id="quest_generic_fight_speeches" SELECT="Any-1">
		<STRING>${c:target_item_name} is mine!</STRING>
		<STRING>You are not getting my $target_item_name!</STRING>
		<STRING>I would rather $hurt_verb you than give $target_item_name to you.</STRING>
	</STRING>

	<STRING ID="reason_partytime" SELECT="All">
		<STRING define="quest_winspeech" SELECT="Any-1" >
			<STRING>Yay! Let the party BEGIN!</STRING>"
			<STRING>TIME TO CELEBRATE!</STRING>"
			<STRING>Let the celebration begin!</STRING>"
			<STRING>We can finally begin the festivities!</STRING>"
		</STRING>
		<STRING define="reason_desc" SELECT="Any-1">
			<STRING>You're throwing a party and you need lots of ${target_item_name}.</STRING>
			<STRING>Today you are celebrating, and ${target_item_name} are your favorite gifts.</STRING>
			<STRING>It's your $noun_anyrelation`s birthday, and you need several ${target_item_name} for your gift.</STRING>
			<STRING>It is officially Celebration Day, and the ceremony requires several ${target_item_name}.</STRING>
		</STRING>
	</STRING>

	<STRING ID="reason_ilostthem" SELECT="All">
		<STRING define="quest_winspeech" SELECT="Any-1">
			<STRING>You did it!</STRING>
			<STRING>You're so relieved!</STRING>
			<STRING>Congratulations for finding it!</STRING>
		</STRING>
		<STRING define="reason_desc" SELECT="Any-1">
			<STRING>You lost all your ${target_item_name} and need more.</STRING>
			<STRING>Your $noun_anyrelation has lost their ${target_item_name}.</STRING>
			<STRING>You seem to have misplaced all your ${target_item_name}.</STRING>
			<STRING>You can't find your $noun_anyrelation`s ${target_item_name}.</STRING>
		</STRING>
	</STRING>

	<STRING ID="reason_welosteachother" SELECT="All">
		<STRING define="quest_winspeech" SELECT="Any-1">
			<STRING>You $verb_donated them!</STRING>
			<STRING>You are thanked for your assistance.</STRING>
			<STRING>Congratulations for getting these!</STRING>
		</STRING>
		<STRING define="reason_desc" SELECT="Any-1">
			<STRING>${C:target_item_name} for supplies is important to your experiments..</STRING>
			<STRING>${C:target_item_name} for supplies is important to your $noun_anyrelation`s experiments.</STRING>
			<STRING>You need ${target_item_name} for your $noun_anyrelation`s project.</STRING>
			<STRING>You need ${target_item_name} for your important project.</STRING>
			<STRING>${C:target_item_name} for supplies is key to your work.</STRING>
		</STRING>
	</STRING>

	<STRING ID="reason_gencollect" SELECT="All">
		<STRING define="quest_winspeech">$quest_generic_winner_speeches</STRING>
		<STRING define="reason_desc" SELECT="Any-1">
			<STRING>You need  ${target_item_name} $verb_donated.</STRING>
			<STRING>You need ${target_item_name} $verb_donated to you.</STRING>
			<STRING>You arecollecting ${target_item_name}.</STRING>
			<STRING>Your $noun_anyrelation is collecting ${target_item_name}, and we need your assistance.</STRING>
		</STRING>
	</STRING>

	<STRING ID="reason_idoforthem" SELECT="All">
		<STRING define="quest_winspeech">$quest_generic_winner_speeches</STRING>
		<STRING define="reason_desc" SELECT="Any-1">
			<STRING>You lack the ${target_item_name} that your $noun_anyrelation requires.</STRING>
			<STRING>You wish to give ${target_item_name} to your $noun_anyrelation.</STRING>
			<STRING>Your $noun_anyrelation requires ${target_item_name}.</STRING>
		</STRING>
	</STRING>

	<STRING ID="reason_wedotoeachother" SELECT="All">
		<STRING define="quest_winspeech">$quest_generic_winner_speeches</STRING>
		<STRING define="reason_desc" SELECT="Any-1">
			<STRING >You need ${target_item_name} for supplies for your magical experiments.</STRING>
			<STRING>${c:reason_verb} ${target_item_name} to yourself.</STRING>
			<STRING>Gather yourself ${target_item_name}.</STRING>
		</STRING>
	</STRING>

	<STRING ID="quest_point_awarded" DEFINE="quest_point_awarded" SELECT="Pick-1">
		<STRING PICKWEIGHT=2>NO</STRING>
		<STRING PICKWEIGHT=1>YES</STRING>
	</STRING>

	<STRING ID="xp_amount_awarded" DEFINE="xp_amount_awarded" SELECT="any-1">
		<STRING>$[100 + ($target_level * 3)]</STRING>
	</STRING>

	<STRING ID="target_faction" SELECT="any-1" DEFINE="target_faction">
		<STRING></STRING>
	</STRING>

	<STRING ID="target_faction_amt" SELECT="first" DEFINE="target_faction_amt">
		<STRING>0</STRING>
	</STRING>

	<STRING ID="target_item_name" define="target_item_name">${SELECT: DENOMINATION_NAME from $target_area}</STRING>

	<STRING ID="target_level" DEFINE="target_level" SELECT="any-1">
		<STRING CONDITION="$target_min_arealevel = ''">${SELECT:MED_LEVEL from $target_area}</STRING>
		<STRING CONDITION="$target_min_arealevel != ''">$[${target_min_arealevel} + (1?(${target_max_arealevel}-${target_min_arealevel}))</STRING>
	</STRING>

	<OBJECT ID="target_area" SELECT="Pick-1" DEFINE="target_area">
		<OBJECT pickweight=55555 condition="$targetarea_name != ''">SELECT: ANY\. FROM areas where NAME=$targetarea_name</OBJECT>
		<OBJECT pickweight=1 condition="$targetarea_name = '' and $target_min_arealevel = ''">SELECT: ANY\. FROM areas</OBJECT>
		<OBJECT pickweight=1 condition="$targetarea_name = '' and $target_min_arealevel != ''">
			SELECT: ANY\. FROM areas WHERE MED_LEVEL >= $target_min_arealevel and MED_LEVEL <= $target_max_arealevel
		</OBJECT>
	</OBJECT>

	<STRING ID="target_level" DEFINE="target_level" SELECT="any-1">
		<STRING CONDITION="$target_min_arealevel = ''">$[1?50]</STRING>
		<STRING CONDITION="$target_min_arealevel != ''">$[${target_min_arealevel} + (1?(${target_max_arealevel}-${target_min_arealevel}))</STRING>
	</STRING>

	<STRING ID="level_range" SELECT="any-1" DEFINE="level_range" MERGE=true>
		<STRING>$[$target_level + 6]</STRING>
	</STRING>
</QUEST>


text:
layout: base
---

Violoncelando com a Maria e a Margarida por Lydia Pinho

Este manual pretende que os seus utilizadores desenvolvam hábitos e métodos de estudo, desenvolvendo nos pupilos um profundo gosto pela música.


text:
;(function(window) {
'use strict';

angular.module('gebo-client-token')
  .controller('CallbackCtrl', function ($scope, $location) {

    /**
     * Parses an escaped url query string into key-value pairs.
     *
     * (Copied from Angular.js in the AngularJS project.)
     *
     * @param string
     *
     * @returns Object.<(string|boolean)>
     */
    function parseKeyValue(queryString) {
      var obj = {}, key_value, key;
      angular.forEach((queryString || '').split('&'), function(queryString){
        if (queryString) {
          key_value = queryString.split('=');
          key = decodeURIComponent(key_value[0]);
          obj[key] = angular.isDefined(key_value[1]) ? decodeURIComponent(key_value[1]) : true;
        }
      });
      return obj;
    }

    var queryString = $location.path().substring(1);  // preceding slash omitted
    var params = parseKeyValue(queryString);

    // TODO: The target origin should be set to an explicit origin.  Otherwise,
    //       a malicious site that can receive the token if it manages to change
    //       the location of the parent. (See:
    //       https://developer.mozilla.org/en/docs/DOM/window.postMessage#Security_concerns)

    window.opener.postMessage(params, '*');
    window.close();
  });
}(window));


text:
package com.elfangor1989.FreeLiveView.service;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;

import com.elfangor1989.FreeLiveView.messages.DecodeException;
import com.elfangor1989.FreeLiveView.messages.LiveViewEvent;
import com.elfangor1989.FreeLiveView.messages.MessageDecoder;

/**
 * This reader reads an input stream and extracts LiveViewMessages from it.
 *
 * @author Robert <xperimental@solidproject.de>
 */
public class EventReader {

    private final InputStream stream;

    /**
     * Construct a MessageReader using the {@link InputStream} provided.
     *
     * @param inputStream
     *            Stream to read messages from.
     */
    public EventReader(InputStream inputStream) {
        super();
        this.stream = inputStream;
    }

    /**
     * Closes the underlying input stream.
     */
    public void close() throws IOException {
        stream.close();
    }

    /**
     * Try to read a single {@link LiveViewEvent} from the stream. If there is
     * more than one event available on the stream then subsequent calls to this
     * method will return them.
     *
     * @return Event read from the stream.
     * @throws IOException
     *             If there is an error reading from the underlying stream.
     * @throws DecodeException
     *             If an invalid message was read.
     */
    public LiveViewEvent readMessage() throws IOException, DecodeException {
        ByteArrayOutputStream msgStream = new ByteArrayOutputStream();
        int needRead = 1;
        ReaderState state = ReaderState.ID;
        do {

            byte read = -1;
            read = (byte) stream.read();

            //Log.w("DEBUG", "Read: "+read);

            if (read == -1) {
                throw new DecodeException("Invalid message received (length="
                        + msgStream.size() + ")");
            }
            needRead--;
            msgStream.write(read);
            if (needRead == 0) {
                switch (state) {
                case ID:
                    state = ReaderState.HEADER_LEN;
                    needRead = 1;
                    break;
                case HEADER_LEN:
                    state = ReaderState.HEADER;
                    needRead = read;
                    break;
                case HEADER:
                    int payloadSize = getLastInt(msgStream);
                    state = ReaderState.PAYLOAD;
                    needRead = payloadSize;
                    break;
                default:
                	//Log.e("OpenLiveView", "Something went wrong in EventReader. ("+state+")");
                	//Hmm, weird error message... Commented it out. (Renze)
                	break;
                }
            }
        } while (needRead > 0);
        byte[] msgArray = msgStream.toByteArray();
        return MessageDecoder.decode(msgArray, msgArray.length);

    }

    /**
     * Get last integer written to stream.
     *
     * @param stream
     *            Stream to read from.
     * @return Last integer written to stream.
     */
    private int getLastInt(ByteArrayOutputStream stream) {
        byte[] array = stream.toByteArray();
        ByteBuffer buffer = ByteBuffer.wrap(array, array.length - 4, 4);
        buffer.order(ByteOrder.BIG_ENDIAN);
        return buffer.getInt();
    }

    /**
     * Enumeration containing the possible internal status of the reader.
     */
    private enum ReaderState {
        ID, HEADER_LEN, HEADER, PAYLOAD
    }

}


text:
#ifndef I2P_NETDB_H
#define I2P_NETDB_H
#include <i2p/datatypes/ident_hash.h>
#include <i2p/datatypes/router_info.h>
#include <i2p/memory.h>
#include <stdlib.h>
#include <stdbool.h>
#ifdef __cplusplus
extern "C" {
#endif

  struct i2p_netdb;

  bool i2p_netdb_new(struct i2p_netdb **, struct i2p_allocator *);
  bool i2p_netdb_free(struct i2p_netdb **);

  void i2p_netdb_set_root(struct i2p_netdb *, const char * rootdir);
  bool i2p_netdb_init_skiplist(struct i2p_netdb *);

  /** @brief iteratator type for visiting all of the netdb */
  struct i2p_netdb_iterator
  {
    void * user;
    struct i2p_netdb * netdb;
    bool (*filter)(struct i2p_netdb_iterator *, struct i2p_router_info *);
    void (*visit)(struct i2p_netdb_iterator *, struct i2p_router_info *);
  };

  bool i2p_netdb_iterate_local(struct i2p_netdb *, struct i2p_netdb_iterator *);

  struct i2p_router_info * i2p_netdb_load_local(struct i2p_netdb *, i2p_ident_hash target);
  bool i2p_netdb_store_local(struct i2p_netdb *, struct i2p_router_info *);

#ifdef __cplusplus
}
#endif
#endif


text:
UVIO API refrence
=================

.. module:: uvio

The Event Loop
------------------

.. autoclass:: Loop
   :members: run, next_tick, set_timeout, alive, stop, close, walk, create, exceptions

The Stream Object
------------------

The stream object! This is the most used object in libuv

.. autoclass:: Stream
   :members:
   :inherited-members:

Coroutines
----------

.. autofunction:: sleep

.. autofunction:: get_current_loop

.. autofunction:: uvio.worker

.. module:: uvio.process

Subprocess Module
-----------------

.. autoclass:: Popen
   :members:

.. module:: uvio.net

Network Module
--------------

.. autofunction:: listen

.. autofunction:: connect

.. autofunction:: getaddrinfo

FS Module
--------------

.. module:: uvio.fs

.. autofunction:: open

.. autoclass:: AsyncFile
   :members:

.. module:: uvio.pipes

Pipes Module
--------------

.. autofunction:: listen

.. autofunction:: connect


text:
Docker Stack by Kaliop Canada Inc.
==================================

Usage
-----
```bash
An utility to Dockerize your applications and generate minimal docker
requires files.

Usage:
  docker-stack [options] [COMMAND] [ARGS...]
  docker-stack -h|--help

Commands:
  build              Build a new or existing project
  help               Get help on a command
  ps                 List all created projects
  rm                 Remove one or more projects
  start              Build and start a new project
  stop               Stop docker container(s) for the current project
  version            Display version number

Run 'docker-stack COMMAND --help' for more information on a command.
```

Dependencies
------------
* Python 2.7.x
* GitPython `pip install gitpython`
* Jinja2 `pip install Jinja2`
* docopt `pip install docopt`
* PyYAML `pip install pyyaml`

Maintainer
----------
* DSanchez <david38sanchez@gmail.com>


text:
import ShareYourSystem as SYS

#Definition a Installer instance
MyInstaller=SYS.InstallerClass(
	).install(
		_AllBool=True
	)

#Definition the AttestedStr
print('MyInstaller is ')
SYS._print(MyInstaller)


text:
<!DOCTYPE html>

    <meta charset="UTF-8">
    <title>Calculate_Stuff</title>

        <select name="mydropdown" id="myPlanet">
            <option value="Jupitor">Jupitor</option>
            <option value="Moon">Moon</option>
            <option value="Earth">Earth</option>
        </select>

    Weight:
        <input type="text" id="myWeight" placeholder="Your Weight..." style="margin:20px; width: 100px;">
    <button style="margin:20px; background-color: transparent; text-align: center; width: 100px; height: 25px" onclick="weight()">Weigh Me!</button>


text:
module.exports = name => {
  console.log('salut ' + name);
};


text:
package moe.minori.currencyinfo;

import android.content.Context;
import android.content.SharedPreferences;
import android.os.AsyncTask;
import android.preference.PreferenceManager;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;
import java.util.concurrent.ExecutionException;

/**
 * Created by minori on 15. 8. 19.
 */
public class CurrencyModule {

    static Context context = null;

    public static Double getCurrency (String input)
    {
        SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);

        final StringBuilder urlBuilder = new StringBuilder();

        urlBuilder.append("http://www.webservicex.net/CurrencyConvertor.asmx/ConversionRate?FromCurrency=");
        urlBuilder.append(input);
        urlBuilder.append("&ToCurrency=");
        urlBuilder.append(preferences.getString("mainCurrency", String.valueOf(R.string.mainCurrencyValue)));

        AsyncTask<Void, Void, Double> task = new AsyncTask<Void, Void, Double>() {
            @Override
            protected Double doInBackground(Void... params) {

                URLConnection tempURLConnection = null;
                try {
                    tempURLConnection = new URL(urlBuilder.toString()).openConnection();
                    tempURLConnection.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)");

                    BufferedReader in = new BufferedReader(new InputStreamReader(tempURLConnection.getInputStream()));

                    String tempLine;

                    StringBuilder responseBuilder = new StringBuilder();

                    while ( (tempLine = in.readLine()) != null )
                    {
                        responseBuilder.append(tempLine);
                    }

                    String response = responseBuilder.toString();

                    response = response.replace("<?xml version=\"1.0\" encoding=\"utf-8\"?><double xmlns=\"http://www.webserviceX.NET/\">", "");
                    response = response.replace("</double>", "");

                    return Double.parseDouble(response);

                } catch (IOException e) {
                    e.printStackTrace();
                }

                return (double) -1;
            }
        };

        try {
            return task.execute().get();
        } catch (InterruptedException | ExecutionException e) {
            e.printStackTrace();
            return (double) -1;
        }
    }

    public static void register(Context applicationContext) {
        context = applicationContext;
    }

    public static void unRegister() {
        context = null;
    }
}


text:
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Tags on Wengang Zhang's Homepage</title>
    <link>https://wengangzh.github.io/tags/</link>
    <description>Recent content in Tags on Wengang Zhang's Homepage</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <lastBuildDate>Thu, 09 Mar 2017 19:18:01 -0400</lastBuildDate>

	<atom:link href="https://wengangzh.github.io/tags/index.xml" rel="self" type="application/rss+xml" />

    <item>
      <title>Glass Transition</title>
      <link>https://wengangzh.github.io/tags/glass-transition/</link>
      <pubDate>Thu, 09 Mar 2017 19:18:01 -0400</pubDate>

      <guid>https://wengangzh.github.io/tags/glass-transition/</guid>
      <description></description>
    </item>

    <item>
      <title>Polymer</title>
      <link>https://wengangzh.github.io/tags/polymer/</link>
      <pubDate>Thu, 09 Mar 2017 19:18:01 -0400</pubDate>

      <guid>https://wengangzh.github.io/tags/polymer/</guid>
      <description></description>
    </item>

    <item>
      <title>Research</title>
      <link>https://wengangzh.github.io/tags/research/</link>
      <pubDate>Thu, 09 Mar 2017 19:18:01 -0400</pubDate>

      <guid>https://wengangzh.github.io/tags/research/</guid>
      <description></description>
    </item>

  </channel>
</rss>


text:
import org.infinispan.manager.DefaultCacheManager

object EmbeddedXmlFileStoreCache {
  def main(args: Array[String]): Unit = {
    val manager = new DefaultCacheManager("infinispan.xml")

    val cache = manager.getCache[String, String]("xmlFileStoreCache")

    val range = 1 to 10
    range foreach { v =>
      val key = "key" + v
      println(s"$key => ${cache.get(key)}")
    }

    Thread.sleep(3000L)

    range foreach { v =>
      val key = "key" + v
      cache.put(key, new java.util.Date().toString)
    }

    range foreach { v =>
      val key = "key" + v
      println(s"$key => ${cache.get(key)}")
    }
  }
}


text:
use ed25519_dalek::{PublicKey, Verifier as _};

use crate::{Error, ParseError, VerificationError};

/// A digital signature verifier.
pub trait Verifier {
    /// Use a public key to verify a signature against the JSON object that was signed.
    ///
    /// # Parameters
    ///
    /// * public_key: The raw bytes of the public key of the key pair used to sign the message.
    /// * signature: The raw bytes of the signature to verify.
    /// * message: The raw bytes of the message that was signed.
    ///
    /// # Errors
    ///
    /// Returns an error if verification fails.
    fn verify_json(&self, public_key: &[u8], signature: &[u8], message: &[u8])
        -> Result<(), Error>;
}

/// A verifier for Ed25519 digital signatures.
#[derive(Debug, Default)]
pub struct Ed25519Verifier;

impl Verifier for Ed25519Verifier {
    fn verify_json(
        &self,
        public_key: &[u8],
        signature: &[u8],
        message: &[u8],
    ) -> Result<(), Error> {
        PublicKey::from_bytes(public_key)
            .map_err(ParseError::PublicKey)?
            .verify(message, &signature.try_into().map_err(ParseError::Signature)?)
            .map_err(VerificationError::Signature)
            .map_err(Error::from)
    }
}

/// A value returned when an event is successfully verified.
///
/// Event verification involves verifying both signatures and a content hash. It is possible for
/// the signatures on an event to be valid, but for the hash to be different than the one
/// calculated during verification. This is not necessarily an error condition, as it may indicate
/// that the event has been redacted. In this case, receiving homeservers should store a redacted
/// version of the event.
#[derive(Clone, Debug, Hash, PartialEq, Eq)]
#[allow(clippy::exhaustive_enums)]
pub enum Verified {
    /// All signatures are valid and the content hashes match.
    All,

    /// All signatures are valid but the content hashes don't match.
    ///
    /// This may indicate a redacted event.
    Signatures,
}


text:
require_relative '../lib/rss_searcher.rb'
require 'rspec'

RSpec.describe "Searcher" do
  context "Different Match Levels" do
    it "should give back links for 'one or more' match level" do
      keywords = ["the", "asdfasdfasdfasdfnn;jiuiwe"]
      feed_filname = "../feeds/rss_feeds.txt"
      match_level = "ONE_OR_MORE"
      last_three_days = Date.today - 3
      searcher = RSS_Searcher.new(feed_filname, keywords,last_three_days)
      expect(searcher.get_links_of_interest(match_level).length > 0)
    end

    it "should give no back links for 'all' match level with weird string in keywords" do
      keywords = ["the", "asdfasdfasdfasdfnn;jiuiwe"]
      feed_filname = "../feeds/rss_feeds.txt"
      match_level = "ALL"
      last_three_days = Date.today - 3
      searcher = RSS_Searcher.new(feed_filname, keywords,last_three_days)
      expect(searcher.get_links_of_interest(match_level).length === 0)
    end

    it "should give some back links for '2%' match level" do
      keywords = ["the", "asdfasdfasdfasdfnn;jiuiwe"]
      feed_filname = "../feeds/rss_feeds.txt"
      match_level = 2
      last_three_days = Date.today - 3
      searcher = RSS_Searcher.new(feed_filname, keywords,last_three_days)
      expect(searcher.get_links_of_interest(match_level).length > 0)
    end
  end

  context "Malformed inputs" do
    it "should give back empty array if given bad feed_filname" do
      keywords = ["the", "asdfasdfasdfasdfnn;jiuiwe"]
      feed_filname = "../feeds/non_existent_feeds.txt"
      match_level = "ONE_OR_MORE"
      last_three_days = Date.today - 3
      searcher = RSS_Searcher.new(feed_filname, keywords,last_three_days)
      expect(searcher.get_links_of_interest(match_level).length == 0)
    end

    it "should give back an empty array for malformed match_level" do
      keywords = ["the", "asdfasdfasdfasdfnn;jiuiwe"]
      feed_filname = "../feeds/rss_feeds.txt"
      match_level = "asdfal;asfj;"
      last_three_days = Date.today - 3
      searcher = RSS_Searcher.new(feed_filname, keywords,last_three_days)
      expect(searcher.get_links_of_interest(match_level).length == 0)
    end

    it "should give back an empty array for malformed feed urls" do
      keywords = ["the", "asdfasdfasdfasdfnn;jiuiwe"]
      feed_filname = "../feeds/bad_feeds.txt"
      match_level = "ONE_OR_MORE"
      last_three_days = Date.today - 3
      searcher = RSS_Searcher.new(feed_filname, keywords,last_three_days)
      expect(searcher.get_links_of_interest(match_level).length == 0)
    end

  end
end


text:
package com.aspectran.shell.command.builtins;

import com.aspectran.core.util.PBEncryptionUtils;
import com.aspectran.core.util.StringUtils;
import com.aspectran.shell.command.AbstractCommand;
import com.aspectran.shell.command.CommandRegistry;
import com.aspectran.shell.command.option.Arguments;
import com.aspectran.shell.command.option.Option;
import com.aspectran.shell.command.option.ParsedOptions;
import com.aspectran.shell.console.Console;

import java.util.List;

/**
 * Encrypts the input string using the encryption password.
 */
public class PBEncryptCommand extends AbstractCommand {

    private static final String NAMESPACE = "builtins";

    private static final String COMMAND_NAME = "encrypt";

    private final CommandDescriptor descriptor = new CommandDescriptor();

    public PBEncryptCommand(CommandRegistry registry) {
        super(registry);

        addOption(Option.builder("p")
                .longName("password")
                .valueName("password")
                .withEqualSign()
                .desc("The password to be used for encryption")
                .build());
        addOption(Option.builder("h")
                .longName("help")
                .desc("Display help for this command")
                .build());
        skipParsingAtNonOption();

        Arguments arguments = touchArguments();
        arguments.put("<text>", "The string to encrypt");
        arguments.setRequired(true);
    }

    @Override
    public void execute(ParsedOptions options, Console console) throws Exception {
        if (!options.hasOptions() && !options.hasArgs()) {
            printQuickHelp(console);
            return;
        }
        if (options.hasOption("help")) {
            printHelp(console);
            return;
        }

        String password = options.getValue("password");
        boolean implicitPassword = false;
        if (!StringUtils.hasText(password)) {
            password = PBEncryptionUtils.getPassword();
            implicitPassword = true;
        }

        if (!StringUtils.hasText(password)) {
            console.writeError("A password is required to attempt password-based encryption or decryption.");
            printQuickHelp(console);
            return;
        }

        List<String> inputValues = options.getArgList();
        if (inputValues.isEmpty()) {
            console.writeError("Please enter a string to decrypt.");
            printQuickHelp(console);
            return;
        }

        if (!implicitPassword) {
            console.writeLine("----------------------------------------------------------------------------");
            console.writeLine(" %1$9s : %2$s", "Algorithm", PBEncryptionUtils.getAlgorithm());
            console.writeLine(" %1$9s : %2$s", "Password", password);
            console.writeLine("----------------------------------------------------------------------------");
        } else {
            console.writeLine("----------------------------------------------------------------------------");
        }
        for (String input : inputValues) {
            String output;
            try {
                output = PBEncryptionUtils.encrypt(input, password);
            } catch (Exception e) {
                throw new IllegalArgumentException("Failed to encrypt input string \"" + input + "\"");
            }
            console.writeLine(" %1$9s : %2$s", "Input", input);
            console.writeLine(" %1$9s : %2$s", "Result", output);
            console.writeLine("----------------------------------------------------------------------------");
        }
    }

    @Override
    public Descriptor getDescriptor() {
        return descriptor;
    }

    private static class CommandDescriptor implements Descriptor {

        @Override
        public String getNamespace() {
            return NAMESPACE;
        }

        @Override
        public String getName() {
            return COMMAND_NAME;
        }

        @Override
        public String getDescription() {
            return "Encrypts the input string using the encryption password";
        }

        @Override
        public String getUsage() {
            return null;
        }

    }

}