This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.narrowtux.longjourney; | |
import org.bukkit.Chunk; | |
import org.bukkit.Location; | |
import org.bukkit.event.vehicle.VehicleListener; | |
import org.bukkit.event.vehicle.VehicleMoveEvent; | |
import org.bukkit.util.Vector; | |
public class LJVehicleListener extends VehicleListener { | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
p.addPoint(0, 0, new Color(0xffffffff)); | |
p.addPoint(0, 10, new Color(0xffffffff)); | |
p.addPoint(10, 10, new Color(0xffffffff)); | |
p.addPoint(10, 0, new Color(0xffffffff)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contianer c = new GenericContainer(); | |
c.setLayout(new VerticalLayout()); | |
c.setGeometry(5,5,width - 10, height - 10); | |
c.attachWidget(addon, new GenericLabel("Title")); //Same as c.getLayout().addItem(new WidgetItem(widget)); | |
c.getLayout().addItem(new SpacerItem(0, 25, 0, Integer.INFINITY)); //minWidth, minHeight, maxWidth, maxHeight | |
Button b = new GenericButton("Done"); | |
b.setMaxWidth(200); | |
c.attachWidget(addon, b); | |
c.getLayout().setAlign(WidgetAnchor.TOP_CENTER); | |
screen.attachWidget(addon, c); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ComponentHolder { | |
// ... | |
public void onEvent(String methodName) { | |
for (Component c:getComponents()) { | |
if (c.getClass().hasMethod(methodName)) { | |
c.getClass().getMethod(methodName).execute(c); | |
} | |
} | |
} | |
// ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package de.hs.settlers.util; | |
import java.lang.reflect.Field; | |
import javafx.beans.property.Property; | |
import javafx.beans.value.ChangeListener; | |
import javafx.beans.value.ObservableValue; | |
import javafx.collections.ObservableSet; | |
import javafx.collections.SetChangeListener; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Range | |
def range(num, min_value, max_value) do | |
num | |
|> min(max_value) | |
|> max(min_value) | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Coll do | |
@doc """ | |
Removes all values from the subject | |
iex> Coll.remove([1, 2, 3], [2, 3]) | |
[1] | |
iex> Coll.remove([1, 2], [2, 3, 4]) | |
[1] | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def descendants(organization_id, truncation, filter \\ from o in __MODULE__) do | |
sub = from os in filter, where: os.organization_id == ^organization_id and os.truncation == ^truncation, select: [os.organization_id, os.parent_organization_id, os.id, ^1, os.datetime, os.truncation] | |
query = from outer in __MODULE__, | |
join: t in fragment(""" | |
WITH RECURSIVE search_orgs(organization_id, parent_organization_id, id, depth, datetime, truncation) AS ( | |
? | |
UNION ALL | |
SELECT | |
o.organization_id, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def descendants(organization_id, truncation, filter \\ from o in __MODULE__) do | |
sub = from os in filter, where: os.organization_id == ^organization_id and os.truncation == ^truncation, select: [os.organization_id, os.parent_organization_id, os.id, ^1, os.datetime, os.truncation] | |
query = from outer in __MODULE__, | |
join: t in fragment(""" | |
WITH RECURSIVE search_orgs(organization_id, parent_organization_id, id, depth, datetime, truncation) AS ( | |
? | |
UNION ALL | |
SELECT | |
o.organization_id, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def descendants(organization_id, truncation, filter \\ from o in __MODULE__) do | |
sub = from os in filter, where: os.organization_id == ^organization_id and os.truncation == ^truncation, select: [os.organization_id, os.parent_organization_id, os.id, ^1, os.datetime, os.truncation] | |
query = from outer in __MODULE__, | |
join: t in fragment(""" | |
WITH RECURSIVE search_orgs(organization_id, parent_organization_id, id, depth, datetime, truncation) AS ( | |
? | |
UNION ALL | |
SELECT | |
o.organization_id, |
OlderNewer