text:
package edu.wright.cs.test;

import static org.junit.Assert.*;

import java.awt.geom.Rectangle2D;
import java.io.IOException;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;

import org.apache.pdfbox.pdmodel.PDDocument;
import org.apache.pdfbox.pdmodel.PDPage;
import org.apache.pdfbox.pdmodel.encryption.InvalidPasswordException;
import org.junit.Test;

import edu.wright.cs.PublisherYear;

public class PublisherYearTest {

	@Test
	public void testIsMonthNear() {

		String[] wordTest = { "JANUARY", "April", "2016", "4321a" };

		// Check for index 0.
		assertFalse(PublisherYear.isMonthNear(wordTest, 0));

		// Check for April : Should return true
		assertTrue(PublisherYear.isMonthNear(wordTest, 1));

		// Check for 2016 : Should return true
		assertTrue(PublisherYear.isMonthNear(wordTest, 2));

		// Check for 4321 : Should return false
		assertFalse(PublisherYear.isMonthNear(wordTest, 3));

	}

	@Test
	public void testInitialize() {
		// fail("Not yet implemented");
	}

	@Test
	public void testIsPublish() {

		String[] wordsTest = { "Published", "June", "2016", "IEEE", "asdas", "dasdsa", "publish", "1986", "asds",
				"asdsa", "dasdas", " adsas", "published", "on", "June", "2016" };
		String[] wordsTest2 = { "Hello", "Hi", "How", "are", "you" };

		// Search term at 1st line
		assertTrue(PublisherYear.isPublish(wordsTest, 2));

		// Search term at random position in middle
		assertTrue(PublisherYear.isPublish(wordsTest, 7));

		// for i == arraylength-1
		assertTrue(PublisherYear.isPublish(wordsTest, 13));

		// for a token which doesn't have search terms near it.
		assertFalse(PublisherYear.isPublish(wordsTest2, 4));

	}

	@Test
	public void testIsNumeric() {

		String[] testWords = { "123", "123adg", "2021", "2016" };

		// Check for valid numbers that are => 1500 && <= currentYear
		assertFalse(PublisherYear.isNumeric(testWords[0]));

		// Check for token if it is strictly numeric
		assertFalse(PublisherYear.isNumeric(testWords[1]));

		// Check if numeric and not greater than current year.
		assertFalse(PublisherYear.isNumeric(testWords[2]));

		// Check for valid year
		assertTrue(PublisherYear.isNumeric(testWords[3]));
	}

	@Test
	public void testGetFiles() {
		// Redundant function in merged project.
	}

	@SuppressWarnings("deprecation")
	@Test
	public void testGetText() {
		String path1 = "/target/test-classes/JUnitTestPDF/TestPDF1.pdf";
		String path2 = "/target/test-classes/JUnitTestPDF/TestPDFempty.pdf";
		PDDocument doc1, doc2;
		try {

			// updated
			String runningDir = System.getProperty("user.dir");
			path1 = runningDir + path1;
			path2 = runningDir + path2;

			// Check for PDF's with content
			doc1 = PDDocument.load(Paths.get(path1).toFile());
			String testText1 = PublisherYear.getText(doc1);
			String[] testTextArray1 = testText1.split("\\s+");
			String[] expectedTestArray1 = { "Test", "for", "content" };
			// System.out.println(testText1 +" length ="+ testText1.length());
			assertEquals(testTextArray1, expectedTestArray1);

			// Check for PDF's without any content
			doc2 = PDDocument.load(Paths.get(path2).toFile());
			String testText2 = PublisherYear.getText(doc2);
			String[] testTextArray2 = testText2.split("\\s+");
			String[] expectedTestArray2 = {};
			// System.out.println(testText2+"length="+testText2.length());
			assertEquals(testTextArray2, expectedTestArray2);

		} catch (InvalidPasswordException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

	}

	@Test
	public void testGetYears() {
		PublisherYear testObject = new PublisherYear();

		testObject.setFullText("This was Published on July 2015");
		assertEquals("July 2015", testObject.getYears());

		testObject.setFullText("Accepted July 2015 and Published on Aug 2015");
		assertEquals("Aug 2015", testObject.getYears());

		testObject.setFullText("2016 IEEE");
		assertEquals("2016", testObject.getYears());

		testObject.setFullText("2017 Kluver");
		assertEquals("2017", testObject.getYears());

		testObject.setFullText("Published on July 2222");
		assertEquals("N/A", testObject.getYears());

		testObject.setFullText("This does not have a publish year");
		assertEquals("N/A", testObject.getYears());

	}

	@Test
	public void testGetHeaderFooter() {

		String path1 = "/target/test-classes/JUnitTestPDF/headerfooterTest.pdf";
		// updated
		String runningDir = System.getProperty("user.dir");
		path1 = runningDir + path1;

		List<String> headerText = new ArrayList<String>();
		List<String> footerText = new ArrayList<String>();
		PublisherYear testObject = new PublisherYear();

		testObject.initialize(Paths.get(path1));
		PDPage page = testObject.getDoc().getDocumentCatalog().getPages().get(0);
		float width = page.getMediaBox().getWidth();
		float height = page.getMediaBox().getHeight();
		Rectangle2D headerRectangle = new Rectangle2D.Double(0, 0, width, height / 4);
		Rectangle2D footerRectangle = new Rectangle2D.Double(0, height - height / 4, width, height / 4);

		headerText = testObject.getHeaderFooter(testObject.getDoc(), "header", headerRectangle);
		footerText = testObject.getHeaderFooter(testObject.getDoc(), "footer", footerRectangle);

		assertTrue(headerText.contains("HeaderContent"));
		assertFalse(headerText.contains("Blahblah"));

		assertTrue(footerText.contains("FooterContent"));
		assertFalse(footerText.contains("Blahblah"));

	}

	@Test
	public void testGetPublisher() {

		String path1 = "/target/test-classes/JUnitTestPDF/publisherTest1ACMheader.pdf";
		String path2 = "/target/test-classes/JUnitTestPDF/publisherTest2Kluverheader.pdf";
		String path3 = "/target/test-classes/JUnitTestPDF/publisherTest3NA.pdf";
		String path4 = "/target/test-classes/JUnitTestPDF/publisherTest4IEEEfooter.pdf";

		// updated
		String runningDir = System.getProperty("user.dir");
		path1 = runningDir + path1;
		path2 = runningDir + path2;
		path3 = runningDir + path3;
		path4 = runningDir + path4;

		PublisherYear testObject = new PublisherYear();

		testObject.initialize(Paths.get(path1));
		assertEquals(testObject.getPublisher(), "ACM");

		testObject.initialize(Paths.get(path2));
		assertEquals(testObject.getPublisher(), "Kluver");

		testObject.initialize(Paths.get(path3));
		assertEquals(testObject.getPublisher(), "N/A");

		testObject.initialize(Paths.get(path4));
		assertEquals(testObject.getPublisher(), "IEEE");

	}

}


text:
class Stuff(object):
    def __cmp__(self, rhs):
        print "stuff cmp"
        return 0

class Things(object):
    def __cmp__(self, rhs):
        print "things cmp"
        return 0

class Other(object): pass

Stuff() < Things()
Stuff() <= Things()
Stuff() > Things()
Stuff() >= Things()
Stuff() == Things()
Stuff() != Things()

Things() < Stuff()
Things() <= Stuff()
Things() > Stuff()
Things() >= Stuff()
Things() == Stuff()
Things() != Stuff()

Stuff() < Other()
Stuff() <= Other()
Stuff() > Other()
Stuff() >= Other()
Stuff() == Other()
Stuff() != Other()

Other() < Stuff()
Other() <= Stuff()
Other() > Stuff()
Other() >= Stuff()
Other() == Stuff()
Other() != Stuff()

redpajama_set_name: RedPajamaGithub


text:
package com.java110.core.factory;

import com.java110.dto.smsConfig.SmsConfigDto;
import com.java110.utils.cache.MappingCache;
import com.java110.vo.ResultVo;
import org.apache.commons.lang3.StringUtils;

import java.util.Random;

/**
 * @ClassName SendSmsFactory
 * @Description 验证码短信发送接口
 * @Author wuxw
 * @Date 2020/2/10 10:14
 * @Version 1.0
 * add by wuxw 2020/2/10
 **/
public class SendSmsFactory {

    private static final String SMS_DOMAIN = "SMS_DOMAIN";
    private static final String SMS_COMPANY = "SMS_COMPANY";
    private static final String SMS_COMPANY_ALI = "ALI";
    private static final String SMS_COMPANY_TENCENT = "TENCENT";
    public static final String VALIDATE_CODE = "_validateTel";

    /**
     * 短信开关
     */
    public static final String SMS_SEND_SWITCH = "SMS_SEND_SWITCH";

    public static void sendSms(String tel, String code) {

        String smsCompany = MappingCache.getValue(SMS_DOMAIN, SMS_COMPANY);

        if (!StringUtils.isEmpty(smsCompany) && SMS_COMPANY_ALI.equals(smsCompany.trim())) {
            AliSendMessageFactory.sendMessage(tel, code);
        } else {
            TencentSendMessageFactory.sendMessage(tel, code);
        }
    }

    public static ResultVo sendOweFeeSms(String tel, SmsConfigDto smsConfigDto, Object param){

        ResultVo resultVo = null;
        if (SMS_COMPANY_ALI.equals(smsConfigDto.getSmsType().trim())) {
            resultVo = AliSendMessageFactory.sendOweFeeSms(tel, param,smsConfigDto);
        } else {
            resultVo = TencentSendMessageFactory.sendOweFeeSms(tel, param,smsConfigDto);
        }

        return resultVo;
    }

