This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int c; | |
c = 12; | |
if (true) { | |
c = 2; | |
} | |
return c * 2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
return 4; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################################################# | |
# Configuration file for clone detection. | |
# | |
############################################################ | |
# Often, need to change these common parameters: | |
# - FILE_PATTERN : for source files in different languages | |
# - SRC_DIR : the root directory containing the source files | |
# - DECKARD_DIR : Where is the home directory of DECKARD | |
# - clone detection parameters: c.f. DECKARD's paper |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private int getDefaultRowSize() { | |
int rowSize = DebugUITools.getPreferenceStore().getInt(IDebugPreferenceConstants.PREF_ROW_SIZE); | |
int bytePerLine = rowSize * getAddressableSize(); | |
// check synchronized row size | |
Integer size = (Integer)getSynchronizedProperty(AbstractAsyncTableRendering.PROPERTY_ROW_SIZE); | |
if (size != null) | |
{ | |
// row size is stored as actual number of bytes in synchronizer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (data instanceof MemorySegment) { | |
MemorySegment line = (MemorySegment) data; | |
if (col > 0) { | |
int start = (col - 1) * getBytesPerColumn(); | |
int end = start + getBytesPerColumn(); | |
MemoryByte[] bytes = line.getBytes(start, end); | |
String str = getToolTipText((BigInteger)address, bytes); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (address != null) { | |
Object data = item.getData(); | |
if (data instanceof TableRenderingLine) { | |
TableRenderingLine line = (TableRenderingLine) data; | |
if (col > 0) { | |
int start = (col - 1) * getBytesPerColumn(); | |
int end = start + getBytesPerColumn(); | |
MemoryByte[] bytes = line.getBytes(start, end); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open Core.Std | |
let find_mismatches map1 map2 = | |
Map.to_sequence map1 | |
|> Sequence.filter_map ~f:(fun (key, data) -> | |
match Map.find map2 key with | |
| None -> None | |
| Some data' -> | |
if data' <> data then Some key | |
else None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def find_mismatches(d1,d2): | |
mismatches = []; | |
for (key,data) in d1.items(): | |
if data != d2[key]: | |
mismatches.append(key) | |
return mismatches |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let%expect_test _ = | |
let test l = | |
let stringify l = List.map ~f:Int.to_string |> String.concat ~sep:"-" in | |
List.group l ~break:(fun x y -> y < x) | |
|> List.iter ~f:(fun sub -> print_endline (stringify sub)) | |
in | |
test [1;2;3;2;3;3;6;1;2;36;7]; | |
[%expect {| | |
1-2-3 | |
2-3-3-6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int a, b = 0; | |
bool t, f = false; |