Skip to content

Instantly share code, notes, and snippets.

View njofce's full-sized avatar

Nasi njofce

  • Skopje
View GitHub Profile
//create a new empty slide show
XMLSlideShow ppt = new XMLSlideShow();
//add first slide
XSLFSlide slide1 = ppt.createSlide();
byte[] decodedSvg = Base64.getDecoder().decode(svgString);
XSLFPictureData pictureData = ppt.addPicture(new ByteArrayInputStream(decodedSvg), org.apache.poi.sl.usermodel.PictureData.PictureType.SVG);
@njofce
njofce / pom.xml
Last active February 16, 2020 09:42
<dependency>
 <groupId>org.apache.poi</groupId>
 <artifactId>poi</artifactId>
 <version>4.1.2</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>4.1.2</version>
@HystrixCommand(fallbackMethod = “getAssociatedInstitutionFallback”,
threadPoolKey = “threadPoolInstitution”,
commandProperties = {
@HystrixProperty(name = “execution.isolation.thread.timeoutInMilliseconds”, value = ”5000”)
},
threadPoolProperties = {
@HystrixProperty(name = “coreSize”, value = “15”),
@HystrixProperty(name = “maxQueueSize”, value = “5”)
},
commandPoolProperties = {
@HystrixCommand(fallbackMethod = “getAssociatedInstitutionFallback”,
threadPoolKey = “threadPoolInstitution”,
threadPoolProperties = {
@HystrixProperty(name = “coreSize”, value = “15”),
@HystrixProperty(name = “maxQueueSize”, value = “5”)
},
commandPoolProperties = {
@HystrixProperty(name=”circuitBreaker.requestVolumeThreshold”, value = ”5”)
@HystrixProperty(name=”circuitBreaker.errorThresholdPercentage”, value = “50”)
}
@Autowired
private InstitutionManagementClient institutionManagementClient; // This is the Feign client
@HystrixCommand(fallbackMethod = “getAssociatedInstitutionFallback”,
threadPoolKey = “threadPoolInstitution”,
threadPoolProperties = {
@HystrixProperty(name = “coreSize”, value = “15”),
@HystrixProperty(name = “maxQueueSize”, value = “5”)
}
)
class CommandManager {
private static CommandManager instance = null;
private QueueStack<List<Action>> queueStackNormal;
private QueueStack<List<Action>> queueStackReverse;
private List<String> actionHistory;
static CommandManager getInstance(){
if(instance != null)
return instance;
class CommandManager {
private static CommandManager instance = null;
private QueueStack<List<Action>> queueStackNormal;
private QueueStack<List<Action>> queueStackReverse;
private List<String> actionHistory;
static CommandManager getInstance(){
if(instance != null)
return instance;
public class Action1 implements Action {
private String name;
public Action1(String name) {
this.name = name;
}
@Override
public void execute() {
public interface Action {
void execute();
void undo();
String getName();
}
class QueueStack<T> {
private List<T> dataCollection;
QueueStack() {
dataCollection = new LinkedList<>();
}
void push(T item) {
dataCollection.add(0, item);