This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| programming_tips_and_tricks [2017/05/16 19:28] – ledyx | programming_tips_and_tricks [2021/02/07 03:15] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 647: | Line 647: | ||
| === 합병 정렬(Merge Sort) === | === 합병 정렬(Merge Sort) === | ||
| [[algorithm: | [[algorithm: | ||
| - | |||
| - | |||
| - | = Design Pattern = | ||
| - | |||
| - | == Serialization을 이용한 Deep Copy == | ||
| - | <sxh java> | ||
| - | /* Java */ | ||
| - | @SuppressWarnings(" | ||
| - | public static <T> T deepCopy(T obj) { | ||
| - | try { | ||
| - | ByteArrayOutputStream baos = new ByteArrayOutputStream(); | ||
| - | ObjectOutputStream oos = new ObjectOutputStream(baos); | ||
| - | oos.writeObject(obj); | ||
| - | |||
| - | ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray()); | ||
| - | ObjectInputStream ois = new ObjectInputStream(bais); | ||
| - | return (T) ois.readObject(); | ||
| - | } catch (IOException e) { | ||
| - | return null; | ||
| - | } catch (ClassNotFoundException e) { | ||
| - | return null; | ||
| - | } | ||
| - | } | ||
| - | </ | ||
| - | https:// | ||
| - | |||
| - | <sxh csharp> | ||
| - | /* C# */ | ||
| - | public static T DeepCopy< | ||
| - | { | ||
| - | using (var ms = new MemoryStream()) | ||
| - | { | ||
| - | var formatter = new BinaryFormatter(); | ||
| - | formatter.Serialize(ms, | ||
| - | ms.Position = 0; | ||
| - | |||
| - | return (T)formatter.Deserialize(ms); | ||
| - | } | ||
| - | } | ||
| - | </ | ||
| - | https:// | ||
| - | |||
| - | |||
| Line 1034: | Line 991: | ||
| } | } | ||
| } | } | ||
| + | </ | ||
| + | |||
| + | |||
| + | = Intellij - Git Bash 연동 = | ||
| + | |||
| + | Tools -> Terminal | ||
| + | |||
| + | <sxh bash> | ||
| + | " | ||
| </ | </ | ||