    /**
     * 生成验证码
     *
     * @param limit 位数
     * @return
     */
    public static String generateMessageCode(int limit) {
        Random random = new Random();
        String result = "";
        for (int i = 0; i < limit; i++) {
            result += (random.nextInt(9) + 1);
        }
        return result;
    }
}


text:
This package lets you build .pwn (and .inc) scripts from within Atom, commonly used for SA-MP gamemodes and filterscripts.

![image.png](https://pics.ducky.rocks/images/2019/11/16/image.png)
- Press F5 in a gamemode/filterscript to get started.
- Report issues, ask questions or create feature requests here: https://github.com/dennorske/atom-pawn-build/issues
- Compatible with default pawn compiler, as well as the custom one: https://github.com/pawn-lang/compiler

https://www.sa-mp.com

https://open.mp


text:
package tests;

import leap.webunit.WebTestBase;
import org.junit.Test;

public class AppStartedTest extends WebTestBase {

    @Test
    public void testAllAppStarted() {
        get("/").assert404();
        get("/app1").assertOk();
        get("/app2").assertOk();
    }

}


text:
Prebid.js S2S Example

Div-1


text:
// Copyright 2015 theaigames.com (developers@theaigames.com)

//    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.
//
//    For the full copyright and license information, please view the LICENSE
//    file that was distributed with this source code.

package com.theaigames.game.texasHoldem.table.hand;

import java.util.ArrayList;

import com.theaigames.game.texasHoldem.Player;

public class HandResultInfo
{
	private ArrayList<Player> bots;
	private String[] botCodeNames;
	private int[] potParts;
	private Hand[] hands;

	public HandResultInfo(ArrayList<Player> botList, String[] botNames, int[] potDistribution)
	{
		bots = botList;
		botCodeNames = botNames;
		potParts = potDistribution;
		hands = new Hand[bots.size()];
	}

	/**
	 * Sets the hand of a bot that is involved in the showdown.
	 * @param botName : the name of the bot
	 * @param hand : the hand of the bot
	 */
	public void setBotHand(int seat, Hand hand)
	{
		if(seat >= bots.size() || seat < 0)
			System.err.println("The given bot is not part of this match!");
		else
			hands[seat] = hand;
	}

	/**
	 * Returns a String representation of the match result information.
	 */
	public String toString()
	{
		String str = "";
		for(int i = 0; i < bots.size(); i++)
			if(hands[i] != null)
				str += String.format("%s hand %s\n", botCodeNames[i], hands[i].toString());
		for(int i = 0; i < bots.size(); i++)
			if(potParts[i] > 0)
				str += String.format("%s wins %d\n", botCodeNames[i], potParts[i]);

		str = str.trim();
		return str;
	}
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project name="DMS" default="package" basedir=".">

	<property name="distributionDir"  value="${project.basedir}/_distribution" override="true" />

	<target name="docs">
		<exec command="phpdoc -t ${project.basedir}/docs -d ${project.basedir}/src  --title DMS " />
	</target>

    <target name="package" description="prepares for packaging">
        <phingcall target="docs" />
    </target>

    <!-- Filter Package -->
    <target name="release_filter" description="Releases a new version">
        <propertyprompt propertyName="version" defaultValue="invalid-version"
                        promptText="Which version do you wish to tag? (do not include a 'v')" />

        <phingcall target="split_filter" />

        <phingcall target="tag_release">
            <property name="tagVersion" value="${version}"/>
            <property name="repoDir" value="Filter" override="true"/>
        </phingcall>

        <phingcall target="tag_release">
            <property name="tagVersion" value="${version}"/>
            <property name="repoDir" value="Bundle/FilterBundle" override="true"/>
        </phingcall>
    </target>

	<target name="split_filter" description="Does a Sub-Tree split for Filter (Lib + Package)">
        <phingcall target="split_repository">
            <property name="splitTargetDir" value="Filter"/>
            <property name="splitFilterDir" value="src/DMS/Filter"/>
            <property name="splitTargetRepo" value="git@github.com:rdohms/DMS-Filter.git"/>
        </phingcall>

        <phingcall target="split_repository">
            <property name="splitTargetDir" value="Bundle/FilterBundle" />
            <property name="splitFilterDir" value="src/DMS/Bundle/FilterBundle" />
            <property name="splitTargetRepo" value="git@github.com:rdohms/DMSFilterBundle.git" />
        </phingcall>
	</target>

    <!-- Twig Extensions -->
    <target name="release_twigext" description="Releases a new version">
        <propertyprompt propertyName="version" defaultValue="invalid-version"
                        promptText="Which version do you wish to tag? (do not include a 'v')" />

        <phingcall target="split_twigext" />

        <phingcall target="tag_release">
            <property name="tagVersion" value="${version}"/>
            <property name="repoDir" value="Bundle/TwigExtensionBundle" override="true"/>
        </phingcall>
    </target>

    <target name="split_twigext" description="Does a Sub-Tree split for Twig Extensions Bundle (Lib + Package)">
        <phingcall target="split_repository">
            <property name="splitTargetDir" value="Bundle/TwigExtensionBundle" />
            <property name="splitFilterDir" value="src/DMS/Bundle/TwigExtensionBundle" />
            <property name="splitTargetRepo" value="git@github.com:rdohms/DMSTwigExtensionBundle.git" />
        </phingcall>
    </target>

    <!-- Meetup Bundle -->
    <target name="release_meetup" description="Releases a new version">
        <propertyprompt propertyName="version" defaultValue="invalid-version"
                        promptText="Which version do you wish to tag? (do not include a 'v')" />

        <phingcall target="split_meetup" />

        <phingcall target="tag_release">
            <property name="tagVersion" value="${version}"/>
            <property name="repoDir" value="Bundle/MeetupApiBundle" override="true"/>
        </phingcall>
    </target>

    <target name="split_meetup" description="Does a Sub-Tree split for Meetup Bundle">
        <phingcall target="split_repository">
            <property name="splitTargetDir" value="Bundle/MeetupApiBundle" />
            <property name="splitFilterDir" value="src/DMS/Bundle/MeetupApiBundle" />
            <property name="splitTargetRepo" value="git@github.com:rdohms/DMSMeetupApiBundle.git" />
        </phingcall>
    </target>

    <!-- Laucher Bundle -->
    <!-- TODO -->

    <!-- Generic Tasks -->
    <target name="split_repository" description="Does a sub-tree split of selected repository">
        <property name="targetDir"  value="${distributionDir}/${splitTargetDir}" override="true" />

        <delete dir="${targetDir}" />
        <exec command="git clone git@github.com:rdohms/DMS.git ${targetDir}" />
        <exec command="git filter-branch --prune-empty --subdirectory-filter ${splitFilterDir} master" dir="${targetDir}" />
        <exec command="git remote rm origin" dir="${targetDir}" />
        <exec command="git remote add origin ${splitTargetRepo}" dir="${targetDir}" />
        <exec command="git push origin master --force" dir="${targetDir}" />
    </target>

    <target name="tag_release" description="Creates new release tag in child repository">
        <property name="targetDir"  value="${distributionDir}/${repoDir}" override="true" />

        <exec command="git tag -a v${tagVersion} -m 'Automated tag for release of v${tagVersion}' --force" dir="${targetDir}" />
        <exec command="git push origin v${tagVersion} --force" dir="${targetDir}" />
    </target>
</project>


text:
using aura::client::DragDropDelegate;
using ui::OSExchangeData;

namespace {

const char kXdndActionCopy[] = "XdndActionCopy";
const char kXdndActionMove[] = "XdndActionMove";
const char kXdndActionLink[] = "XdndActionLink";

const char* kAtomsToCache[] = {
  "XdndActionAsk",
  kXdndActionCopy,
  kXdndActionLink,
  "XdndActionList",
  kXdndActionMove,
  "XdndActionPrivate",
  "XdndAware",
  "XdndDrop",
  "XdndEnter",
  "XdndFinished",
  "XdndLeave",
  "XdndPosition",
  "XdndProxy",  // Proxy windows?
  "XdndSelection",
  "XdndStatus",
  "XdndTypeList",
  NULL
};

}  // namespace

namespace views {

class DesktopDragDropClientAuraX11::X11DragContext :
    public base::MessageLoop::Dispatcher {
 public:
  X11DragContext(ui::X11AtomCache* atom_cache,
                 const XClientMessageEvent& event);
  virtual ~X11DragContext();

  const std::vector<Atom>& targets() { return targets_; }

  // Reads the "XdndActionList" property from |source_window| and copies it
  // into |actions|.
  void ReadActions();

  // Creates a ui::DragDropTypes::DragOperation representation of the current
  // action list.
  int GetDragOperation() const;

 private:
  // Overridden from MessageLoop::Dispatcher:
  virtual bool Dispatch(const base::NativeEvent& event) OVERRIDE;

  // The atom cache owned by our parent.
  ui::X11AtomCache* atom_cache_;

  // The XID of the window that's initiated the drag.
  unsigned long source_window_;

  // targets.
  std::vector<Atom> targets_;

  // supplied actions
  std::vector<Atom> actions_;

  DISALLOW_COPY_AND_ASSIGN(X11DragContext);
};

DesktopDragDropClientAuraX11::X11DragContext::X11DragContext(
    ui::X11AtomCache* atom_cache,
    const XClientMessageEvent& event)
    : atom_cache_(atom_cache),
      source_window_(event.data.l[0]) {
  bool get_types = ((event.data.l[1] & 1) != 0);

  if (get_types) {
    if (!ui::GetAtomArrayProperty(source_window_,
                                  "XdndTypeList",
                                  &targets_)) {
      return;
    }
  } else {
    // data.l[2,3,4] contain the first three types. Unused slots can be None.
    for (int i = 0; i < 3; ++i) {
      if (event.data.l[2+i] != None) {
        targets_.push_back(event.data.l[2+i]);
      }
    }
  }

  // TODO(erg): If this window is part of our process, don't listen through the
  // MessagePump, but instead listen to the DesktopDragDropClientAuraX11
  // associated with that window.
  base::MessagePumpAuraX11::Current()->AddDispatcherForWindow(
      this, source_window_);
  XSelectInput(base::MessagePumpAuraX11::GetDefaultXDisplay(),
               source_window_, PropertyChangeMask);

  // We must perform a full sync here because we could be racing
  // |source_window_|.
  XSync(base::MessagePumpAuraX11::GetDefaultXDisplay(), False);

  ReadActions();
}

DesktopDragDropClientAuraX11::X11DragContext::~X11DragContext() {
  // Unsubscribe to message events.
  base::MessagePumpAuraX11::Current()->RemoveDispatcherForWindow(
      source_window_);
}

void DesktopDragDropClientAuraX11::X11DragContext::ReadActions() {
  std::vector<Atom> atom_array;

  // TODO(erg): The GTK+ code has a fast path that short circuits talking over
  // X11 for local windows. When we become a drop source, we should have a
  // similar fast path.

  if (!ui::GetAtomArrayProperty(source_window_,
                                "XdndActionList",
                                &atom_array)) {
    actions_.clear();
  } else {
    actions_.swap(atom_array);
  }
}

int DesktopDragDropClientAuraX11::X11DragContext::GetDragOperation() const {
  int drag_operation = ui::DragDropTypes::DRAG_NONE;
  for (std::vector<Atom>::const_iterator it = actions_.begin();
       it != actions_.end(); ++it) {
    if (*it == atom_cache_->GetAtom(kXdndActionCopy))
      drag_operation |= ui::DragDropTypes::DRAG_COPY;
    else if (*it == atom_cache_->GetAtom(kXdndActionMove))
      drag_operation |= ui::DragDropTypes::DRAG_MOVE;
    else if (*it == atom_cache_->GetAtom(kXdndActionLink))
      drag_operation |= ui::DragDropTypes::DRAG_LINK;
  }

  return drag_operation;
}

bool DesktopDragDropClientAuraX11::X11DragContext::Dispatch(
    const base::NativeEvent& event) {
  if (event->type == PropertyNotify &&
      event->xproperty.atom == atom_cache_->GetAtom("XdndActionList")) {
    ReadActions();
  }
  return true;
}

///////////////////////////////////////////////////////////////////////////////

DesktopDragDropClientAuraX11::DesktopDragDropClientAuraX11(
    views::DesktopRootWindowHostX11* root_window_host,
    aura::RootWindow* root_window,
    Display* xdisplay,
    ::Window xwindow)
    : root_window_host_(root_window_host),
      root_window_(root_window),
      xdisplay_(xdisplay),
      xwindow_(xwindow),
      atom_cache_(xdisplay_, kAtomsToCache),
      target_window_(NULL),
      drag_drop_in_progress_(false),
      drag_operation_(0) {
  // Mark that we are aware of drag and drop concepts.
  unsigned long xdnd_version = 5;
  XChangeProperty(xdisplay_, xwindow_, atom_cache_.GetAtom("XdndAware"),
                  XA_ATOM, 32, PropModeReplace,
                  reinterpret_cast<unsigned char*>(&xdnd_version), 1);
}

DesktopDragDropClientAuraX11::~DesktopDragDropClientAuraX11() {
}

void DesktopDragDropClientAuraX11::OnXdndEnter(
    const XClientMessageEvent& event) {
  DVLOG(1) << "XdndEnter";

  int version = (event.data.l[1] & 0xff000000) >> 24;
  if (version < 3) {
    LOG(ERROR) << "Received old XdndEnter message.";
    return;
  }

  // Make sure that we've run ~X11DragContext() before creating another one.
  current_context_.reset();
  current_context_.reset(new X11DragContext(&atom_cache_, event));

  // In the Windows implementation, we immediately call DesktopDropTargetWin::
  // Translate(). Here, we wait until we receive an XdndPosition message
  // because the enter message doesn't convey any positioning
  // information.
}

void DesktopDragDropClientAuraX11::OnXdndLeave(
    const XClientMessageEvent& event) {
  NotifyDragLeave();
  current_context_.reset();
}

void DesktopDragDropClientAuraX11::OnXdndPosition(
    const XClientMessageEvent& event) {
  DVLOG(1) << "XdndPosition";

  unsigned long source_window = event.data.l[0];
  int x_root_window = event.data.l[2] >> 16;
  int y_root_window = event.data.l[2] & 0xffff;

  if (!current_context_.get()) {
    NOTREACHED();
    return;
  }

  int drag_operation = ui::DragDropTypes::DRAG_NONE;
  scoped_ptr<ui::OSExchangeData> data;
  scoped_ptr<ui::DropTargetEvent> drop_target_event;
  DragDropDelegate* delegate;
  DragTranslate(gfx::Point(x_root_window, y_root_window),
                &data, &drop_target_event, &delegate);
  if (delegate)
    drag_operation = delegate->OnDragUpdated(*drop_target_event);

  // Sends an XdndStatus message back to the source_window. l[2,3]
  // theoretically represent an area in the window where the current action is
  // the same as what we're returning, but I can't find any implementation that
  // actually making use of this. A client can return (0, 0) and/or set the
  // first bit of l[1] to disable the feature, and it appears that gtk neither
  // sets this nor respects it if set.
  XEvent xev;
  xev.xclient.type = ClientMessage;
  xev.xclient.message_type = atom_cache_.GetAtom("XdndStatus");
  xev.xclient.format = 32;
  xev.xclient.window = source_window;
  xev.xclient.data.l[0] = xwindow_;
  xev.xclient.data.l[1] = (drag_operation != 0) ? (2 | 1) : 0;
  xev.xclient.data.l[2] = 0;
  xev.xclient.data.l[3] = 0;
  xev.xclient.data.l[4] = DragOperationToAtom(drag_operation);

  SendXClientEvent(source_window, &xev);
}

void DesktopDragDropClientAuraX11::OnXdndStatus(
    const XClientMessageEvent& event) {
  DVLOG(1) << "XdndStatus";
}

void DesktopDragDropClientAuraX11::OnXdndFinished(
    const XClientMessageEvent& event) {
  DVLOG(1) << "XdndFinished";
}

void DesktopDragDropClientAuraX11::OnXdndDrop(
    const XClientMessageEvent& event) {
  DVLOG(1) << "XdndDrop";

  unsigned long source_window = event.data.l[0];

  int drag_operation = ui::DragDropTypes::DRAG_NONE;
  if (target_window_) {
    aura::client::DragDropDelegate* delegate =
        aura::client::GetDragDropDelegate(target_window_);
    if (delegate) {
      ui::OSExchangeData data(new ui::OSExchangeDataProviderAuraX11(
          root_window_host_, xwindow_, current_context_->targets()));
      ui::DropTargetEvent event(data,
                                target_window_location_,
                                target_window_root_location_,
                                current_context_->GetDragOperation());
      drag_operation = delegate->OnPerformDrop(event);
    }

    target_window_->RemoveObserver(this);
    target_window_ = NULL;
  }

  XEvent xev;
  xev.xclient.type = ClientMessage;
  xev.xclient.message_type = atom_cache_.GetAtom("XdndFinished");
  xev.xclient.format = 32;
  xev.xclient.window = source_window;
  xev.xclient.data.l[0] = xwindow_;
  xev.xclient.data.l[1] = (drag_operation != 0) ? 1 : 0;
  xev.xclient.data.l[2] = DragOperationToAtom(drag_operation);

  SendXClientEvent(source_window, &xev);
}

int DesktopDragDropClientAuraX11::StartDragAndDrop(
    const ui::OSExchangeData& data,
    aura::RootWindow* root_window,
    aura::Window* source_window,
    const gfx::Point& root_location,
    int operation,
    ui::DragDropTypes::DragEventSource source) {
  // Windows has a specific method, DoDragDrop(), which performs the entire
  // drag. We have to emulate this, so we spin off a nested runloop which will
  // track all cursor movement and reroute events to a specific handler.

  NOTIMPLEMENTED();

  // TODO(erg): Once this is implemented, make sure to reenable the
  // NativeTextfieldViewsTest_DragAndDrop* tests.

  return ui::DragDropTypes::DRAG_NONE;
}

void DesktopDragDropClientAuraX11::DragUpdate(aura::Window* target,
                                              const ui::LocatedEvent& event) {
  NOTIMPLEMENTED();
}

void DesktopDragDropClientAuraX11::Drop(aura::Window* target,
                                        const ui::LocatedEvent& event) {
  NOTIMPLEMENTED();
}

void DesktopDragDropClientAuraX11::DragCancel() {
  NOTIMPLEMENTED();
}

bool DesktopDragDropClientAuraX11::IsDragDropInProgress() {
  return drag_drop_in_progress_;
}

void DesktopDragDropClientAuraX11::OnWindowDestroyed(aura::Window* window) {
  DCHECK_EQ(target_window_, window);
  target_window_ = NULL;
}

void DesktopDragDropClientAuraX11::DragTranslate(
    const gfx::Point& root_window_location,
    scoped_ptr<ui::OSExchangeData>* data,
    scoped_ptr<ui::DropTargetEvent>* event,
    aura::client::DragDropDelegate** delegate) {
  gfx::Point root_location = root_window_location;
  root_window_->ConvertPointFromNativeScreen(&root_location);
  aura::Window* target_window =
      root_window_->GetEventHandlerForPoint(root_location);
  bool target_window_changed = false;
  if (target_window != target_window_) {
    if (target_window_)
      NotifyDragLeave();
    target_window_ = target_window;
    if (target_window_)
      target_window_->AddObserver(this);
    target_window_changed = true;
  }
  *delegate = NULL;
  if (!target_window_)
    return;
  *delegate = aura::client::GetDragDropDelegate(target_window_);
  if (!*delegate)
    return;

  data->reset(new OSExchangeData(new ui::OSExchangeDataProviderAuraX11(
      root_window_host_, xwindow_, current_context_->targets())));
  gfx::Point location = root_location;
  aura::Window::ConvertPointToTarget(root_window_, target_window_, &location);

  target_window_location_ = location;
  target_window_root_location_ = root_location;

  event->reset(new ui::DropTargetEvent(
      *(data->get()),
      location,
      root_location,
      current_context_->GetDragOperation()));
  if (target_window_changed)
    (*delegate)->OnDragEntered(*event->get());
}

void DesktopDragDropClientAuraX11::NotifyDragLeave() {
  if (!target_window_)
    return;
  DragDropDelegate* delegate =
      aura::client::GetDragDropDelegate(target_window_);
  if (delegate)
    delegate->OnDragExited();
  target_window_->RemoveObserver(this);
  target_window_ = NULL;
}

unsigned long DesktopDragDropClientAuraX11::DragOperationToAtom(
    int drag_operation) {
  if (drag_operation & ui::DragDropTypes::DRAG_COPY)
    return atom_cache_.GetAtom(kXdndActionCopy);
  if (drag_operation & ui::DragDropTypes::DRAG_MOVE)
    return atom_cache_.GetAtom(kXdndActionMove);
  if (drag_operation & ui::DragDropTypes::DRAG_LINK)
    return atom_cache_.GetAtom(kXdndActionLink);

  return None;
}

void DesktopDragDropClientAuraX11::SendXClientEvent(unsigned long xid,
                                                    XEvent* xev) {
  DCHECK_EQ(ClientMessage, xev->type);

  // TODO(erg): When I get drag receiving working, shortcut messages to the X
  // server and call the receivers DesktopDragDropClientAuraX11 instance
  // instead.
  //
  // I don't understand why the GTK+ code is doing what it's doing here. It
  // goes out of its way to send the XEvent so that it receives a callback on
  // success or failure, and when it fails, it then sends an internal GdkEvent
  // about the failed drag. (And sending this message doesn't appear to go
  // through normal xlib machinery, but instead passes through the low level
  // xProto (the x11 wire format) that I don't understand.
  //
  // I'm unsure if I have to jump through those hoops, or if XSendEvent is
  // sufficient.

  XSendEvent(xdisplay_, xid, False, 0, xev);
}

}  // namespace views


text:
if (typeof define === 'function' && define.amd) {
    define('mobilerider-client', [], function () {
        return {
            Client: Client,
            Resource: Resource,
            Media: MediaResource,
            Channel: ChannelResource,
            Settings: Settings
        };
    });
} else {
    if (!exports.mobilerider) {
        exports.mobilerider = {};
    }
    exports.mobilerider.Client = Client;
    exports.mobilerider.Resource = Resource;
    exports.mobilerider.Media = MediaResource;
    exports.mobilerider.Channel = ChannelResource;
    exports.mobilerider.Settings = Settings;
}

})(this);


text:
package org.apache.accumulo.core.iterators;

import java.io.IOException;
import java.util.Collection;

import org.apache.accumulo.core.data.ByteSequence;
import org.apache.accumulo.core.data.Key;
import org.apache.accumulo.core.data.Range;
import org.apache.accumulo.core.data.Value;

/**
 * An optimized version of {@link org.apache.accumulo.core.iterators.SkippingIterator}. This class grants protected access to the read only source
 * iterator. For performance reasons, the source iterator is declared final and subclasses directly access it, no longer requiring calls to
 * getSource().
 *
 * @since 2.0
 */
public abstract class ServerSkippingIterator extends ServerWrappingIterator {

