Skip to content

Instantly share code, notes, and snippets.

View anuar2k's full-sized avatar

Aleksander Wójtowicz anuar2k

View GitHub Profile
@anuar2k
anuar2k / ex.txt
Created December 23, 2017 14:00
Rail exception
18:50:58.902 [main] ERROR o.t.e.event.internal.EventSystemImpl - Failed to invoke event
java.lang.NullPointerException: null
at org.terasology.world.block.entity.BlockEntitySystem.commonDefaultDropsHandling(BlockEntitySystem.java:134)
at org.terasology.world.block.entity.BlockEntitySystem.defaultDropsHandling(BlockEntitySystem.java:94)
at org.terasology.world.block.entity.BlockEntitySystemMethodAccess.invoke(Unknown Source)
at org.terasology.entitySystem.event.internal.EventSystemImpl$ByteCodeEventHandlerInfo.invoke(EventSystemImpl.java:516)
at org.terasology.entitySystem.event.internal.EventSystemImpl.sendConsumableEvent(EventSystemImpl.java:289)
at org.terasology.entitySystem.event.internal.EventSystemImpl.send(EventSystemImpl.java:268)
at org.terasology.entitySystem.entity.internal.BaseEntityRef.send(BaseEntityRef.java:145)
at org.terasology.world.block.entity.BlockEntitySystem.commonDestroyed(BlockEntitySystem.java:154)
23:02:16.146 [main] INFO o.t.m.blocks.RailsFamilyFactory - D: Rails:rails, S: no_connections, R: NONE
23:02:16.147 [main] INFO o.t.m.blocks.RailsFamilyFactory - D: Rails:rails, S: one_connection, R: CLOCKWISE_180
23:02:16.147 [main] INFO o.t.m.blocks.RailsFamilyFactory - D: Rails:rails, S: one_connection_slope, R: CLOCKWISE_270
23:02:16.147 [main] INFO o.t.m.blocks.RailsFamilyFactory - D: Rails:rails, S: one_connection, R: CLOCKWISE_90
23:02:16.147 [main] INFO o.t.m.blocks.RailsFamilyFactory - D: Rails:rails, S: one_connection_slope, R: CLOCKWISE_180
23:02:16.147 [main] INFO o.t.m.blocks.RailsFamilyFactory - D: Rails:rails, S: 2d_corner, R: NONE
23:02:16.148 [main] INFO o.t.m.blocks.RailsFamilyFactory - D: Rails:rails, S: one_connection, R: NONE
23:02:16.148 [main] INFO o.t.m.blocks.RailsFamilyFactory - D: Rails:rails, S: one_connection_slope, R: CLOCKWISE_90
23:02:16.148 [main] INFO o.t.m.blocks.RailsFamilyFactory - D: Rails:rails, S: line_connection, R: NONE
@ReceiveEvent
public void test(ActivateEvent event, EntityRef entity) {
entity = event.getTarget();
if (entity.hasComponent(PathDescriptorComponent.class)) {
PathDescriptorComponent desc = entity.getComponent(PathDescriptorComponent.class);
for (Prefab p : desc.descriptors) {
logger.info("Prefab name: {}", p.getName());
for (Component c : p.iterateComponents()) {
if (c instanceof PathComponent) {
PathComponent comp = (PathComponent) c;
There is several things that I want to mention as the comparison of old and new block families
1. Usage of the new implementation is much simpler. You do not have to create a factory for them.
2. Marking possible sections in a java annotation is better - previously, you had to override a getSectonNames method to list all sections possible - now, when sections are set in an annotation, it's easier to differentiate what sections are for and what do they mean.
3. Using new block families implementation in my situation reduced the SLOC count by a HALF.

There is several things that I want to mention as the comparison of old and new block families

  1. Usage of the new implementation is much simpler. You do not have to create a factory for them.
  2. Marking possible sections in a java annotation is better - previously, you had to override a getSectonNames method to list all sections possible - now, when sections are set in an annotation, it's easier to differentiate what sections are for and what do they mean.
  3. Using new block families implementation in my situation reduced the SLOC count by a HALF.

There is several things that I want to mention as the comparison of old and new block families

  1. Usage of the new implementation is much simpler. You do not have to create a factory for them.
  2. Marking possible sections as a java annotation is better - previously, you had to override the getSectonNames method to list all sections possible (I was unsure if I hade to do it or now - currently, this method doesn't even exist because its redundant) - now, when sections are set in an annotation, it's easier to differentiate what sections are for and what do they mean.
  3. Support for freeform is also marked with an annotation now. In general, the concept of "basic settings" of the family as annotations is very cool and fun to use.
  4. Using new block families implementation in my situation reduced the SLOC count by a HALF.
  5. You don't need to pass WorldProvider and BlockEntityManager as getBlockForPlacement's argument - the creator of a family can now decide himself if he needs access to these systems
@anuar2k
anuar2k / telemetry_mem.cpp
Created October 4, 2018 13:46
Telemetry
#define WINVER 0x0500
#define _WIN32_WINNT 0x0500
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <stdarg.h>
#include "scssdk_telemetry.h"
#include "eurotrucks2/scssdk_eut2.h"
@anuar2k
anuar2k / exceptionlog.txt
Created October 24, 2018 14:58
The exception log of the issue
W/OpenMRS: #241 DateUtils.isValidFormat() : Failed to validate date format :2018-10-24T14:46:33.000+0000 caused by java.text.ParseException: Unparseable date: "2018-10-24T14:46:33.000+0000"
D/AndroidRuntime: Shutting down VM
E/AndroidRuntime: FATAL EXCEPTION: main
Process: org.openmrs.mobile, PID: 31417
java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.length()' on a null object reference
at java.text.SimpleDateFormat.parseInternal(SimpleDateFormat.java:1425)
at java.text.SimpleDateFormat.parse(SimpleDateFormat.java:1413)
at java.text.DateFormat.parse(DateFormat.java:356)
at org.openmrs.mobile.utilities.DateUtils.isValidFormat(DateUtils.java:236)
@anuar2k
anuar2k / fixedissues.txt
Created October 25, 2018 12:52
Fixed issues
https://sonar.openmrs.org/project/issues?id=org.openmrs%3Aopenmrs&issues=AWOGbDsn-YDD50tEAbxj&open=AWOGbDsn-YDD50tEAbxj
https://sonar.openmrs.org/project/issues?id=org.openmrs%3Aopenmrs&issues=431bc9fa-46ce-4411-a809-c6169b3f8b5c&open=431bc9fa-46ce-4411-a809-c6169b3f8b5c
https://sonar.openmrs.org/project/issues?id=org.openmrs%3Aopenmrs&issues=AWVnm2V0r8aW24Ncaidf&open=AWVnm2V0r8aW24Ncaidf
https://sonar.openmrs.org/project/issues?id=org.openmrs%3Aopenmrs&issues=96b310d4-f44e-4c4b-92d6-c1acf0a6922c&open=96b310d4-f44e-4c4b-92d6-c1acf0a6922c
https://sonar.openmrs.org/project/issues?id=org.openmrs%3Aopenmrs&issues=AWGPuvvBeC2CQ1jcfMUf&open=AWGPuvvBeC2CQ1jcfMUf
https://sonar.openmrs.org/project/issues?id=org.openmrs%3Aopenmrs&issues=AWHiqMWHs_CtjRdw4sjU&open=AWHiqMWHs_CtjRdw4sjU
https://sonar.openmrs.org/project/issues?id=org.openmrs%3Aopenmrs&issues=AWCZsICavsycEPA9_U2g&open=AWCZsICavsycEPA9_U2g
https://sonar.openmrs.org/project/issues?id=org.openmrs%3Aopenmrs&issues=AWHw5R-8s_CtjRdw4wVu&open=AWHw5R-8s_CtjRdw4wVu