Comment by rechandler on Ansible for user management -removing dead accounts
shouldn't it be getent passwd | awk -F: '$3 >= 1000 {print $1}' ?
View ArticleComment by rechandler on Why @Cachable works on not public method in Spring...
That behavior changed in Spring Framework 6.0/Spring Boot 3.0?
View ArticleWhy @Cachable works on not public method in Spring Boot 3.0
I'm using Spring Boot 3.x, and the @Cacheable annotation is working on methods that are not public. This is strange because the documentation clearly states:Method visibility and cache annotationsWhen...
View ArticleConfiguration of OpenId Connect token expiration in CAS
I'm looking for properties to set expiration time of OpenId Connect token. Default is 8 hours, but I want to change it. How can I do that?I'm using CAS 6.5.4
View ArticleAnswer by rechandler for Class is Private and members are Public what its scope?
If your private class implements some interface you can access to public methods via the interface. Here's piece of code:public interface ITest{ void Test(); }public class Program{ public static void...
View ArticleUsing if expression in getter
Is it correct to just use a public property or should I rather make a private field _count? I have read some info on the topic, but I can't find an answer.public int Count{ get { if...
View ArticleSort, copy value from table to another table and calculate new value
I want to create spreadsheet to calculate my current bank balance. I want to write down all history of payment. Here's the exampleSo I need formula to create from table "buy - sell" tale "balance"Is it...
View ArticleAnswer by rechandler for Java generalize approach to validate the null in the...
That wasn't be strict answer to the question but I want to improve your code.You call get twice. Instead of this:if(map.get("attribute1") !=null) { map.get("attribute1").add(price);} else {...
View ArticleAnswer by rechandler for Java Optimization - Local Variable vs Object Property
I would say it depends.In your example it doesn't change anything. Create local variable is as fast as use length property.But it's not very common to use fields from class, instead of this we all use...
View ArticleAnswer by rechandler for C# int.ParseInt() performance issue
If your Parse method throws an exception it can be cause of performance impact.From Exceptions and Performance MSDN:One common concern related to exceptions is that if exceptions are used for code that...
View ArticleAnswer by rechandler for Why Hashtable not allowed null value?
Hashtable is considered legacy code. You should use HashMap and it allow null for values and also one key can be null.EDITAfter deeper search I may have argument for such decision. Hashtable is...
View ArticleAnswer by rechandler for What is the purpose of having hashCode in Optional
From JavaDoc:Returns the hash code value of the present value, if any, or 0 (zero) if no value is present.So you can check if objects inside Optional is equals to each others. It also correspond well...
View ArticleAnswer by rechandler for Can't use lombok @NoArgsConstructor on a class
It's known issue from lombok version 1.16.20. https://github.com/rzwitserloot/lombok/issues/1563You can do this:@Getter@Builder@JsonDeserialize(builder = AccountItem.AccountItemBuilder.class)public...
View ArticleAnswer by rechandler for How to make final variables declared in a try block...
If you use at least Java 7 you can use try-with-resources Statement to close your resources. Here's the code:public StringBuffer readFile(final File inputFile) { String tempLine; // variable...
View ArticleAnswer by rechandler for I want to display a variable value where the...
You can use simple Map to do this:Map<String, Integer> map = new HashMap<>();map.put("priceOneRed", 100);... Integer price = map.get(concatedString);
View ArticleAnswer by rechandler for Multiple threads can move the same file using...
I finally resolved my problem just add synchronized to moveFileToPendingState method.
View ArticleSame RewriteCond and multiple RewriteRule
I've got in my application some review rules here's example:RewriteCond %{HTTP_HOST} ^(.*)-street\.RewriteRule ^(.*)/(.*)\.html$ index.php?street=%1&$1=$2 [L]RewriteCond %{HTTP_HOST}...
View ArticleAnswer by rechandler for How to bind the "publish version" property in visual...
First of all you have to reference in your project to System.Deployment.dll than you can try this code: public string PublishVersion { get { if...
View ArticleCreate mock bean in Spring
First of all, I found solution for my problem, but I don't understand why it's working.I've got Spring Configuration with bean:@Configurationpublic class SomeContext { @Profile("default") @Bean(name =...
View ArticleHow to show setting flyout by using button instead of setting charms
By using Callisto I wrote a code that adds setting charms.Underneath I attach one:// Register handler for CommandsRequested events from the setting...
View Article