  public ServerSkippingIterator(SortedKeyValueIterator<Key,Value> source) {
    super(source);
  }

  @Override
  public void next() throws IOException {
    source.next();
    consume();
  }

  protected abstract void consume() throws IOException;

  @Override
  public void seek(Range range, Collection<ByteSequence> columnFamilies, boolean inclusive) throws IOException {
    source.seek(range, columnFamilies, inclusive);
    consume();
  }

}


text:
namespace EmptyKeys.Strategy.AI.Components.ConditionsUnit
{
    /// <summary>
    /// Implements unit condition for behavior.
    /// </summary>
    /// <seealso cref="EmptyKeys.Strategy.AI.Components.BehaviorComponentBase" />
    public class UnitIsAtEmptySpace : BehaviorComponentBase
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="UnitIsAtEmptySpace"/> class.
        /// </summary>
        public UnitIsAtEmptySpace()
            : base()
        {
        }

        /// <summary>
        /// Executes behavior with given context
        /// </summary>
        /// <param name="context">The context.</param>
        /// <returns></returns>
        public override BehaviorReturnCode Behave(IBehaviorContext context)
        {
            UnitBehaviorContext unitContext = context as UnitBehaviorContext;
            if (unitContext == null)
            {
                returnCode = BehaviorReturnCode.Failure;
                return returnCode;
            }

            if (!unitContext.Unit.Environment.EnvironmentMap.ContainsKey(unitContext.Unit.HexMapKey))
            {
                returnCode = BehaviorReturnCode.Success;
                return returnCode;
            }

            returnCode = BehaviorReturnCode.Failure;
            return returnCode;
        }
    }
}


