This file contains hidden or 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 main | |
| import "regexp" | |
| func main() { | |
| } | |
| func regex(name string) bool { | |
| ok, _ := regexp.MatchString("^[a-zA-Z0-9_]+$", name) |
This file contains hidden or 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
| void ClothPoint::TimeStep(float _dt) | |
| { | |
| if (m_Moveable) | |
| { | |
| D3DXVECTOR3 temp = m_Pos; | |
| m_Pos += DAMPING * (m_Pos - m_PrevPos) + (m_Acceleration * _dt); | |
| m_PrevPos = temp; | |
| m_Acceleration = D3DXVECTOR3(0, 0, 0); | |
| } | |
| } |
This file contains hidden or 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
| std::vector<tinyobj::shape_t> shapes; | |
| std::vector<tinyobj::material_t> materials; | |
| std::string err = tinyobj::LoadObj(shapes, materials, m_Filename.c_str(), "../Res/Models/"); | |
| if (!err.empty()) | |
| { | |
| // fail | |
| } |
This file contains hidden or 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
| void Push2dArrayToLUA(lua_State* _Env, int _array[9][9]) | |
| { | |
| lua_createtable(_Env, 9, 0); | |
| for (int t = 1; t < 10; ++t) | |
| { | |
| // Puts key of the first child table on-top of Lua stack | |
| lua_pushnumber(_Env, t); | |
| // Creates child table |
This file contains hidden or 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 NetServerAnnouncer { | |
| private Connect connect; | |
| public NetServerAnnouncer(Connect connect) { | |
| this.connect = connect; | |
| } | |
| public void sendMessage() { | |
| try { |
This file contains hidden or 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 OnlineGUIItem implements GUIItem, Runnable { | |
| private int playerCount = 0; | |
| public OnlineGUIItem() { | |
| Bukkit.getScheduler().runTaskTimer(Core.getInstance(), this, 80L, 80L); | |
| } | |
| @Override | |
| public void processUpdate(Core plugin, Player player, Objective obj) { |
This file contains hidden or 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 void a(World world, Entity entity, WorldMap worldmap) { | |
| if (world.worldProvider.dimension == worldmap.map && entity instanceof EntityHuman) { | |
| int scale = 1 << worldmap.scale; | |
| int centerX = worldmap.centerX; | |
| int centerZ = worldmap.centerZ; | |
| int relX = MathHelper.floor(entity.locX - (double) centerX) / scale + 64; | |
| int relZ = MathHelper.floor(entity.locZ - (double) centerZ) / scale + 64; | |
| int blocksPP = 128 / scale; // blocks per pixel | |
| if (world.worldProvider.g) { // if nether |
This file contains hidden or 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 static <T> List<T>[] splitList(List<T> list, int nLists) { | |
| @SuppressWarnings("unchecked") | |
| List<T>[] res = (ArrayList<T>[]) new ArrayList[nLists]; | |
| Collections.shuffle(list); | |
| for (int i = 0; i < list.size(); i++) { | |
| res[i % nLists].add(list.get(i)); | |
| } | |
| return res; | |
| } |
This file contains hidden or 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 ScoreboardManager { | |
| /** | |
| * Here be dragons! I have done some testing, need to do more. | |
| * | |
| * No comments for you. This was hard to code so it will be hard to read. | |
| * :P i'll add comments when i get time. | |
| * | |
| */ |