[–] [S] 2 points 2 years ago

Update: The original dev does not remember exactly. However they have said that clientId was originally a VARCHAR, so this may have been checking for both '0' or ''

So an over-engineered workaround to a bad datatype perhaps?

  • source
  • [–] [S] 0 points 2 years ago (1 child)

    The client table has around 100,000 rows each with a unique clientId, none of which are returned from the CAST / ABS / SIN

    I think you are right and this is a 'fix' for something lost to time. I am going to talk to the original dev tomorrow to see if they remember what it was for

  • source
  • parent
  • context
  • [–] 3 points 2 years ago* (last edited 2 years ago) (1 child)
    1. Soft Skills Engineering - Software engineering advice podcast
    2. If Books Could Kill - Criticising reviews of bestselling books
    3. CoRecursive - Stories about software
  • source
  • Glitched avatar (aussie.zone)
    submitted 3 years ago* (last edited 3 years ago) by to c/pokemongo@lemmy.world
     

    Found an interesting little glitch

    1. Close your game
    2. Turn your phone's GPS off
    3. Start the game and as soon as it loads open routes
    4. Turn GPS back on and after a few seconds close routes

    Gyms and stops don't appear

    Pokemon cannot be clicked on

    submitted 3 years ago by to c/java@lemmy.ml
     

    I am wondering if anyone can help me.

    I have an issue with compiling some code in Eclipse but not with IntelliJ or javac.

    I am using sneakyThrow to bubble a checked exception up through 2 streams.

    Here is the smallest reproducible code I can make:

    import java.io.IOException;
    import java.util.List;
    import java.util.function.Predicate;
    import java.util.stream.Collectors;
    
    public class Example {
    	public static void main(String[] args)
    	throws IOException {
    		List<List<Integer>> input = List.of(List.of(1, 2), List.of(2, 4));
    
    		// Should return any List whose elements are all even.
    		List<List<Integer>> output = input.stream()
    			.filter(bubblePredicate(o -> o.stream()
    				.allMatch(bubblePredicate(i -> {
    					if (i > 10) {
    						throw new IOException("Number too large.");
    					}
    					return i % 2 == 0;
    				}))))
    			.collect(Collectors.toList());
    
    		System.out.println(output);
    	}
    
    	private interface ThrowingPredicate<S, E extends Exception> {
    		boolean test(S s) throws E;
    	}
    
    	private static <S, E extends Exception> Predicate<S> bubblePredicate(ThrowingPredicate<S, E> callable)
    	throws E {
    		return s -> {
    			try {
    				return callable.test(s);
    			}
    			catch (Exception e) {
    				sneakyThrow(e);
    				return false;
    			}
    		};
    	}
    
    	private static <E extends Throwable> void sneakyThrow(Exception exception)
    	throws E {
    		throw (E)exception;
    	}
    }
    

    Compiles and runs completely fine with javac 11.0.12, but doesn't on Eclipse 4.21.0.I20210906-0500 nor Eclipse 4.27.0.20230309-1200.

    Has anyone encountered this before, or have any idea what I am misunderstanding?

    view more: next ›