text:
<?php
namespace Companies\Model;

use Companies\Model\Company;
use Companies\Model\Employee;

use Zend\ServiceManager\ServiceLocatorInterface;
use Zend\ServiceManager\ServiceLocatorAwareInterface;

use Zend\Db\Adapter\Driver\ResultInterface;
use Zend\Db\ResultSet\HydratingResultSet;
use Zend\Stdlib\Hydrator\ObjectProperty as Hydrator;

Use Zend\Db\Sql\Sql;

/**
 * Employees collection. This class contains all the functionality needed
 * to work with employee lists.
 */
class Employees implements ServiceLocatorAwareInterface
{
    /**
     * This app only cares about employees as belonging to a certain company,
     * not for example, all of them globally, so Employees instances are tied
     * to one certain Company.
     * @param \Companies\Model\Company $company
     * @return $this
     */
    public function init(Company $company)
    {
        $this->company = $company;
        $this->setServiceLocator($company->getServiceLocator());
        $this->initiated = true;
        return $this;
    }

    /**
     * Is object initiated?
     * @return bool
     */
    public function is_init()
    {
        return $this->initiated;
    }

    /**
     * Fetches employees of the company.
     * @return \Zend\Db\ResultSet\HydratingResultSet of Employee objects
     */
    public function fetch()
    {
        if ( ! $this->is_init() )
            throw new \Exception("Employees collection uninitiated.");

        $adapter = $this->getServiceLocator()->get('Zend\Db\Adapter\Adapter');

        $sql = new Sql($adapter);

        $select = $sql->select('employee')->where(array('cid' => $this->company->id));
        $statement = $sql->prepareStatementForSqlObject($select);
        $res = $statement->execute();

        $hydratedRes = new HydratingResultSet(new Hydrator, new Employee);
        if ($res instanceof ResultInterface && $res->isQueryResult()) {
            $hydratedRes->initialize($res);
        }
        return $hydratedRes;
    }

    /**
     * Adds a new record of the Employee object in the database.
     * @param Employee $employee - a populated object to add.
     */
    public function addNew(Employee $employee)
    {
        if ( ! $this->is_init() )
            throw new \Exception("Employees collection uninitiated.");

        $adapter = $this->getServiceLocator()->get('Zend\Db\Adapter\Adapter');

        $sql = new Sql($adapter);
        $insert = $sql->insert('employee')
            ->columns(array('cid','name', 'lastname', 'email', 'startdate'))
            ->values(array(
                'cid' => $employee->cid,
                'name' => $employee->name,
                'lastname' => $employee->lastname,
                'email' => $employee->email,
                'startdate' => $employee->startdate));

        $sql->prepareStatementForSqlObject($insert)->execute();
    }

    /**
     * Deletes a record.
     * @param $id
     * @throws Exception if no records are deleted
     * @return $this
     */
    public function delete($id)
    {
        $adapter = $this->getServiceLocator()->get('Zend\Db\Adapter\Adapter');
        $sql = new Sql($adapter);
        $delete = $sql->delete('employee')->where(array('id'=>$id));
        $res = $sql->prepareStatementForSqlObject($delete)->execute();
        if ( $res->getAffectedRows() < 1 )
            throw new \Exeption('Employee not deleted: DB affected rows count=0.');
    }

    /**
     * Set service locator
     * @param \Zend\ServiceManager\ServiceLocatorInterface $serviceLocator
     */
    public function setServiceLocator(ServiceLocatorInterface $serviceLocator)
    {
        $this->services = $serviceLocator;
    }

    /**
     * Get service locator
     * @return ServiceLocatorInterface
     */
    public function getServiceLocator()
    {
        return $this->services;
    }

    /**
     * Company.
     * @var Companies\Model\Company
     */
    private $company;

    private $initiated = false;
}


text:
package com.sequenceiq.freeipa.converter.instance;

import static org.assertj.core.api.Assertions.assertThat;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.MethodSource;

import com.sequenceiq.freeipa.api.v1.freeipa.stack.model.common.instance.InstanceLifeCycle;
import com.sequenceiq.freeipa.api.v1.freeipa.stack.model.common.instance.InstanceMetaDataResponse;
import com.sequenceiq.freeipa.api.v1.freeipa.stack.model.common.instance.InstanceMetadataType;
import com.sequenceiq.freeipa.api.v1.freeipa.stack.model.common.instance.InstanceStatus;
import com.sequenceiq.freeipa.entity.InstanceGroup;
import com.sequenceiq.freeipa.entity.InstanceMetaData;

public class InstanceMetaDataToInstanceMetaDataResponseConverterTest {

    private static final String PRIVATE_IP = "10.1.2.3";

    private static final String PUBLIC_IP = "1.2.3.4";

    private static final Integer SSH_PORT = 5678;

    private static final String INSTANCE_ID = "instanceId";

    private static final String DISCOVERY_FQDN = "host.foo.org";

    private static final String INSTANCE_GROUP = "instanceGroup";

    private static final String SUBNET_ID = "subnetId";

    private static final String AVAILABILITY_ZONE = "availabilityZone";

    private static final InstanceStatus INSTANCE_STATUS = InstanceStatus.CREATED;

    private static final InstanceMetadataType INSTANCE_METADATA_TYPE = InstanceMetadataType.GATEWAY;

    private static final InstanceLifeCycle LIFE_CYCLE = InstanceLifeCycle.NORMAL;

    private InstanceMetaDataToInstanceMetaDataResponseConverter underTest;

    @BeforeEach
    void setUp() {
        underTest = new InstanceMetaDataToInstanceMetaDataResponseConverter();
    }

    static Object[][] convertTestDataProvider() {
        return new Object[][]{
                // testCaseName publicIp privateIp publicIpExpected
                {"publicIp=null, privateIp=null", null, null, null},
                {"publicIp=PUBLIC_IP, privateIp=null", PUBLIC_IP, null, PUBLIC_IP},
                {"publicIp=null, privateIp=PRIVATE_IP", null, PRIVATE_IP, "N/A"},
                {"publicIp=PUBLIC_IP, privateIp=PRIVATE_IP", PUBLIC_IP, PRIVATE_IP, PUBLIC_IP},
        };
    }

    @ParameterizedTest(name = "{0}")
    @MethodSource("convertTestDataProvider")
    void convertTest(String testCaseName, String publicIp, String privateIp, String publicIpExpected) {
        InstanceMetaData instanceMetaData = createInstanceMetaData(publicIp, privateIp);

        InstanceMetaDataResponse result = underTest.convert(instanceMetaData);

        assertThat(result).isNotNull();
        assertThat(result.getPrivateIp()).isEqualTo(privateIp);
        assertThat(result.getPublicIp()).isEqualTo(publicIpExpected);
        assertThat(result.getSshPort()).isEqualTo(SSH_PORT);
        assertThat(result.getInstanceId()).isEqualTo(INSTANCE_ID);
        assertThat(result.getDiscoveryFQDN()).isEqualTo(DISCOVERY_FQDN);
        assertThat(result.getInstanceGroup()).isEqualTo(INSTANCE_GROUP);
        assertThat(result.getSubnetId()).isEqualTo(SUBNET_ID);
        assertThat(result.getAvailabilityZone()).isEqualTo(AVAILABILITY_ZONE);
        assertThat(result.getInstanceStatus()).isEqualTo(INSTANCE_STATUS);
        assertThat(result.getInstanceType()).isEqualTo(INSTANCE_METADATA_TYPE);
        assertThat(result.getLifeCycle()).isEqualTo(LIFE_CYCLE);
    }

