본문 바로가기

카테고리 없음

2020-04-23 06시 개발자 글 모음 | "꼬리 재귀와 Trampoline In" 외 3개 이야기

스프링부트 JSON 응답처리와 예외처리 by 이준현 about Spring

  • @Getter public class ResponseFormat { private Object data; private ErrorResponse errors; @Getter private class ErrorResponse { private String errorName; public ErrorResponse(Exception error) { errorName = error
  • data = data; return this; } public ResponseFormat of(Exception error) { this
  • OK); } @GetMapping("/errorTest") public ResponseEntity error() throws NullPointerException { String[] j = {"1"}; j[1] = "2"; ResponseFormat res = new ResponseFormat()


강의 소식 : 입문자를 위한 자바스크립트 - 입문과 중급사이 8기 모집 by 김인권 about Javascript


    Golang Memory Dump 예제 by 공재웅

    • Since this architecture is little endian // that means the least significant values are lower in memory and come // first in our byte slice
    • first := mem1[:ptrSize] // pointer to data second := mem1[ptrSize : ptrSize*2] // length third := mem1[ptrSize*2:] // capacity // This is a way of interpreting the first bytes as a pointer in Go
    • length := intSlice(second) capacity := intSlice(third) // We can then use that pointer to get raw access to that bit of memory: // Lets dump out the memory up to the length: dataMemLen := rawAccess(dataPtr


    꼬리 재귀와 Trampoline In Scala by 권태국

    • postFunc ) ) ) } } def sum ( n : Int ) : Function = if ( n == 1 ) Return ( 1 ) else Logic ( LazyCall ( ( ) => sum ( n - 1 ) )
    • result => Return ( n + result ) ) def factorial ( n : Int ) : Function = if ( n == 1 ) Return ( 1 ) else Logic ( LazyCall ( ( ) => factorial ( n - 1 ) )
    • map ( _ * n ) ) def fibo ( n : Int ) : TailRec [ Int ] = if ( n < 2 ) done ( n ) else tailcall ( for { firstResult <- factorial ( n - 1 ) secondResult <- factorial ( n - 2 ) } yield firstResult + secondResult ) println ( sum ( 100000 )