Wilhelm Sorban

1

votes
3

answer
874

views

NoSuchMethodError when trying to send email in Spring Boot

I am attempting to send a simple email message: @Autowired JavaMailSender sender; public void sendEMail() throws Exception { MimeMessage message = sender.createMimeMessage(); MimeMessageHelper helper = new MimeMessageHelper(message); helper.setTo('[email protected]'); helper.setText('How are you?'); hel...
Wilhelm Sorban
1

votes
1

answer
121

views

How to correctly translate BNF to GoldParser?

Say I have this in BNF: a ::= b {c} | d {e} Is there any way to translate to Gold-Parser? Without breaking it up like this: ::= ::= | terminal Side Note: If anybody has a better title/more tags, please edit it, thanks!
Wilhelm Sorban
1

votes
1

answer
907

views

Use a returned value of a function from another file in PHP

I am using a function in a separate file, that gets should return me an array containing the enum values of a field:
Wilhelm Sorban
1

votes
3

answer
264

views

PHP option POST is empty

I have these two input types: The first one: echo '' . ' ' .$enum_array[$i] . ''; if I do: echo $_POST['tipo_campo']; It will display the correct value. But for this: echo ''. $tipo_unidade[1] .''; the echo $_POST['tipo_unid']; Will be empty. I have tested the $tipo_unidade[0] separately, and it h...
Wilhelm Sorban
1

votes
2

answer
677

views

Semaphore values in c

If I understand correctly, from this post: http://www.csc.villanova.edu/~mdamian/threads/posixsem.html Then after each thread passes from sem_wait(&sem1) because of an sem_post(&sem1) from somewhere else, the value of the semaphore should increment. So if I do: sem_wait(&sem1); int sval2; if (sem_ge...
Wilhelm Sorban
1

votes
2

answer
753

views

Array vs Matrix in terms of memory in Java

I am working on a project that involves heuristics, and I built it in Java (Should have probably made it in C). I am running into problems with memory. My tree is built up with object nodes, and each object contains an array, a matrix, and three integers. I already cut down many other values, in ord...
Wilhelm Sorban
0

votes
0

answer
5

views

Unable to serialize HATEOAS support to my domains

I am attempting to publish a RabbitMQ event. The event is a Serializable object, which extends ResourceSupport from HATEOAS. Before publishing the event, I add a few links to my event. When I receive the event, the links are no longer there. Event payload: @Data @Builder @EqualsAndHashCode(callSuper...
Wilhelm Sorban
1

votes
2

answer
1.1k

views

Check if socket listen backlog queue is empty

Is there any way to check if there are no pending connection requests to the server? In my case, I have this code, from C: listen(mysocket, 3); //while(no pending connections) do this int consocket = accept(mysocket, (struct sockaddr *)&dest, &socksize); And what I need, is that while there are no p...
Wilhelm Sorban
1

votes
1

answer
1k

views

Bad file descriptor error in Python (Error 9) on Raspberry

I am working with Python for the first time, and encountered the following issue, while running it on a Raspberry Pi Version B+ rev 2: The code is supposed to set an interrupt on pin 22 (BCM), and when a button is pressed, halt the OS: # Import the modules to send commands to the system and access G...
Wilhelm Sorban
3

votes
1

answer
1.5k

views

Better way to update Spring Boot properties while app is running

So far, I have seen methods to update a Spring boot application, by changing the property file itself, then reloading the file, or by using @RefreshScope annotation, or by Spring Cloud Config. I was not able to find anything straight forward (something like getEnvironment().updateProperty(key, value...
Wilhelm Sorban
2

votes
1

answer
77

views

JavaFX Fade Transition issue

I followed every instruction I could find, tried various ways to implement this, always with the same symptom: Nothing happens... Expectation: Have an image that is fading from 100% transparent to 0% transparent. I have this FadingImage class: public class FadingImage{ private FadeTransition ft; pub...
Wilhelm Sorban
2

votes
1

answer
166

views

Find and replace variable number of items in string using regex

I have several strings that looks like this: sum({foo, c[0663, 0667, 0673, 0677, 0693, 0697, 0703, 0707]}) sum({foo, c[0663, 0667, 0673, 0677, 0693]}) sum({foo, c[0697, 0703, 0707]}) sum({foo, c[0693, 0697, 0703, 0707]}) I can find all of them, using this regex: sum\(\{foo, c\[(?:(\d{4})(, )?)+\]\}\...
Wilhelm Sorban
3

votes
2

answer
2.8k

views

Python “shutdown / reboot raspberry pi” script, using a single button

I got a piece of code in Python from here: http://www.raspberry-pi-geek.com/Archive/2013/01/Adding-an-On-Off-switch-to-your-Raspberry-Pi And I wanted to improve on it. Since this is the first time I work with Python, I got stuck on understanding what actually happens. Here is the code: # Import the...
Wilhelm Sorban
2

votes
1

answer
52

views

Cloning an object and its inside arrays in Java DIY

I am trying to clone an object without using any library. The object has other objects/arrays/matrixes in it. So I developed some methods to clone those as well. They are working fine when I am cloning arrays/matrixes that are not inside the object. These are the methods: public static int[] cloneAr...
Wilhelm Sorban
2

votes
1

answer
375

views

Object required error when looping through cells in selection

I am looping through some cells, in a vertical selection, in Excel, and then passing that cell as a parameter to a procedure. I have done it this way, so I don't have the contents of ProcessCells twice, in the code, once for the while loop, and the second time in the For loop. If I try and get the v...
Wilhelm Sorban