    private InstanceMetaData createInstanceMetaData(String publicIp, String privateIp) {
        InstanceGroup instanceGroup = new InstanceGroup();
        instanceGroup.setGroupName(INSTANCE_GROUP);

        InstanceMetaData result = new InstanceMetaData();
        result.setPrivateIp(privateIp);
        result.setPublicIp(publicIp);
        result.setSshPort(SSH_PORT);
        result.setInstanceId(INSTANCE_ID);
        result.setDiscoveryFQDN(DISCOVERY_FQDN);
        result.setInstanceGroup(instanceGroup);
        result.setSubnetId(SUBNET_ID);
        result.setAvailabilityZone(AVAILABILITY_ZONE);
        result.setInstanceStatus(INSTANCE_STATUS);
        result.setInstanceMetadataType(INSTANCE_METADATA_TYPE);
        result.setLifeCycle(LIFE_CYCLE);
        return result;
    }

}


text:
. /etc/profile.d/modules.sh
module add ci
module add gcc/${GCC_VERSION}
module add openmpi/${OPENMPI_VERSION}-gcc-${GCC_VERSION}
module add lapack/3.6.0-gcc-${GCC_VERSION}
cd ${WORKSPACE}/SuiteSparse
make install
mkdir -p ${REPO_DIR}
mkdir -p modules
(
cat <<MODULE_FILE
#%Module1.0
## $NAME modulefile
##
proc ModulesHelp { } {
    puts stderr "       This module does nothing but alert the user"
    puts stderr "       that the [module-info name] module is not available"
}

module-whatis   "$NAME $VERSION."
setenv       SUITESPARSE_VERSION       $VERSION
setenv       SUITESPARSE_DIR           /apprepo/$::env(SITE)/$::env(OS)/$::env(ARCH)/$NAME/$VERSION-mpi-${OPENMPI_VERSION}-gcc-${GCC_VERSION}
prepend-path LD_LIBRARY_PATH   $::env(SUITESPARSE_DIR)/lib
prepend-path CFLAGS            $::env(SUITESPARSE_DIR)/include
MODULE_FILE
) > modules/$VERSION-mpi-${OPENMPI_VERSION}-gcc-${GCC_VERSION}

mkdir -p ${LIBRARIES_MODULES}/${NAME}
cp modules/$VERSION-mpi-${OPENMPI_VERSION}-gcc-${GCC_VERSION} ${LIBRARIES_MODULES}/${NAME}/


text:
\subsection*{Short Po\+C for a network simulator project}

The sources include a Ball-\/class, that encapsulates a thread. To this thread, another thread instance with its function is \textquotesingle{}moved\textquotesingle{} and ran.

It allows to have a separate object for the running function and the state it modifies.

\subsubsection*{Documentation}

I\textquotesingle{}ve included two doxygen configuration files that can be invoked by \begin{DoxyVerb}doxygen <doxygen-conf-file>
\end{DoxyVerb}

This will create documentation in html by default of the classes and their related material

\paragraph*{Requirements}

Doxygen -\/ of course -\/ to generate the documentation with it. This is the only requirement, if the non-\/graphs configuration is used.

The directory ./doc might be necessary to create by hand, if doxygen doesn\textquotesingle{}t handle directory creation for you.

Graphviz should be installed to use doxygen with the graph enabled configuration. The graphs are built with graphviz\textquotesingle{}s dot tool.


text:
const $      = require('jquery');
const jQuery = $;
const PIXI   = require('pixi.js');
const p2     = require('p2');
const marked = require('marked');
const video  = require('video.js');
const howler = require('howler');
require('./game');
require('./jquery.fullpage');
require('./sketch');

$(document).ready(function () {
    $("#pong-game-canvas").PongGame();

    $(".markdown").each(function () {
        $(this).html(marked($(this).text()));
    });

    $(".canvas-view").each(function(id) {
        let $elem = $(this);
        let idS = `drawing_${id}`;

        let container = document.createElement("div");
        $(container).addClass("w3-row");

        $.each(['#f00', '#ff0', '#0f0', '#0ff', '#00f', '#f0f', '#000', '#fff'], function() {
            let link = document.createElement("a");
            link.href = `#${idS}`;
            link.setAttribute('data-color', this);
            $(link).addClass("w3-col s1");

            let color = document.createElement("div");
            color.style = `width: 100%; height: 100%; background: ${this}`;
            $(color).addClass("w3-border w3-hover-opacity");
            $(link).append(color);

            $(container).append(link);
        });

        $(container).append("

");
        ['brush', 'eraser'].map(elem => {
            let link = document.createElement("a");
            link.href = `#${idS}`;
            link.setAttribute('data-tool', elem);
            link.style = "width: 45px";
            $(link).addClass("w3-col w3-right");

            $(link).append(`<img class='w3-image w3-opacity w3-hover-opacity-off' src='./img/rendered/${elem}.png'>`);
            $(container).append(link);
        });

        {
            let link = document.createElement("a");
            link.href = `#${idS}`;
            link.setAttribute('data-download', 'pngp');
            link.style = "width: 45px";
            $(link).addClass("w3-col w3-right");
            $(link).append(`<img class='w3-image w3-opacity w3-hover-opacity-off' src='./img/rendered/save.png'>`)
            $(container).append(link);
        }

        $elem.append(container);

        let canvas = document.createElement("canvas");
        $(canvas).addClass("w3-border");
        $(canvas).attr('id', idS);

        $elem.append(canvas);

        $(`#drawing_${id}`).sketch();
    });

    $("#main-container").fullpage({
        verticalCentered: true,
        loopBottom      : false,
        sectionSelector : ".fp-section",
        navigation      : true,
        paddingBottom   : "100px",
        fixedElements   : "#background",
        afterLoad       : onLoad,
        onLeave         : onLeave
    });

    $("#buttonNext").click(() => {
        $.fn.fullpage.moveSectionDown();
    });

    $("#buttonPrev").click(() => {
        $.fn.fullpage.moveSectionUp();
    });

    $("#buttonStart").click(function () {
        $.fn.fullpage.moveTo(1);
    });

    let active = true;
    let sounds = {};

    $("#buttonSound").click(function () {
        active   = $(this).data("active");
        this.src = "img/rendered/" + (active ? "sound.png" : "sound_off.png");
        $(this).data("active", !active);

        howler.Howler.mute(!active);
    });

    ['challenge', 'game', 'text', 'draw'].map(elem => {
        sounds[elem] = new howler.Howl({
            src   : [`audio/${elem}.mp3`],
            loop  : true,
            onfade: function () {
                if (this.volume() === 0) this.pause();
            }
        });
    });

    function onLoad() {
        let type = $(this).data('type');
        if (!active || !type) return;

        console.log("Entering:", type);
        sounds[type].play();
        sounds[type].fade(0, 1, 500);
    }

    function onLeave() {
        let type = $(this).data('type');
        if (!active || !type) return;

        console.log("Leaving:", type);
        sounds[type].fade(1, 0, 500);
    }
});


text:
var mongoose = require('mongoose');
var Schema = mongoose.Schema;

var Message = {
    message: {type: String},
    user: {type: Schema.Types.ObjectId, ref : 'User'},
    date: {type: Date}
};

module.exports = {
    'Message': Message
};


text:
package org.educama.airport.datafeed;

import org.educama.airport.model.Airport;
import org.junit.Test;

import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;

import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.assertTrue;

/**
 * Tests deserialization from CSV into airports objects.
 */
public class AirportCsvDeserializerIntTest {
    private static final String SEPARATOR = ",";
    private static final String EMPTY = "";
    private AirportCsvDeserializer cut = new AirportCsvDeserializer();

    @Test
    public void deserializeCreatesNewAirportsInstancesWhenValidCsvInput() throws IOException {
        //Given
        final String name1 = "Los Angeles International Airport";
        final String city1 = "Los Angeles";
        final String country1 = "USA";
        final String iata1 = "LAX";
        final String icao1 = "KLAX";
        final double latitude1 = 33.94250107;
        final double longitude1 = -118.4079971;

        final String name2 = "Frankfurt am Main International Airport";
        final String city2 = "Frankfurt";
        final String country2 = "Germany";
        final String iata2 = "FRA";
        final String icao2 = "EDDF";
        final double latitude2 = 50.0333333;
        final double longitude2 = 8.5705556;

        Airport firstAirport = new Airport().withName(name1)
                .withCity(city1)
                .withCountry(country1)
                .withIataCode(iata1)
                .withIcaoCode(icao1)
                .withLatitude(latitude1)
                .withLongitude(longitude1);

        Airport secondAirport = new Airport().withName(name2)
                .withCity(city2)
                .withCountry(country2)
                .withIataCode(iata2)
                .withIcaoCode(icao2)
                .withLatitude(latitude2)
                .withLongitude(longitude2);

        List<Airport> airports = new ArrayList<>();
        airports.add(firstAirport);
        airports.add(secondAirport);
        String csvContent = this.createValidCsvContentForAirports(airports);

        InputStream inputStream = new ByteArrayInputStream(
                csvContent.getBytes(StandardCharsets.UTF_8));

        //When
        List<Airport> actualAirports = cut.deserialize(inputStream);

        //Then
        assertThat(actualAirports.size()).isEqualTo(2);
        assertTrue(actualAirports.stream()
                .filter(a -> a.getIataCode()
                        .equals(firstAirport.getIataCode()))
                .findFirst()
                .isPresent());
        assertTrue(actualAirports.stream()
                .filter(a -> a.getIataCode()
                        .equals(secondAirport.getIataCode()))
                .findFirst()
                .isPresent());
    }

    private String createValidCsvContentForAirports(List<Airport> airports) {
        StringBuilder builder = new StringBuilder();
        for (Airport airport : airports) {
            //@formatter:off
            builder.append(EMPTY)                    .append(SEPARATOR)  //ID
                    .append(airport.getName())       .append(SEPARATOR)
                    .append(airport.getCity())       .append(SEPARATOR)
                    .append(airport.getCountry())    .append(SEPARATOR)
                    .append(airport.getIataCode())   .append(SEPARATOR)
                    .append(airport.getIcaoCode())   .append(SEPARATOR)
                    .append(airport.getLatitude())   .append(SEPARATOR)
                    .append(EMPTY)                   .append(SEPARATOR) //Altidude
                    .append(EMPTY)                   .append(SEPARATOR) //Timezone
                    .append(EMPTY)                   .append(SEPARATOR) //DST
                    .append(EMPTY)                   .append(SEPARATOR) //database time
                    .append(EMPTY)                   .append(SEPARATOR) //type
                    .append(EMPTY)                   .append(SEPARATOR) //source
                    .append(airport.getLongitude())  .append("\n");
            //@formatter:on
        }
        return builder.toString();
    }
}


text:
{
  support.r("get", "/project?keywords=example", user.token).then(data => {
    data.success.should.be.ok();
    data.data.should.have.length(1);
    done();
  });
}


text:
#include <linux/skbuff.h>
#include <linux/netdevice.h>
#include <linux/if_vlan.h>
#include <linux/netpoll.h>
#include "vlan.h"

/* VLAN rx hw acceleration helper.  This acts like netif_{rx,receive_skb}(). */
int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp,
		      u16 vlan_tci, int polling)
{
	if (netpoll_rx(skb))
		return NET_RX_DROP;

	if (skb_bond_should_drop(skb))
		goto drop;

	skb->vlan_tci = vlan_tci;
	skb->dev = vlan_group_get_device(grp, vlan_tci & VLAN_VID_MASK);

	if (!skb->dev)
		goto drop;

	return (polling ? netif_receive_skb(skb) : netif_rx(skb));

drop:
	dev_kfree_skb_any(skb);
	return NET_RX_DROP;
}
EXPORT_SYMBOL(__vlan_hwaccel_rx);

int vlan_hwaccel_do_receive(struct sk_buff *skb)
{
	struct net_device *dev = skb->dev;
	struct net_device_stats *stats;

	skb->dev = vlan_dev_info(dev)->real_dev;
	netif_nit_deliver(skb);

	skb->dev = dev;
	skb->priority = vlan_get_ingress_priority(dev, skb->vlan_tci);
	skb->vlan_tci = 0;

	stats = &dev->stats;
	stats->rx_packets++;
	stats->rx_bytes += skb->len;

	switch (skb->pkt_type) {
	case PACKET_BROADCAST:
		break;
	case PACKET_MULTICAST:
		stats->multicast++;
		break;
	case PACKET_OTHERHOST:
		/* Our lower layer thinks this is not local, let's make sure.
		 * This allows the VLAN to have a different MAC than the
		 * underlying device, and still route correctly. */
		if (!compare_ether_addr(eth_hdr(skb)->h_dest,
					dev->dev_addr))
			skb->pkt_type = PACKET_HOST;
		break;
	};
	return 0;
}

struct net_device *vlan_dev_real_dev(const struct net_device *dev)
{
	return vlan_dev_info(dev)->real_dev;
}
EXPORT_SYMBOL(vlan_dev_real_dev);

u16 vlan_dev_vlan_id(const struct net_device *dev)
{
	return vlan_dev_info(dev)->vlan_id;
}
EXPORT_SYMBOL(vlan_dev_vlan_id);

static int vlan_gro_common(struct napi_struct *napi, struct vlan_group *grp,
			   unsigned int vlan_tci, struct sk_buff *skb)
{
	struct sk_buff *p;

	if (skb_bond_should_drop(skb))
		goto drop;

	skb->vlan_tci = vlan_tci;
	skb->dev = vlan_group_get_device(grp, vlan_tci & VLAN_VID_MASK);

	if (!skb->dev)
		goto drop;

	for (p = napi->gro_list; p; p = p->next) {
		NAPI_GRO_CB(p)->same_flow =
			p->dev == skb->dev && !compare_ether_header(
				skb_mac_header(p), skb_gro_mac_header(skb));
		NAPI_GRO_CB(p)->flush = 0;
	}

	return dev_gro_receive(napi, skb);

drop:
	return GRO_DROP;
}

int vlan_gro_receive(struct napi_struct *napi, struct vlan_group *grp,
		     unsigned int vlan_tci, struct sk_buff *skb)
{
	if (netpoll_rx_on(skb))
		return vlan_hwaccel_receive_skb(skb, grp, vlan_tci);

	skb_gro_reset_offset(skb);

	return napi_skb_finish(vlan_gro_common(napi, grp, vlan_tci, skb), skb);
}
EXPORT_SYMBOL(vlan_gro_receive);

int vlan_gro_frags(struct napi_struct *napi, struct vlan_group *grp,
		   unsigned int vlan_tci)
{
	struct sk_buff *skb = napi_frags_skb(napi);

	if (!skb)
		return NET_RX_DROP;

	if (netpoll_rx_on(skb)) {
		skb->protocol = eth_type_trans(skb, skb->dev);
		return vlan_hwaccel_receive_skb(skb, grp, vlan_tci);
	}

	return napi_frags_finish(napi, skb,
				 vlan_gro_common(napi, grp, vlan_tci, skb));
}
EXPORT_SYMBOL(vlan_gro_frags);


text:
Unofficial SDK for GoCardless API

# Installation

```bash
  npm install 90TechSAS/go-cardless
```

# Examples

TODO

# Contributing

## Prerequisites

* You have node installed at v4.0.0+ and npm at v2.0.0+.
* You are familiar with npm.
* You are familiar with git.

## Test

Create configuration file: test/gocardless.json
```json
{
  "token": "<YOUR TOKEN>",
  "version": "2015-07-06"
}
```

Run unit tests :
```bash
  npm test
```

Check code coverage :
```bash
  npm run-script coverage
```

Check standardjs compliance :
```bash
  npm run-script standard
```

# Disclaimer

This software was originally developed by 90Tech SAS. This is not a GoCardless product.

Substantial additions to this project have been made by the contributors cited in package.json who retain copyright in their contributions. For details on the extent of each such contribution, see the git commit history.


text:
namespace {

}  // namespace

void protobuf_AssignDesc_s2s_5fmethod_5fids_2eproto() GOOGLE_ATTRIBUTE_COLD;
void protobuf_AssignDesc_s2s_5fmethod_5fids_2eproto() {
  protobuf_AddDesc_s2s_5fmethod_5fids_2eproto();
  const ::google::protobuf::FileDescriptor* file =
    ::google::protobuf::DescriptorPool::generated_pool()->FindFileByName(
      "s2s_method_ids.proto");
  GOOGLE_CHECK(file != NULL);
}

namespace {

GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_);
void protobuf_AssignDescriptorsOnce() {
  ::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_,
                 &protobuf_AssignDesc_s2s_5fmethod_5fids_2eproto);
}

void protobuf_RegisterTypes(const ::std::string&) GOOGLE_ATTRIBUTE_COLD;
void protobuf_RegisterTypes(const ::std::string&) {
  protobuf_AssignDescriptorsOnce();
}

}  // namespace

void protobuf_ShutdownFile_s2s_5fmethod_5fids_2eproto() {
}

void protobuf_InitDefaults_s2s_5fmethod_5fids_2eproto_impl() {
  GOOGLE_PROTOBUF_VERIFY_VERSION;

}

GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_InitDefaults_s2s_5fmethod_5fids_2eproto_once_);
void protobuf_InitDefaults_s2s_5fmethod_5fids_2eproto() {
  ::google::protobuf::GoogleOnceInit(&protobuf_InitDefaults_s2s_5fmethod_5fids_2eproto_once_,
                 &protobuf_InitDefaults_s2s_5fmethod_5fids_2eproto_impl);
}
void protobuf_AddDesc_s2s_5fmethod_5fids_2eproto_impl() {
  GOOGLE_PROTOBUF_VERIFY_VERSION;

  protobuf_InitDefaults_s2s_5fmethod_5fids_2eproto();
  ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
    "\n\024s2s_method_ids.proto", 22);
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
    "s2s_method_ids.proto", &protobuf_RegisterTypes);
  ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_s2s_5fmethod_5fids_2eproto);
}

GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AddDesc_s2s_5fmethod_5fids_2eproto_once_);
void protobuf_AddDesc_s2s_5fmethod_5fids_2eproto() {
  ::google::protobuf::GoogleOnceInit(&protobuf_AddDesc_s2s_5fmethod_5fids_2eproto_once_,
                 &protobuf_AddDesc_s2s_5fmethod_5fids_2eproto_impl);
}
// Force AddDescriptors() to be called at static initialization time.
struct StaticDescriptorInitializer_s2s_5fmethod_5fids_2eproto {
  StaticDescriptorInitializer_s2s_5fmethod_5fids_2eproto() {
    protobuf_AddDesc_s2s_5fmethod_5fids_2eproto();
  }
} static_descriptor_initializer_s2s_5fmethod_5fids_2eproto_;

// @@protoc_insertion_point(namespace_scope)

// @@protoc_insertion_point(global_scope)


text:
.PHONY: doctest
doctest:
	cd docs && make clean
	cd docs && sphinx-build -W -b html -d _build/doctrees . _build/html


text:
package me.majiajie.pagerbottomtabstrip.internal;

import android.content.Context;
import android.content.res.Resources;
import android.graphics.drawable.Drawable;
import android.util.TypedValue;

import androidx.core.content.ContextCompat;
import androidx.core.graphics.drawable.DrawableCompat;

public class Utils {

    /**
     * Drawable 染色
     *
     * @param drawable 染色对象
     * @param color    颜色
     * @return 染色后的资源
     */
    public static Drawable tinting(Drawable drawable, int color) {
        final Drawable wrappedDrawable = DrawableCompat.wrap(drawable);
        wrappedDrawable.mutate();
        DrawableCompat.setTint(wrappedDrawable, color);
        return wrappedDrawable;
    }

    public static Drawable newDrawable(Drawable drawable) {
        Drawable.ConstantState constantState = drawable.getConstantState();
        return constantState != null ? constantState.newDrawable() : drawable;
    }

    /**
     * 获取colorPrimary的颜色,需要V7包的支持
     *
     * @param context 上下文
     * @return 0xAARRGGBB
     */
    public static int getColorPrimary(Context context) {
        Resources res = context.getResources();
        int attrRes = res.getIdentifier("colorPrimary", "attr", context.getPackageName());
        if (attrRes == 0) {
            return 0xFF009688;
        }
        return ContextCompat.getColor(context, getResourceId(context, attrRes));
    }

    /**
     * 获取自定义属性的资源ID
     *
     * @param context 上下文
     * @param attrRes 自定义属性
     * @return resourceId
     */
    private static int getResourceId(Context context, int attrRes) {
        TypedValue typedValue = new TypedValue();
        context.getTheme().resolveAttribute(attrRes, typedValue, true);
        return typedValue.resourceId;
    }

}


text:
""" Test QiBuild Init """
from __future__ import absolute_import
from __future__ import unicode_literals
from __future__ import print_function

import pytest

import qisys.script

def test_works_from_an_empty_dir(tmpdir, monkeypatch):
    """ Test Work From Empty Dir """
    monkeypatch.chdir(tmpdir)
    qisys.script.run_action("qibuild.actions.init")
    assert tmpdir.join(".qi").check(dir=True)

def test_fails_if_qi_dir(tmpdir, monkeypatch):
    """ Test Fails If .qi in Dir """
    tmpdir.mkdir(".qi")
    monkeypatch.chdir(tmpdir)
    with pytest.raises(Exception) as err:
        qisys.script.run_action("qibuild.actions.init")
    assert ".qi directory" in str(err.value)


text:
import React from 'react';
import style from './style.module.scss';

const Skeleton = (props) => {
    return <div {...props} className={style.skeleton}></div>;
};

export default Skeleton;


text:
"""set default value for feature

Revision ID: 3e607a3a858c
Revises: 330d1836f4a4
Create Date: 2014-11-17 17:31:42.970000

"""

# revision identifiers, used by Alembic.
revision = '3e607a3a858c'
down_revision = '330d1836f4a4'

from alembic import op
import sqlalchemy as sa

def upgrade():
    # default ignored
    op.drop_column('task_entity', 'feature')
    op.add_column('task_entity', sa.Column('feature', sa.String, server_default=''))

def downgrade():
    op.drop_column('task_entity', 'feature')
    op.add_column('task_entity', sa.Column('feature', sa.String))


text:
class Cockroach
	def initialize

	end
end


text:
Create New Article

Please fill the form below

          <?php echo  form_open_multipart('articles', array('class' => 'form', 'role' => 'form', 'id' => 'form-create-article'))?>

             <?php $this->load->section('article_form', 'admin/articles/form', array('article' => $article))?>
             <?php echo $this->load->get_section('article_form')?>

          <?php echo form_close()?>


text:
<?php

/**
 * Visit paragraphs
 *
 * Visit docbook paragraphs and transform them into HTML paragraphs.
 *
 * @package Document
 * @version //autogen//
 */
class ezcDocumentDocbookToRstParagraphHandler extends ezcDocumentDocbookToRstBaseHandler
{
    /**
     * Handle a node
     *
     * Handle / transform a given node, and return the result of the
     * conversion.
     *
     * @param ezcDocumentElementVisitorConverter $converter
     * @param DOMElement $node
     * @param mixed $root
     * @return mixed
     */
    public function handle( ezcDocumentElementVisitorConverter $converter, DOMElement $node, $root )
    {
        // Find all anachors in paragraph, create pre paragraph RST anchors out
        // of them and remove them from the paragraph.
        $anchors = $node->getElementsByTagName( 'anchor' );
        $foundAnchors = false;
        foreach ( $anchors as $anchor )
        {
            $root .= '.. _' . $anchor->getAttribute( 'ID' ) . ":\n";
            $anchor->parentNode->removeChild( $anchor );
            $foundAnchors = true;
        }

        $root .= ( $foundAnchors ? "\n" : '' );

        // Visit paragraph contents
        $contents = $converter->visitChildren( $node, '' );

        // Remove all line breaks inside the paragraph.
        $contents = trim( preg_replace( '(\s+)', ' ', $contents ) );
        $root .= ezcDocumentDocbookToRstConverter::wordWrap( $contents ) . "\n\n";

        $root = $converter->finishParagraph( $root );

        return $root;
    }
}

?>


text:
<!DOCTYPE html>

	<title>

            Samfiru Tumarkin LLP -

    Complete profile - Canadian Company Capabilities - Industries and Business - Industry Canada
  </title>

<meta charset="utf-8" />
<meta name="dcterms.language" title="ISO639-2" content="eng" />
<meta name="dcterms.title" content="" />
<meta name="description" content="" />
<meta name="dcterms.description" content="" />
<meta name="dcterms.type" content="report, data set" />
<meta name="dcterms.subject" content="businesses, industry" />
<meta name="dcterms.subject" content="businesses, industry" />
<meta name="dcterms.issued" title="W3CDTF" content="" />
<meta name="dcterms.modified" title="W3CDTF" content="" />
<meta name="keywords" content="" />

<meta name="dcterms.creator" content="" />
<meta name="author" content="" />
<meta name="dcterms.created" title="W3CDTF" content="" />
<meta name="dcterms.publisher" content="" />
<meta name="dcterms.audience" title="icaudience" content="" />
<meta name="dcterms.spatial" title="ISO3166-1" content="" />
<meta name="dcterms.spatial" title="gcgeonames" content="" />
<meta name="dcterms.format" content="HTML" />
<meta name="dcterms.identifier" title="ICsiteProduct" content="536" />

<meta http-equiv="X-UA-Compatible" content="IE=edge">

<meta content="width=device-width,initial-scale=1" name="viewport">

<meta name = "format-detection" content = "telephone=no">

<meta name="robots" content="noarchive">

<link href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/assets/favicon.ico" rel="icon" type="image/x-icon">
<link rel="stylesheet" href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/css/wet-boew.min.css">

<link rel="stylesheet" href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/css/theme.min.css">

<link rel="stylesheet" href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/css/noscript.min.css" />

<link rel="stylesheet" href="/eic/home.nsf/css/add_WET_4-0_Canada_Apps.css">

  	<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
  	<link href="/app/ccc/srch/css/print.css" media="print" rel="stylesheet" type="text/css" />

<meta property="legalName" content="Department_of_Industry">

Skip to main content

Skip to "About this site"

Language selection

Français

<object type="image/svg+xml" tabindex="-1" data="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/assets/sig-blk-en.svg"></object> Government of Canada

Search and menus

Search and menus

Topics menu

Jobs

Immigration

Travel

Business

Benefits

Health

Taxes

More services

You are here:

Home

Industries and Business

Canadian Company Capabilities

<input id="showMore" type="hidden" value='more'/>
<input id="showLess" type="hidden" value='less'/>

 Company profile - Canadian Company Capabilities

New Search |

<form name="searchForm" method="post" action="/app/ccc/srch/bscSrch.do">

          <input type="hidden" name="lang" value="eng" />
          <input type="hidden" name="profileId" value="" />
          <input type="hidden" name="prtl" value="1" />
          <input type="hidden" name="searchPage" value="%2Fapp%2Fccc%2Fsrch%2FcccBscSrch.do%3Flang%3Deng%26amp%3Bprtl%3D1%26amp%3Btagid%3D"  />

          <input type="hidden" name="V_SEARCH.scopeCategory" value="CCC.Root" />

          <input type="hidden" name="V_SEARCH.depth" value="1" />
          <input type="hidden" name="V_SEARCH.showStricts" value="false" />
          <input id="repeatSearchBtn" class="btn btn-link" type="submit" value="Return to search results" />

  </form>

| Previous Company

| Next Company

      Third-Party Information Liability Disclaimer

Some of the information on this Web page has been provided by external sources. The Government of Canada is not responsible for the accuracy, reliability or currency of the information supplied by external sources. Users wishing to rely upon this information should consult directly with the source of the information. Content provided by external sources is not subject to official languages, privacy and accessibility requirements.

      Samfiru Tumarkin LLP

Legal/Operating Name:

Samfiru Tumarkin LLP

http://www.stlawyers.ca/

Mailing Address:

              	<address class="mrgn-bttm-md">

                   350 Bay St

                    TORONTO,

                    Ontario

                  M5H 2S6

                </address>

Location Address:

              	         <address class="mrgn-bttm-md">

                   350 Bay St

                    TORONTO,

                    Ontario

                  M5H 2S6

                         </address>

Tel.:
		      (416) 861-9065

Tel.:
			      (844) 661-9065

Fax:
		      (416) 361-0993

Company Profile

            If you ever need an employment lawyer, personal injury lawyer or an insurance lawyer, Samfiru Tumarkin LLP is the firm you need to contact. We are located in Toronto and manage satellite offices throughout Ontario. We represent individuals and companies in the fields of labour and employment, personal injury and insurance law. These are our specialties and we are known for being at the top in these fields.

We offer aggressive advocacy and practical cost-effective solutions. We help our clients navigate the legal maze of employment, personal injury and insurance law. We have represented our clients before all levels of courts, including the Ontario Court of Appeal, as well as administrative tribunals in Ontario. We have a proven track record of success and pride ourselves for an unwavering commitment to our clients.

The Samfiru Tumarkin LLP team, led by co-founding partners Lior Samfiru and Sivan Tumarkin, include a unique blend of lawyers, consultants and highly-skilled staff with decades of combined expertise. Their superior customer service approach and dedication to their work translates into cost-effective and successful outcomes for their clients.

You can catch Lior Samfiru weekly on AM640 in Toronto, CHML in Hamilton, and CFRA in Ottawa as the host of the Employment Hour (employmenthour.com). Likewise, Sivan Tumarkin hosts the Insurance and Injury Law show (insuranceandinjurylaw.com) weekly in Toronto on AM640.

While we work out of our Toronto office, we have set up satellite offices across the province to provide us with convenient facilities to meet with our clients close to their place of residence or business.

				Full profile

				Full profile

				Contact information

                Lior
                Samfiru

                  Title:

                Partner/Associate

                  Telephone:

                (416) 216-5900

                    Email:

                  Lior@stlawyers.ca

  top of page

				Company description

            Exporting:

              No

                Primary Industry (NAICS):

				541110 - Offices of Lawyers

            Primary Business Activity:

            Services

				Product / Service / Licensing

                              Service Name:

                            Labour & Employment Law

                            Samfiru Tumarkin LLP specializes in labour and employment law. We act for employees as well as employers.

If you are an employee, we can help you deal with a wrongful dismissal claim, review your employment contract, advise you on severance pay, discrimination and harrassment, employment standards compliance, and much more. We will make sure that you know your legal options and we will recommend to you the best course of action for your specific situation.

If you are an employer, we can help you deal with wrongful dismissal claims, demand letters, preparation of employment contracts, non-competition and non-solicitation contracts, policy and privacy manuals, as well as represent you in unionized environments with collective bargaining, grievance arbitrations, human rights tribunals, and more.

Schedule a consultation with one of our highly experienced labour and employment lawyers, and give us an opportunity to help.

                              Service Name:

                            Personal Injury Law

                            Samfiru Tumarkin LLP also specializes in personal injury law. Our personal injury legal team will advise you of your rights and compensation you may be entitled to for your injury. We help victims of car accidents, slip/trip and falls, bicycle accidents, motorcycle accidents, etc. We work with doctors, specialists and a variety of experts to ensure that your claim is maximized and the compensation you receive is the maximum allowable under the law. We deal with soft tissue injuries, orthpaedic injuries (i.e. broken bones), ligament injuries and tears, brain injuries, spinal injuries, nerve damage, etc.

If you have been injured in an accident, let us help you recover the compensation you deserve. We will work hard to make sure you are compensated fairly and can move on with your life.

                              Service Name:

                            Insurance Law

                            Samfiru Tumarkin LLP also specializes in resolving insurance disputes. This is a very rare field that not many lawyers practice. Our lawyers have expertise in resolving long-term disability claims, life insurance claims, critical insurance claims, as well as house insurance, travel insurance, and other kinds of insurance claims.

Having a background in insurance law and having worked for insurance companies in the past, many of our lawyers know how insurers operate and what it takes to resolve these types of claims to the benefit of our clients in a cost-effective and timely manner.

If you have an insurance claim, let us help you resolve it. Contact us and let us tell you what your rights and options are so you could make an informed decision on how to proceed.

  top of page

					Third-Party Information Liability Disclaimer

					Some of the information on this Web page has been provided by external sources. The Government of Canada is not responsible for the accuracy, reliability or currency of the information supplied by external sources. Users wishing to rely upon this information should consult directly with the source of the information. Content provided by external sources is not subject to official languages, privacy and accessibility requirements.

				Contacts

				Contact information

                Lior
                Samfiru

                  Title:

                Partner/Associate

                  Telephone:

                (416) 216-5900

                    Email:

                  Lior@stlawyers.ca

				Description

				Company description

            Exporting:

              No

                Primary Industry (NAICS):

				541110 - Offices of Lawyers

            Primary Business Activity:

            Services

				Products, services and licensing

				Product / Service / Licensing

                              Service Name:

                            Labour & Employment Law

                            Samfiru Tumarkin LLP specializes in labour and employment law. We act for employees as well as employers.

If you are an employee, we can help you deal with a wrongful dismissal claim, review your employment contract, advise you on severance pay, discrimination and harrassment, employment standards compliance, and much more. We will make sure that you know your legal options and we will recommend to you the best course of action for your specific situation.

If you are an employer, we can help you deal with wrongful dismissal claims, demand letters, preparation of employment contracts, non-competition and non-solicitation contracts, policy and privacy manuals, as well as represent you in unionized environments with collective bargaining, grievance arbitrations, human rights tribunals, and more.

Schedule a consultation with one of our highly experienced labour and employment lawyers, and give us an opportunity to help.

                              Service Name:

                            Personal Injury Law

                            Samfiru Tumarkin LLP also specializes in personal injury law. Our personal injury legal team will advise you of your rights and compensation you may be entitled to for your injury. We help victims of car accidents, slip/trip and falls, bicycle accidents, motorcycle accidents, etc. We work with doctors, specialists and a variety of experts to ensure that your claim is maximized and the compensation you receive is the maximum allowable under the law. We deal with soft tissue injuries, orthpaedic injuries (i.e. broken bones), ligament injuries and tears, brain injuries, spinal injuries, nerve damage, etc.

If you have been injured in an accident, let us help you recover the compensation you deserve. We will work hard to make sure you are compensated fairly and can move on with your life.

                              Service Name:

                            Insurance Law

                            Samfiru Tumarkin LLP also specializes in resolving insurance disputes. This is a very rare field that not many lawyers practice. Our lawyers have expertise in resolving long-term disability claims, life insurance claims, critical insurance claims, as well as house insurance, travel insurance, and other kinds of insurance claims.

Having a background in insurance law and having worked for insurance companies in the past, many of our lawyers know how insurers operate and what it takes to resolve these types of claims to the benefit of our clients in a cost-effective and timely manner.

If you have an insurance claim, let us help you resolve it. Contact us and let us tell you what your rights and options are so you could make an informed decision on how to proceed.

    Last Update Date 2015-04-29

Date Modified:

      <time>2017-03-02</time>

About government

Contact us

Departments and agencies

Public service and military

News

Treaties, laws and regulations

Government-wide reporting

Prime Minister

How government works

Open government

About this site

Social media

Mobile applications

About Canada.ca

Terms and conditions

Privacy

Top of Page

<object type="image/svg+xml" tabindex="-1" role="img" data="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/assets/wmms-blk.svg" aria-label="Symbol of the Government of Canada"></object>


text:
'use strict';

Object.defineProperty(exports, '__esModule', {
	value: true
});
exports.Meta = Meta;

var _fdAngularCore = require('fd-angular-core');

function Meta(object, name, desc) {
	var func = desc.value;

	function pushMeta(Meta) {
		var args = Array.prototype.slice.call(arguments, 1);
		Meta.push(func.apply(this, args));
	}
	pushMeta.$inject = ['Meta'].concat(func && func.$inject || []);
	_fdAngularCore.State.onAttach(object, 'pushMeta', { value: pushMeta });

	function popMeta(Meta) {
		Meta.pop();
	}
	popMeta.$inject = ['Meta'];
	_fdAngularCore.State.onDetach(object, 'popMeta', { value: popMeta });
}
//# sourceMappingURL=Meta.js.map


text:
package io.crnk.client.inheritance.repositories;

import java.util.Collections;
import java.util.List;

import io.crnk.client.inheritance.resources.related.RelatedResourceA;
import io.crnk.client.inheritance.resources.related.RelatedResourceAsub1;
import io.crnk.client.inheritance.resources.related.RelatedResourceB;

/*
 * @author syri.
 */
public class RepositoryData {

	public static final List<RelatedResourceA> RESOURCE_A_LIST;

	public static final List<RelatedResourceB> RESOURCE_B_LIST;

	static {
		RelatedResourceAsub1 relatedResourceAsub1 = new RelatedResourceAsub1();
		relatedResourceAsub1.setId(1L);

		RelatedResourceB relatedResourceB = new RelatedResourceB();
		relatedResourceB.setId(10L);

		relatedResourceAsub1.setRelatedResourceBS(Collections.singletonList(relatedResourceB));
		relatedResourceB.setRelatedResourceAsub1(relatedResourceAsub1);

		RESOURCE_A_LIST = Collections.singletonList(relatedResourceAsub1);
		RESOURCE_B_LIST = Collections.singletonList(relatedResourceB);
	}
}


text:
/* @flow */
import React from 'react';
import PropTypes from 'prop-types';
import {default as Component} from '../Common/plugs/index.js'; //提供style, classname方法
import Cover from './Cover';

export default class IframeUpload extends Component {

  constructor(props) {
    super(props);
    this.state = {
      dragOver: false,
      file: null,
      disabled: false,
      frameName: 'frame-' + Date.now()
    };
  }

  componentDidMount() {
    const { action, onSuccess, onError } = this.props;
    const { file } = this.state;
    window.addEventListener(
      'message',
      event => {
        const { origin } = new URL(action);
        if (event.origin !== origin) return false;
        const response = event.data;
        if (response.result === 'success') {
          onSuccess(response, file);
        } else if (response.result === 'failed') {
          onError(response, file);
        }
      },
      false
    );
  }

  onload() {
    this.setState({ disabled: false });
  }

  onDrop(e) {
    e.preventDefault();
    this.setState({ dragOver: false });
    this.uploadFiles(e.dataTransfer.files); // TODO
  }

  handleChange(e) {
    if (e.target instanceof HTMLInputElement) {
      const file = e.target.files[0];
      if (file) {
        this.uploadFiles(file);
      }
    }
  }

  uploadFiles(file) {
    if (this.state.disabled) return;
    this.setState({ disabled: false, file });
    this.props.onStart && this.props.onStart(file);
    const formNode = this.refs.form;
    const dataSpan = this.refs.data;
    let data = this.props.data;
    if (typeof data === 'function') {
      data = data(file);
    }
    const inputs = Object.keys(data).map(
      key => `<input name="${key}" value="${data[key]}"/>`
    );

    dataSpan.innerHTML = inputs.join('');
    formNode.submit();
    dataSpan.innerHTML = '';
  }

  handleClick() {
    if (!this.state.disabled) {
      this.refs.input.click();
    }
  }

  handleDragover(e) {
    e.preventDefault();
    this.setState({ onDrop: true });
  }

  handleDragleave(e) {
    e.preventDefault();
    this.setState({ onDrop: false });
  }

  render() {
    const { drag, action, name, accept, listType } = this.props;
    const { frameName } = this.state;
    const classes = this.classNames({
      'ishow-upload': true,
      [`ishow-upload--${listType}`]: true
    });
    return (
      <div
        className={classes}
        onClick={() => this.handleClick()}
        onDrop={e => this.onDrop(e)}
        onDragOver={e => this.handleDragover(e)}
        onDragLeave={e => this.handleDragleave(e)}
      >
        <iframe onLoad={() => this.onload()} ref="iframe" name={frameName} title={frameName}/>
        <form
          ref="form"
          action={action}
          target={frameName}
          encType="multipart/form-data"
          method="POST"
        >
          <input
            className="ishow-upload__input"
            type="file"
            ref="input"
            name={name}
            onChange={e => this.handleChange(e)}
            accept={accept}
          />
          <input type="hidden" name="documentDomain" value={document.domain} />
          <span ref="data" />
        </form>
        {drag
          ? <Cover onFile={file => this.uploadFiles(file)}>
              {this.props.children}
            </Cover>
          : this.props.children}
      </div>
    );
  }
}

IframeUpload.propTypes = {
  drag: PropTypes.bool,
  data: PropTypes.object,
  action: PropTypes.string.isRequired,
  name: PropTypes.string,
  accept: PropTypes.string,
  onStart: PropTypes.func,
  onSuccess: PropTypes.func,
  onError: PropTypes.func,
  listType: PropTypes.string
};

IframeUpload.defaultProps = {
  name: 'file'
};