id stringlengths 24 24 | repo stringlengths 7 59 | path stringlengths 11 234 | func_name stringlengths 3 140 | url stringlengths 102 339 | split stringclasses 3
values | language stringclasses 1
value | docstring stringlengths 1 34k | code stringlengths 63 466k | text stringlengths 101 467k | token_count int32 22 125k | doc_chars int32 1 34k | code_chars int32 63 466k | license_basis stringclasses 1
value | source stringclasses 1
value | added stringdate 2026-12-05 00:00:00 2026-12-05 00:00:00 | record_sha256 stringlengths 64 64 | license stringclasses 18
values | license_class stringclasses 4
values | license_source stringlengths 45 101 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7fa253210aecd54cfdf5b6f0 | ow2-chameleon/fuchsia | importers/zwave/src/main/java/org/ow2/chameleon/fuchsia/importer/zwave/internal/commandclass/ZWaveAlarmSensorCommandClass.java | ZWaveAlarmSensorCommandClass.getSupportedMessage | https://github.com/ow2-chameleon/fuchsia/blob/4e9318eadbdeb945e529789f573b45386e619bed/importers/zwave/src/main/java/org/ow2/chameleon/fuchsia/importer/zwave/internal/commandclass/ZWaveAlarmSensorCommandClass.java#L237-L252 | train | java | Gets a SerialMessage with the SENSOR_ALARM_SUPPORTED_GET command
@return the serial message, or null if the supported command is not supported. | public SerialMessage getSupportedMessage() {
logger.debug("Creating new message for application command SENSOR_ALARM_SUPPORTED_GET for node {}", this.getNode().getNodeId());
if (this.getNode().getManufacturer() == 0x010F && this.getNode().getDeviceType() == 0x0501) {
logger.warn("Detected Fibaro FGBS001 U... | Gets a SerialMessage with the SENSOR_ALARM_SUPPORTED_GET command
@return the serial message, or null if the supported command is not supported.
public SerialMessage getSupportedMessage() {
logger.debug("Creating new message for application command SENSOR_ALARM_SUPPORTED_GET for node {}", this.getNode().getNodeId())... | 230 | 143 | 948 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | 494b67d225b40bf0b0959d9c6f3fde83cb49d12f8295a2e2490aa8f600b8d034 | Apache-2.0 | permissive | https://github.com/ow2-chameleon/fuchsia/blob/master/LICENSE |
0b910ae3c6001b3574195808 | ow2-chameleon/fuchsia | importers/zwave/src/main/java/org/ow2/chameleon/fuchsia/importer/zwave/internal/commandclass/ZWaveAlarmSensorCommandClass.java | ZWaveAlarmSensorCommandClass.initialize | https://github.com/ow2-chameleon/fuchsia/blob/4e9318eadbdeb945e529789f573b45386e619bed/importers/zwave/src/main/java/org/ow2/chameleon/fuchsia/importer/zwave/internal/commandclass/ZWaveAlarmSensorCommandClass.java#L258-L268 | train | java | Initializes the alarm sensor command class. Requests the supported alarm types. | public Collection<SerialMessage> initialize() {
ArrayList<SerialMessage> result = new ArrayList<SerialMessage>();
if (this.getNode().getManufacturer() == 0x010F && this.getNode().getDeviceType() == 0x0501) {
logger.warn("Detected Fibaro FGBS001 Universal Sensor - this device fails to respond to SENSOR_AL... | Initializes the alarm sensor command class. Requests the supported alarm types.
public Collection<SerialMessage> initialize() {
ArrayList<SerialMessage> result = new ArrayList<SerialMessage>();
if (this.getNode().getManufacturer() == 0x010F && this.getNode().getDeviceType() == 0x0501) {
logger.warn("Det... | 121 | 79 | 456 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | 8e6038eb68eed2e59ac5567236cf35cc65001856828934313fb8b205648e90d0 | Apache-2.0 | permissive | https://github.com/ow2-chameleon/fuchsia/blob/master/LICENSE |
1b4d598471134cf4867106b6 | brunocvcunha/inutils4j | src/main/java/org/brunocvcunha/inutils4j/thirdparty/DateUtils.java | DateUtils.newDateTime | https://github.com/brunocvcunha/inutils4j/blob/223c4443c2cee662576ce644e552588fa114aa94/src/main/java/org/brunocvcunha/inutils4j/thirdparty/DateUtils.java#L65-L67 | train | java | Create a new DateTime. To the last second. This will not create any
extra-millis-seconds, which may cause bugs when writing to stores such as
databases that round milli-seconds up and down. | public static java.util.Date newDateTime() {
return new java.util.Date((System.currentTimeMillis() / SECOND_MILLIS) * SECOND_MILLIS);
} | Create a new DateTime. To the last second. This will not create any
extra-millis-seconds, which may cause bugs when writing to stores such as
databases that round milli-seconds up and down.
public static java.util.Date newDateTime() {
return new java.util.Date((System.currentTimeMillis() / SECOND_MILLIS) * SEC... | 78 | 189 | 147 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | 540e65ce486888460abeeada3a1ee39de0b4dcfdffcf824fbcc26d687d03d688 | Apache-2.0 | permissive | https://github.com/bvolpato/inutils4j/blob/master/LICENSE |
62399ca9dfc6dfd2821f5841 | brunocvcunha/inutils4j | src/main/java/org/brunocvcunha/inutils4j/thirdparty/DateUtils.java | DateUtils.newDate | https://github.com/brunocvcunha/inutils4j/blob/223c4443c2cee662576ce644e552588fa114aa94/src/main/java/org/brunocvcunha/inutils4j/thirdparty/DateUtils.java#L72-L74 | train | java | Create a new Date. To the last day. | public static java.sql.Date newDate() {
return new java.sql.Date((System.currentTimeMillis() / DAY_MILLIS) * DAY_MILLIS);
} | Create a new Date. To the last day.
public static java.sql.Date newDate() {
return new java.sql.Date((System.currentTimeMillis() / DAY_MILLIS) * DAY_MILLIS);
} | 43 | 35 | 135 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | ddcf9cb13dbd602061d48261336e1ed47e72665bacf27867026f5b3b37347b1c | Apache-2.0 | permissive | https://github.com/bvolpato/inutils4j/blob/master/LICENSE |
7d72c604145cf38c19fd568b | brunocvcunha/inutils4j | src/main/java/org/brunocvcunha/inutils4j/thirdparty/DateUtils.java | DateUtils.newTime | https://github.com/brunocvcunha/inutils4j/blob/223c4443c2cee662576ce644e552588fa114aa94/src/main/java/org/brunocvcunha/inutils4j/thirdparty/DateUtils.java#L79-L81 | train | java | Create a new Time, with no date component. | public static java.sql.Time newTime() {
return new java.sql.Time(System.currentTimeMillis() % DAY_MILLIS);
} | Create a new Time, with no date component.
public static java.sql.Time newTime() {
return new java.sql.Time(System.currentTimeMillis() % DAY_MILLIS);
} | 36 | 42 | 120 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | d939e1cb355f41cc5b5a86efe21ab06627201785ebfe61890352bb55f4dc1579 | Apache-2.0 | permissive | https://github.com/bvolpato/inutils4j/blob/master/LICENSE |
07f2cc477f3bda4fdd6827ba | brunocvcunha/inutils4j | src/main/java/org/brunocvcunha/inutils4j/thirdparty/DateUtils.java | DateUtils.secondsDiff | https://github.com/brunocvcunha/inutils4j/blob/223c4443c2cee662576ce644e552588fa114aa94/src/main/java/org/brunocvcunha/inutils4j/thirdparty/DateUtils.java#L93-L99 | train | java | Get the seconds difference | public static int secondsDiff(Date earlierDate, Date laterDate) {
if (earlierDate == null || laterDate == null) {
return 0;
}
return (int) ((laterDate.getTime() / SECOND_MILLIS) - (earlierDate.getTime() / SECOND_MILLIS));
} | Get the seconds difference
public static int secondsDiff(Date earlierDate, Date laterDate) {
if (earlierDate == null || laterDate == null) {
return 0;
}
return (int) ((laterDate.getTime() / SECOND_MILLIS) - (earlierDate.getTime() / SECOND_MILLIS));
} | 72 | 26 | 264 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | 7e23539bf3695294ec9f7b1b5c76dac998d3de35f2db180f132b9c634c8cdde7 | Apache-2.0 | permissive | https://github.com/bvolpato/inutils4j/blob/master/LICENSE |
131073fd9e08de7d3b9dcd45 | brunocvcunha/inutils4j | src/main/java/org/brunocvcunha/inutils4j/thirdparty/DateUtils.java | DateUtils.minutesDiff | https://github.com/brunocvcunha/inutils4j/blob/223c4443c2cee662576ce644e552588fa114aa94/src/main/java/org/brunocvcunha/inutils4j/thirdparty/DateUtils.java#L104-L110 | train | java | Get the minutes difference | public static int minutesDiff(Date earlierDate, Date laterDate) {
if (earlierDate == null || laterDate == null) {
return 0;
}
return (int) ((laterDate.getTime() / MINUTE_MILLIS) - (earlierDate.getTime() / MINUTE_MILLIS));
} | Get the minutes difference
public static int minutesDiff(Date earlierDate, Date laterDate) {
if (earlierDate == null || laterDate == null) {
return 0;
}
return (int) ((laterDate.getTime() / MINUTE_MILLIS) - (earlierDate.getTime() / MINUTE_MILLIS));
} | 74 | 26 | 264 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | fb67c653bc21b7281c4735ce4227a8f60439a8db9c00f9a8d0ed8397ad5f728e | Apache-2.0 | permissive | https://github.com/bvolpato/inutils4j/blob/master/LICENSE |
6edd33ae079b1aee08b9b3b9 | brunocvcunha/inutils4j | src/main/java/org/brunocvcunha/inutils4j/thirdparty/DateUtils.java | DateUtils.hoursDiff | https://github.com/brunocvcunha/inutils4j/blob/223c4443c2cee662576ce644e552588fa114aa94/src/main/java/org/brunocvcunha/inutils4j/thirdparty/DateUtils.java#L115-L121 | train | java | Get the hours difference | public static int hoursDiff(Date earlierDate, Date laterDate) {
if (earlierDate == null || laterDate == null) {
return 0;
}
return (int) ((laterDate.getTime() / HOUR_MILLIS) - (earlierDate.getTime() / HOUR_MILLIS));
} | Get the hours difference
public static int hoursDiff(Date earlierDate, Date laterDate) {
if (earlierDate == null || laterDate == null) {
return 0;
}
return (int) ((laterDate.getTime() / HOUR_MILLIS) - (earlierDate.getTime() / HOUR_MILLIS));
} | 72 | 24 | 258 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | 0dcbf5c512b17a79ec2de297388727a9f07db2d5a55788afeb28f93a24f1c92b | Apache-2.0 | permissive | https://github.com/bvolpato/inutils4j/blob/master/LICENSE |
e3e2fd1ca1225cc227dd867c | brunocvcunha/inutils4j | src/main/java/org/brunocvcunha/inutils4j/thirdparty/DateUtils.java | DateUtils.daysDiff | https://github.com/brunocvcunha/inutils4j/blob/223c4443c2cee662576ce644e552588fa114aa94/src/main/java/org/brunocvcunha/inutils4j/thirdparty/DateUtils.java#L126-L132 | train | java | Get the days difference | public static int daysDiff(Date earlierDate, Date laterDate) {
if (earlierDate == null || laterDate == null) {
return 0;
}
return (int) ((laterDate.getTime() / DAY_MILLIS) - (earlierDate.getTime() / DAY_MILLIS));
} | Get the days difference
public static int daysDiff(Date earlierDate, Date laterDate) {
if (earlierDate == null || laterDate == null) {
return 0;
}
return (int) ((laterDate.getTime() / DAY_MILLIS) - (earlierDate.getTime() / DAY_MILLIS));
} | 72 | 23 | 255 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | 164bf10e8fa38066e7ecd989e3c0447170fcf7e38d3472497bb6b609eefce33c | Apache-2.0 | permissive | https://github.com/bvolpato/inutils4j/blob/master/LICENSE |
b5fd5f1d4dd9bdb823b43511 | brunocvcunha/inutils4j | src/main/java/org/brunocvcunha/inutils4j/thirdparty/DateUtils.java | DateUtils.rollTime | https://github.com/brunocvcunha/inutils4j/blob/223c4443c2cee662576ce644e552588fa114aa94/src/main/java/org/brunocvcunha/inutils4j/thirdparty/DateUtils.java#L141-L146 | train | java | Roll the java.util.Time forward or backward.
@param startDate - The start date
@param period Calendar.YEAR etc
@param amount - Negative to rollbackwards. | public static java.sql.Time rollTime(java.util.Date startDate, int period, int amount) {
GregorianCalendar gc = new GregorianCalendar();
gc.setTime(startDate);
gc.add(period, amount);
return new java.sql.Time(gc.getTime().getTime());
} | Roll the java.util.Time forward or backward.
@param startDate - The start date
@param period Calendar.YEAR etc
@param amount - Negative to rollbackwards.
public static java.sql.Time rollTime(java.util.Date startDate, int period, int amount) {
GregorianCalendar gc = new GregorianCalendar();
gc.setTime(... | 83 | 154 | 271 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | 622022e48a1c40b20043c7d3a6324abed1e39496d449c57470ea0e414ac99091 | Apache-2.0 | permissive | https://github.com/bvolpato/inutils4j/blob/master/LICENSE |
aef0633f6a8bb5d4aaf3dace | brunocvcunha/inutils4j | src/main/java/org/brunocvcunha/inutils4j/thirdparty/DateUtils.java | DateUtils.rollDateTime | https://github.com/brunocvcunha/inutils4j/blob/223c4443c2cee662576ce644e552588fa114aa94/src/main/java/org/brunocvcunha/inutils4j/thirdparty/DateUtils.java#L155-L160 | train | java | Roll the java.util.Date forward or backward.
@param startDate - The start date
@param period Calendar.YEAR etc
@param amount - Negative to rollbackwards. | public static java.util.Date rollDateTime(java.util.Date startDate, int period, int amount) {
GregorianCalendar gc = new GregorianCalendar();
gc.setTime(startDate);
gc.add(period, amount);
return new java.util.Date(gc.getTime().getTime());
} | Roll the java.util.Date forward or backward.
@param startDate - The start date
@param period Calendar.YEAR etc
@param amount - Negative to rollbackwards.
public static java.util.Date rollDateTime(java.util.Date startDate, int period, int amount) {
GregorianCalendar gc = new GregorianCalendar();
gc.set... | 83 | 154 | 277 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | c7b9d6c41b49505e111d68878c8577bf232abbd873ef2d37a15a42a7bfb70e7c | Apache-2.0 | permissive | https://github.com/bvolpato/inutils4j/blob/master/LICENSE |
0c8bdbbf08917c3300cdf50a | brunocvcunha/inutils4j | src/main/java/org/brunocvcunha/inutils4j/thirdparty/DateUtils.java | DateUtils.rollYears | https://github.com/brunocvcunha/inutils4j/blob/223c4443c2cee662576ce644e552588fa114aa94/src/main/java/org/brunocvcunha/inutils4j/thirdparty/DateUtils.java#L182-L184 | train | java | Roll the years forward or backward.
@param startDate - The start date
@param years - Negative to rollbackwards. | public static java.sql.Date rollYears(java.util.Date startDate, int years) {
return rollDate(startDate, Calendar.YEAR, years);
} | Roll the years forward or backward.
@param startDate - The start date
@param years - Negative to rollbackwards.
public static java.sql.Date rollYears(java.util.Date startDate, int years) {
return rollDate(startDate, Calendar.YEAR, years);
} | 51 | 112 | 140 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | 5e5ae91ff06c7b65765f35c88b688dafb9892a8e53dc06a0ac3d5b7b6c618038 | Apache-2.0 | permissive | https://github.com/bvolpato/inutils4j/blob/master/LICENSE |
06d0b0c25051317385ecd4dd | brunocvcunha/inutils4j | src/main/java/org/brunocvcunha/inutils4j/thirdparty/DateUtils.java | DateUtils.rollMonths | https://github.com/brunocvcunha/inutils4j/blob/223c4443c2cee662576ce644e552588fa114aa94/src/main/java/org/brunocvcunha/inutils4j/thirdparty/DateUtils.java#L192-L194 | train | java | Roll the days forward or backward.
@param startDate - The start date
@param months - Negative to rollbackwards. | public static java.sql.Date rollMonths(java.util.Date startDate, int months) {
return rollDate(startDate, Calendar.MONTH, months);
} | Roll the days forward or backward.
@param startDate - The start date
@param months - Negative to rollbackwards.
public static java.sql.Date rollMonths(java.util.Date startDate, int months) {
return rollDate(startDate, Calendar.MONTH, months);
} | 51 | 112 | 144 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | 76d08636dd4adbcaacb013e6f466ea733f52b3809a35d20785a465714278eab9 | Apache-2.0 | permissive | https://github.com/bvolpato/inutils4j/blob/master/LICENSE |
2461ec37293e767290b84aac | brunocvcunha/inutils4j | src/main/java/org/brunocvcunha/inutils4j/thirdparty/DateUtils.java | DateUtils.rollDays | https://github.com/brunocvcunha/inutils4j/blob/223c4443c2cee662576ce644e552588fa114aa94/src/main/java/org/brunocvcunha/inutils4j/thirdparty/DateUtils.java#L202-L204 | train | java | Roll the days forward or backward.
@param startDate - The start date
@param days - Negative to rollbackwards. | public static java.sql.Date rollDays(java.util.Date startDate, int days) {
return rollDate(startDate, Calendar.DATE, days);
} | Roll the days forward or backward.
@param startDate - The start date
@param days - Negative to rollbackwards.
public static java.sql.Date rollDays(java.util.Date startDate, int days) {
return rollDate(startDate, Calendar.DATE, days);
} | 51 | 110 | 137 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | 53d1986a02bf2a53a7d35d629623832100805a986ef06b6f0c120d4f9acb2fea | Apache-2.0 | permissive | https://github.com/bvolpato/inutils4j/blob/master/LICENSE |
2c123260080f74b28ca1720d | brunocvcunha/inutils4j | src/main/java/org/brunocvcunha/inutils4j/thirdparty/DateUtils.java | DateUtils.dateEquals | https://github.com/brunocvcunha/inutils4j/blob/223c4443c2cee662576ce644e552588fa114aa94/src/main/java/org/brunocvcunha/inutils4j/thirdparty/DateUtils.java#L209-L218 | train | java | Checks the day, month and year are equal. | @SuppressWarnings("deprecation")
public static boolean dateEquals(java.util.Date d1, java.util.Date d2) {
if (d1 == null || d2 == null) {
return false;
}
return d1.getDate() == d2.getDate()
&& d1.getMonth() == d2.getMonth()
&& d1.getYear() == d2.getY... | Checks the day, month and year are equal.
@SuppressWarnings("deprecation")
public static boolean dateEquals(java.util.Date d1, java.util.Date d2) {
if (d1 == null || d2 == null) {
return false;
}
return d1.getDate() == d2.getDate()
&& d1.getMonth() == d2.getMonth()... | 90 | 41 | 332 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | 3b0a88009a5b1173fb0b1216854e75104705b345c5c31c8ac4c9406ee51e1f67 | Apache-2.0 | permissive | https://github.com/bvolpato/inutils4j/blob/master/LICENSE |
618748da694ab48ab84e6d30 | brunocvcunha/inutils4j | src/main/java/org/brunocvcunha/inutils4j/thirdparty/DateUtils.java | DateUtils.timeEquals | https://github.com/brunocvcunha/inutils4j/blob/223c4443c2cee662576ce644e552588fa114aa94/src/main/java/org/brunocvcunha/inutils4j/thirdparty/DateUtils.java#L223-L232 | train | java | Checks the hour, minute and second are equal. | @SuppressWarnings("deprecation")
public static boolean timeEquals(java.util.Date d1, java.util.Date d2) {
if (d1 == null || d2 == null) {
return false;
}
return d1.getHours() == d2.getHours()
&& d1.getMinutes() == d2.getMinutes()
&& d1.getSeconds() =... | Checks the hour, minute and second are equal.
@SuppressWarnings("deprecation")
public static boolean timeEquals(java.util.Date d1, java.util.Date d2) {
if (d1 == null || d2 == null) {
return false;
}
return d1.getHours() == d2.getHours()
&& d1.getMinutes() == d2.ge... | 88 | 45 | 344 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | 365f5b7a2d3975c6513fdcbf8f18ddf947ac4e064b444fb7cf38185a33d5d967 | Apache-2.0 | permissive | https://github.com/bvolpato/inutils4j/blob/master/LICENSE |
31dacecdad9759565055e58e | brunocvcunha/inutils4j | src/main/java/org/brunocvcunha/inutils4j/thirdparty/DateUtils.java | DateUtils.dateTimeEquals | https://github.com/brunocvcunha/inutils4j/blob/223c4443c2cee662576ce644e552588fa114aa94/src/main/java/org/brunocvcunha/inutils4j/thirdparty/DateUtils.java#L237-L249 | train | java | Checks the second, hour, month, day, month and year are equal. | @SuppressWarnings("deprecation")
public static boolean dateTimeEquals(java.util.Date d1, java.util.Date d2) {
if (d1 == null || d2 == null) {
return false;
}
return d1.getDate() == d2.getDate()
&& d1.getMonth() == d2.getMonth()
&& d1.getYear() == d2.... | Checks the second, hour, month, day, month and year are equal.
@SuppressWarnings("deprecation")
public static boolean dateTimeEquals(java.util.Date d1, java.util.Date d2) {
if (d1 == null || d2 == null) {
return false;
}
return d1.getDate() == d2.getDate()
&& d1.ge... | 129 | 62 | 494 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | 63998e3dd5e4ffe17fb4b3a27c2a9948e3cf80b9c8f2340d0bd85c8a1d6a888f | Apache-2.0 | permissive | https://github.com/bvolpato/inutils4j/blob/master/LICENSE |
d14b7939bc2b0c10d6c30a3a | brunocvcunha/inutils4j | src/main/java/org/brunocvcunha/inutils4j/thirdparty/DateUtils.java | DateUtils.toObject | https://github.com/brunocvcunha/inutils4j/blob/223c4443c2cee662576ce644e552588fa114aa94/src/main/java/org/brunocvcunha/inutils4j/thirdparty/DateUtils.java#L254-L276 | train | java | Convert an Object of type Class to an Object. | public static Object toObject(Class<?> clazz, Object value) throws ParseException {
if (value == null) {
return null;
}
if (clazz == null) {
return value;
}
if (java.sql.Date.class.isAssignableFrom(clazz)) {
return toDate(value);
}
... | Convert an Object of type Class to an Object.
public static Object toObject(Class<?> clazz, Object value) throws ParseException {
if (value == null) {
return null;
}
if (clazz == null) {
return value;
}
if (java.sql.Date.class.isAssignableFrom(clazz)) {
... | 138 | 45 | 669 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | 342c66eca15528d66b3f057238c9c67ccc64dd839680a74c3ca1deda26de5fec | Apache-2.0 | permissive | https://github.com/bvolpato/inutils4j/blob/master/LICENSE |
fbc932e0b14c5bce1ef1adfb | brunocvcunha/inutils4j | src/main/java/org/brunocvcunha/inutils4j/thirdparty/DateUtils.java | DateUtils.getDateTime | https://github.com/brunocvcunha/inutils4j/blob/223c4443c2cee662576ce644e552588fa114aa94/src/main/java/org/brunocvcunha/inutils4j/thirdparty/DateUtils.java#L281-L288 | train | java | Convert an Object to a DateTime, without an Exception | public static java.util.Date getDateTime(Object value) {
try {
return toDateTime(value);
} catch (ParseException pe) {
pe.printStackTrace();
return null;
}
} | Convert an Object to a DateTime, without an Exception
public static java.util.Date getDateTime(Object value) {
try {
return toDateTime(value);
} catch (ParseException pe) {
pe.printStackTrace();
return null;
}
} | 51 | 53 | 221 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | 55b2301885ed79daef68af7eec2de666fd9113aea9da53c0164bff6e949f17eb | Apache-2.0 | permissive | https://github.com/bvolpato/inutils4j/blob/master/LICENSE |
85799df1e2145a3f57e10427 | brunocvcunha/inutils4j | src/main/java/org/brunocvcunha/inutils4j/thirdparty/DateUtils.java | DateUtils.toDateTime | https://github.com/brunocvcunha/inutils4j/blob/223c4443c2cee662576ce644e552588fa114aa94/src/main/java/org/brunocvcunha/inutils4j/thirdparty/DateUtils.java#L293-L308 | train | java | Convert an Object to a DateTime. | public static java.util.Date toDateTime(Object value) throws ParseException {
if (value == null) {
return null;
}
if (value instanceof java.util.Date) {
return (java.util.Date) value;
}
if (value instanceof String) {
if ("".equals((String) valu... | Convert an Object to a DateTime.
public static java.util.Date toDateTime(Object value) throws ParseException {
if (value == null) {
return null;
}
if (value instanceof java.util.Date) {
return (java.util.Date) value;
}
if (value instanceof String) {
... | 106 | 32 | 505 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | a2365f4fea2ba3780ae072d8992f7ebfbc9e3b66805e20f13320017343543ca7 | Apache-2.0 | permissive | https://github.com/bvolpato/inutils4j/blob/master/LICENSE |
286bfdcdd37147c295193ddf | brunocvcunha/inutils4j | src/main/java/org/brunocvcunha/inutils4j/thirdparty/DateUtils.java | DateUtils.getDate | https://github.com/brunocvcunha/inutils4j/blob/223c4443c2cee662576ce644e552588fa114aa94/src/main/java/org/brunocvcunha/inutils4j/thirdparty/DateUtils.java#L313-L320 | train | java | Convert an Object to a Date, without an Exception | public static java.sql.Date getDate(Object value) {
try {
return toDate(value);
} catch (ParseException pe) {
pe.printStackTrace();
return null;
}
} | Convert an Object to a Date, without an Exception
public static java.sql.Date getDate(Object value) {
try {
return toDate(value);
} catch (ParseException pe) {
pe.printStackTrace();
return null;
}
} | 49 | 49 | 212 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | eab8356d5b668c08daa55b44b5619118eb826ac34c5123b398c58d566dd9204c | Apache-2.0 | permissive | https://github.com/bvolpato/inutils4j/blob/master/LICENSE |
42964fc36e48e3dfd539ad4e | brunocvcunha/inutils4j | src/main/java/org/brunocvcunha/inutils4j/thirdparty/DateUtils.java | DateUtils.toDate | https://github.com/brunocvcunha/inutils4j/blob/223c4443c2cee662576ce644e552588fa114aa94/src/main/java/org/brunocvcunha/inutils4j/thirdparty/DateUtils.java#L325-L340 | train | java | Convert an Object to a Date. | public static java.sql.Date toDate(Object value) throws ParseException {
if (value == null) {
return null;
}
if (value instanceof java.sql.Date) {
return (java.sql.Date) value;
}
if (value instanceof String) {
if ("".equals((String) value)) {
... | Convert an Object to a Date.
public static java.sql.Date toDate(Object value) throws ParseException {
if (value == null) {
return null;
}
if (value instanceof java.sql.Date) {
return (java.sql.Date) value;
}
if (value instanceof String) {
if (... | 115 | 28 | 548 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | 5f4febe27ac5b60951c6bbcf51e11060cefb3dbad6b073467acf2c702778ae0a | Apache-2.0 | permissive | https://github.com/bvolpato/inutils4j/blob/master/LICENSE |
7862a13e19a8d569aa43fcde | brunocvcunha/inutils4j | src/main/java/org/brunocvcunha/inutils4j/thirdparty/DateUtils.java | DateUtils.getTime | https://github.com/brunocvcunha/inutils4j/blob/223c4443c2cee662576ce644e552588fa114aa94/src/main/java/org/brunocvcunha/inutils4j/thirdparty/DateUtils.java#L345-L352 | train | java | Convert an Object to a Time, without an Exception | public static java.sql.Time getTime(Object value) {
try {
return toTime(value);
} catch (ParseException pe) {
pe.printStackTrace();
return null;
}
} | Convert an Object to a Time, without an Exception
public static java.sql.Time getTime(Object value) {
try {
return toTime(value);
} catch (ParseException pe) {
pe.printStackTrace();
return null;
}
} | 50 | 49 | 212 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | 0cfefe73c409a993f70bbcf0c3807f177f16fdc0502c2d99c3fe8e5b057c5741 | Apache-2.0 | permissive | https://github.com/bvolpato/inutils4j/blob/master/LICENSE |
905b0f046b540a1fffb55441 | brunocvcunha/inutils4j | src/main/java/org/brunocvcunha/inutils4j/thirdparty/DateUtils.java | DateUtils.toTime | https://github.com/brunocvcunha/inutils4j/blob/223c4443c2cee662576ce644e552588fa114aa94/src/main/java/org/brunocvcunha/inutils4j/thirdparty/DateUtils.java#L357-L372 | train | java | Convert an Object to a Time. | public static java.sql.Time toTime(Object value) throws ParseException {
if (value == null) {
return null;
}
if (value instanceof java.sql.Time) {
return (java.sql.Time) value;
}
if (value instanceof String) {
if ("".equals((String) value)) {
... | Convert an Object to a Time.
public static java.sql.Time toTime(Object value) throws ParseException {
if (value == null) {
return null;
}
if (value instanceof java.sql.Time) {
return (java.sql.Time) value;
}
if (value instanceof String) {
if (... | 116 | 28 | 548 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | 22f330e664bf4dca4985c09b82dbbe4af41449fa0d0995d9993b47a812450a07 | Apache-2.0 | permissive | https://github.com/bvolpato/inutils4j/blob/master/LICENSE |
d0a6196cb87bc65b05e025d9 | brunocvcunha/inutils4j | src/main/java/org/brunocvcunha/inutils4j/thirdparty/DateUtils.java | DateUtils.getTimestamp | https://github.com/brunocvcunha/inutils4j/blob/223c4443c2cee662576ce644e552588fa114aa94/src/main/java/org/brunocvcunha/inutils4j/thirdparty/DateUtils.java#L377-L384 | train | java | Convert an Object to a Timestamp, without an Exception | public static java.sql.Timestamp getTimestamp(Object value) {
try {
return toTimestamp(value);
} catch (ParseException pe) {
pe.printStackTrace();
return null;
}
} | Convert an Object to a Timestamp, without an Exception
public static java.sql.Timestamp getTimestamp(Object value) {
try {
return toTimestamp(value);
} catch (ParseException pe) {
pe.printStackTrace();
return null;
}
} | 51 | 54 | 227 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | 270e32cc4035ab2493aec6ed829115c410b3dba525e5534feb343d60a08a0360 | Apache-2.0 | permissive | https://github.com/bvolpato/inutils4j/blob/master/LICENSE |
918a5fea092c3018e5b0417c | brunocvcunha/inutils4j | src/main/java/org/brunocvcunha/inutils4j/thirdparty/DateUtils.java | DateUtils.toTimestamp | https://github.com/brunocvcunha/inutils4j/blob/223c4443c2cee662576ce644e552588fa114aa94/src/main/java/org/brunocvcunha/inutils4j/thirdparty/DateUtils.java#L389-L405 | train | java | Convert an Object to a Timestamp. | public static java.sql.Timestamp toTimestamp(Object value) throws ParseException {
if (value == null) {
return null;
}
if (value instanceof java.sql.Timestamp) {
return (java.sql.Timestamp) value;
}
if (value instanceof String) {
if ("".equals... | Convert an Object to a Timestamp.
public static java.sql.Timestamp toTimestamp(Object value) throws ParseException {
if (value == null) {
return null;
}
if (value instanceof java.sql.Timestamp) {
return (java.sql.Timestamp) value;
}
if (value instanceof S... | 116 | 33 | 589 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | b0985b6ed54076969abc9bb187cf8dd547b9a1a49e7ad874033eee978570aa1c | Apache-2.0 | permissive | https://github.com/bvolpato/inutils4j/blob/master/LICENSE |
0c8826fc62d54c7fdea7d58a | brunocvcunha/inutils4j | src/main/java/org/brunocvcunha/inutils4j/thirdparty/DateUtils.java | DateUtils.isTimeInRange | https://github.com/brunocvcunha/inutils4j/blob/223c4443c2cee662576ce644e552588fa114aa94/src/main/java/org/brunocvcunha/inutils4j/thirdparty/DateUtils.java#L410-L426 | train | java | Tells you if the date part of a datetime is in a certain time range. | @SuppressWarnings("deprecation")
public static boolean isTimeInRange(java.sql.Time start, java.sql.Time end, java.util.Date d) {
d = new java.sql.Time(d.getHours(), d.getMinutes(), d.getSeconds());
if (start == null || end == null) {
return false;
}
if (start.before(end) &... | Tells you if the date part of a datetime is in a certain time range.
@SuppressWarnings("deprecation")
public static boolean isTimeInRange(java.sql.Time start, java.sql.Time end, java.util.Date d) {
d = new java.sql.Time(d.getHours(), d.getMinutes(), d.getSeconds());
if (start == null || end == null) ... | 134 | 68 | 534 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | 8078352102eddd213e637af6ff4f782ee32bd07f5771f48f959033e2cfbcd145 | Apache-2.0 | permissive | https://github.com/bvolpato/inutils4j/blob/master/LICENSE |
6c637db7122d50834ae7454e | thorstenwagner/TraJ | src/main/java/de/biomedical_imaging/traJ/TrajectoryUtil.java | TrajectoryUtil.combineTrajectory | https://github.com/thorstenwagner/TraJ/blob/505fafb1f2f77a2d67bb2a089a2fdebe2c9bc7cb/src/main/java/de/biomedical_imaging/traJ/TrajectoryUtil.java#L45-L63 | train | java | Combines two trajectories by adding the corresponding positions. The trajectories have to have the same length.
@param a The first trajectory
@param b The second trajectory
@return The combined trajectory | public static Trajectory combineTrajectory(Trajectory a, Trajectory b){
if(a.getDimension()!=b.getDimension()){
throw new IllegalArgumentException("Combination not possible: The trajectorys does not have the same dimension");
}
if(a.size()!=b.size()){
throw new IllegalArgumentException("Combination not poss... | Combines two trajectories by adding the corresponding positions. The trajectories have to have the same length.
@param a The first trajectory
@param b The second trajectory
@return The combined trajectory
public static Trajectory combineTrajectory(Trajectory a, Trajectory b){
if(a.getDimension()!=b.getDimension()){
... | 225 | 204 | 666 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | f5f80dafd05df8be913d3701b290bbfcff475be689c6cf204ed17ac8116d6f15 | MIT | permissive | https://github.com/thorstenwagner/TraJ/blob/master/license.txt |
dd2f5846fc05cb13b72ef817 | thorstenwagner/TraJ | src/main/java/de/biomedical_imaging/traJ/TrajectoryUtil.java | TrajectoryUtil.concactTrajectorie | https://github.com/thorstenwagner/TraJ/blob/505fafb1f2f77a2d67bb2a089a2fdebe2c9bc7cb/src/main/java/de/biomedical_imaging/traJ/TrajectoryUtil.java#L71-L97 | train | java | Concatenates the trajectory a and b
@param a The end of this trajectory will be connected to the start of trajectory b
@param b The start of this trajectory will be connected to the end of trajectory a
@return Concatenated trajectory | public static Trajectory concactTrajectorie(Trajectory a, Trajectory b){
if(a.getDimension()!=b.getDimension()){
throw new IllegalArgumentException("Combination not possible: The trajectorys does not have the same dimension");
}
Trajectory c = new Trajectory(a.getDimension());
for(int i = 0 ; i < a.size()... | Concatenates the trajectory a and b
@param a The end of this trajectory will be connected to the start of trajectory b
@param b The start of this trajectory will be connected to the end of trajectory a
@return Concatenated trajectory
public static Trajectory concactTrajectorie(Trajectory a, Trajectory b){
if(a.getDi... | 300 | 233 | 739 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | 9f27a7ea12604874297f16963921bc6189fb94b2c45de6671c163ab30531e24f | MIT | permissive | https://github.com/thorstenwagner/TraJ/blob/master/license.txt |
128fcb62f9955ce9898c5749 | thorstenwagner/TraJ | src/main/java/de/biomedical_imaging/traJ/TrajectoryUtil.java | TrajectoryUtil.resample | https://github.com/thorstenwagner/TraJ/blob/505fafb1f2f77a2d67bb2a089a2fdebe2c9bc7cb/src/main/java/de/biomedical_imaging/traJ/TrajectoryUtil.java#L105-L113 | train | java | Resamples a trajectory
@param t Trajectory to resample
@param n Resample rate
@return Returns a resampled trajectory which contains every n'th position of t | public static Trajectory resample(Trajectory t, int n){
Trajectory t1 = new Trajectory(2);
for(int i = 0; i < t.size(); i=i+n){
t1.add(t.get(i));
}
return t1;
} | Resamples a trajectory
@param t Trajectory to resample
@param n Resample rate
@return Returns a resampled trajectory which contains every n'th position of t
public static Trajectory resample(Trajectory t, int n){
Trajectory t1 = new Trajectory(2);
for(int i = 0; i < t.size(); i=i+n){
t1.add(t.get(i));
}
... | 99 | 156 | 178 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | 2cbbf1f0f97064622c7cd4992db87e5e48fe294585648e8b7271d127f8e2fa07 | MIT | permissive | https://github.com/thorstenwagner/TraJ/blob/master/license.txt |
6364ba5a6ab473f7189e705b | thorstenwagner/TraJ | src/main/java/de/biomedical_imaging/traJ/TrajectoryUtil.java | TrajectoryUtil.splitTrackInSubTracks | https://github.com/thorstenwagner/TraJ/blob/505fafb1f2f77a2d67bb2a089a2fdebe2c9bc7cb/src/main/java/de/biomedical_imaging/traJ/TrajectoryUtil.java#L131-L156 | train | java | Splits a trajectory in overlapping / non-overlapping sub-trajectories.
@param t
@param windowWidth Window width. Each sub-trajectory will have this length
@param overlapping Allows the window to overlap
@return ArrayList with sub-trajectories | public static ArrayList<Trajectory> splitTrackInSubTracks(Trajectory t, int windowWidth, boolean overlapping){
int increment = 1;
if(overlapping==false){
increment=windowWidth;
}
ArrayList<Trajectory> subTrajectories = new ArrayList<Trajectory>();
boolean trackEndReached = false;
for(int i = 0; i < t.... | Splits a trajectory in overlapping / non-overlapping sub-trajectories.
@param t
@param windowWidth Window width. Each sub-trajectory will have this length
@param overlapping Allows the window to overlap
@return ArrayList with sub-trajectories
public static ArrayList<Trajectory> splitTrackInSubTracks(Trajectory t, int ... | 247 | 242 | 687 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | 1423c3204bd0a665b3935cae05dba87116570ccb3de9166e0e9bbea0184e6a59 | MIT | permissive | https://github.com/thorstenwagner/TraJ/blob/master/license.txt |
6be809e4188314f537a7f0f6 | thorstenwagner/TraJ | src/main/java/de/biomedical_imaging/traJ/TrajectoryUtil.java | TrajectoryUtil.getTrajectoryByID | https://github.com/thorstenwagner/TraJ/blob/505fafb1f2f77a2d67bb2a089a2fdebe2c9bc7cb/src/main/java/de/biomedical_imaging/traJ/TrajectoryUtil.java#L164-L173 | train | java | Finds trajectory by ID
@param t List of Trajectories
@param id ID of the trajectorie
@return Trajectory with ID=id | public static Trajectory getTrajectoryByID(List<? extends Trajectory> t, int id){
Trajectory track = null;
for(int i = 0; i < t.size() ; i++){
if(t.get(i).getID()==id){
track = t.get(i);
break;
}
}
return track;
} | Finds trajectory by ID
@param t List of Trajectories
@param id ID of the trajectorie
@return Trajectory with ID=id
public static Trajectory getTrajectoryByID(List<? extends Trajectory> t, int id){
Trajectory track = null;
for(int i = 0; i < t.size() ; i++){
if(t.get(i).getID()==id){
track = t.get(i);
br... | 105 | 114 | 236 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | bb89e89d1ae4468a22dd706bc4b04bf24ff37ecf3e1155a62b89605a93f14d15 | MIT | permissive | https://github.com/thorstenwagner/TraJ/blob/master/license.txt |
aa83a69e71f80ea555467041 | ow2-chameleon/fuchsia | bases/knx/calimero/src/main/java/tuwien/auto/calimero/buffer/CommandFilter.java | CommandFilter.getNextIndication | https://github.com/ow2-chameleon/fuchsia/blob/4e9318eadbdeb945e529789f573b45386e619bed/bases/knx/calimero/src/main/java/tuwien/auto/calimero/buffer/CommandFilter.java#L178-L185 | train | java | Returns the next available indication.
<p>
The items with the cEMI frame indications are returned in FIFO order according the
time they were supplied to the filter and buffered in the first place, i.e. an
earlier accepted frame is returned before an frame accepted at some later time.<br>
Every item is only returned onc... | public QueueItem getNextIndication()
{
synchronized (indicationKeys) {
if (indicationKeys.isEmpty())
throw new KNXIllegalStateException("no indications");
return ((LDataObjectQueue) indicationKeys.remove(0)).getItem();
}
} | Returns the next available indication.
<p>
The items with the cEMI frame indications are returned in FIFO order according the
time they were supplied to the filter and buffered in the first place, i.e. an
earlier accepted frame is returned before an frame accepted at some later time.<br>
Every item is only returned onc... | 337 | 1,289 | 245 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | 65f1b297b61332ad39ec64756e12370d1fa6973653fdc83ea8d2a1065cb0369f | Apache-2.0 | permissive | https://github.com/ow2-chameleon/fuchsia/blob/master/LICENSE |
6510ef0494e6ee7050297c9e | ow2-chameleon/fuchsia | bases/knx/calimero/src/main/java/tuwien/auto/calimero/KNXAddress.java | KNXAddress.create | https://github.com/ow2-chameleon/fuchsia/blob/4e9318eadbdeb945e529789f573b45386e619bed/bases/knx/calimero/src/main/java/tuwien/auto/calimero/KNXAddress.java#L163-L175 | train | java | Creates a KNX address from xml input.
<p>
The KNX address element is expected to be the current or next element from the
parser.
@param r a XML reader
@return the created KNXAddress, either of subtype {@link GroupAddress} or
{@link IndividualAddress}
@throws KNXMLException if the XML element is no KNX address, on unkn... | public static KNXAddress create(XMLReader r) throws KNXMLException
{
if (r.getPosition() != XMLReader.START_TAG)
r.read();
if (r.getPosition() == XMLReader.START_TAG) {
final String type = r.getCurrent().getAttribute(ATTR_TYPE);
if (GroupAddress.ATTR_GROUP.equals(type))
return new GroupAddress(... | Creates a KNX address from xml input.
<p>
The KNX address element is expected to be the current or next element from the
parser.
@param r a XML reader
@return the created KNXAddress, either of subtype {@link GroupAddress} or
{@link IndividualAddress}
@throws KNXMLException if the XML element is no KNX address, on unkn... | 203 | 360 | 499 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | b13a7862e40d28c46a76d24378d19a521781828451186f5ef41f8ed39f8a9670 | Apache-2.0 | permissive | https://github.com/ow2-chameleon/fuchsia/blob/master/LICENSE |
c72de3713dc4a83892dc39a2 | ow2-chameleon/fuchsia | bases/knx/calimero/src/main/java/tuwien/auto/calimero/KNXAddress.java | KNXAddress.create | https://github.com/ow2-chameleon/fuchsia/blob/4e9318eadbdeb945e529789f573b45386e619bed/bases/knx/calimero/src/main/java/tuwien/auto/calimero/KNXAddress.java#L191-L196 | train | java | Creates a KNX address from a string <code>address</code> representation.
<p>
An address level separator of type '.' found in <code>address</code> indicates an
individual address, i.e. an {@link IndividualAddress} is created, otherwise a
{@link GroupAddress} is created.<br>
Allowed separators are '.' or '/', mutually ex... | public static KNXAddress create(String address) throws KNXFormatException
{
if (address.indexOf('.') != -1)
return new IndividualAddress(address);
return new GroupAddress(address);
} | Creates a KNX address from a string <code>address</code> representation.
<p>
An address level separator of type '.' found in <code>address</code> indicates an
individual address, i.e. an {@link IndividualAddress} is created, otherwise a
{@link GroupAddress} is created.<br>
Allowed separators are '.' or '/', mutually ex... | 168 | 583 | 196 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | 096204a8883b12666dd9c015dcba3c8d4577533725feda4f7ffe1f4d94578889 | Apache-2.0 | permissive | https://github.com/ow2-chameleon/fuchsia/blob/master/LICENSE |
635266980957e071087012c2 | ow2-chameleon/fuchsia | bases/knx/calimero/src/main/java/tuwien/auto/calimero/KNXAddress.java | KNXAddress.save | https://github.com/ow2-chameleon/fuchsia/blob/4e9318eadbdeb945e529789f573b45386e619bed/bases/knx/calimero/src/main/java/tuwien/auto/calimero/KNXAddress.java#L224-L230 | train | java | Writes the KNX address in XML format to the supplied writer.
<p>
@param w a XML writer
@throws KNXMLException on output error | public void save(XMLWriter w) throws KNXMLException
{
final List att = new ArrayList();
att.add(new Attribute(ATTR_TYPE, getType()));
w.writeElement(TAG_ADDRESS, att, Integer.toString(address));
w.endElement();
} | Writes the KNX address in XML format to the supplied writer.
<p>
@param w a XML writer
@throws KNXMLException on output error
public void save(XMLWriter w) throws KNXMLException
{
final List att = new ArrayList();
att.add(new Attribute(ATTR_TYPE, getType()));
w.writeElement(TAG_ADDRESS, att, Integer.toStri... | 84 | 126 | 228 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | 0fa52a45ab1dc53b81c859dc7bbf3ca02042f9e73e8a34bfd00d78bc8c07e08a | Apache-2.0 | permissive | https://github.com/ow2-chameleon/fuchsia/blob/master/LICENSE |
8f2099908fe693b4f7cdf2c2 | ow2-chameleon/fuchsia | examples/upnp-components/src/main/java/org/ow2/chameleon/fuchsia/upnp/clock/GetTimeAction.java | GetTimeAction.invoke | https://github.com/ow2-chameleon/fuchsia/blob/4e9318eadbdeb945e529789f573b45386e619bed/examples/upnp-components/src/main/java/org/ow2/chameleon/fuchsia/upnp/clock/GetTimeAction.java#L83-L88 | train | java | /* (non-Javadoc)
@see org.osgi.service.upnp.UPnPAction#invoke(java.util.Dictionary) | public Dictionary invoke(Dictionary args) throws Exception {
String value = time.getCurrentTime();
Hashtable result = new Hashtable();
result.put(RESULT_STATUS,value);
return result;
} | /* (non-Javadoc)
@see org.osgi.service.upnp.UPnPAction#invoke(java.util.Dictionary)
public Dictionary invoke(Dictionary args) throws Exception {
String value = time.getCurrentTime();
Hashtable result = new Hashtable();
result.put(RESULT_STATUS,value);
return result;
} | 60 | 83 | 193 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | 0c96f58d223ee090ec52b54e171337755c2bd7b09562617c37af09f312587ca9 | Apache-2.0 | permissive | https://github.com/ow2-chameleon/fuchsia/blob/master/LICENSE |
d35a37bfb16dae7ace5c04d3 | cchabanois/transmorph | src/main/java/net/entropysoft/transmorph/converters/beans/BeanPropertyTypeProvider.java | BeanPropertyTypeProvider.setPropertyDestinationType | https://github.com/cchabanois/transmorph/blob/118550f30b9680a84eab7496bd8b04118740dcec/src/main/java/net/entropysoft/transmorph/converters/beans/BeanPropertyTypeProvider.java#L40-L43 | train | java | set the property destination type for given property
@param propertyName
@param destinationType | public void setPropertyDestinationType(Class<?> clazz, String propertyName,
TypeReference<?> destinationType) {
propertiesDestinationTypes.put(new ClassProperty(clazz, propertyName), destinationType);
} | set the property destination type for given property
@param propertyName
@param destinationType
public void setPropertyDestinationType(Class<?> clazz, String propertyName,
TypeReference<?> destinationType) {
propertiesDestinationTypes.put(new ClassProperty(clazz, propertyName), destinationType);
} | 54 | 96 | 211 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | 78f8fc1a4fcf1bee39de8c10fa968cc1db33f45a178a6b201cfe938fb1e36aeb | Apache-2.0 | permissive | https://github.com/cchabanois/transmorph/blob/master/LICENSE |
4368b20f2cb637aa057a4aec | httpcache4j/httpcache4j | httpcache4j-storage-api/src/main/java/org/codehaus/httpcache4j/cache/Vary.java | Vary.matches | https://github.com/httpcache4j/httpcache4j/blob/9c07ebd63cd104a99eb9e771f760f14efa4fe0f6/httpcache4j-storage-api/src/main/java/org/codehaus/httpcache4j/cache/Vary.java#L97-L121 | train | java | todo: cleanup this | public boolean matches(final HTTPRequest request) {
if (varyHeaders.containsKey("ALL")) return false;
Headers headers = request.getAllHeaders();
for (Map.Entry<String, String> varyEntry : varyHeaders.entrySet()) {
if (request.getChallenge().isPresent() && varyEntry.getKey().equals(H... | todo: cleanup this
public boolean matches(final HTTPRequest request) {
if (varyHeaders.containsKey("ALL")) return false;
Headers headers = request.getAllHeaders();
for (Map.Entry<String, String> varyEntry : varyHeaders.entrySet()) {
if (request.getChallenge().isPresent() && varyEnt... | 217 | 18 | 1,209 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | dc79394510e4ddb755908c5e061ac6ea677e64a4d89c3dd67281eaff7c9e3077 | Apache-2.0 | permissive | https://github.com/httpcache4j/httpcache4j/blob/master/LICENSE.txt |
18fb07b2f22cd13d3d952d83 | cchabanois/transmorph | src/main/java/net/entropysoft/transmorph/converters/MultiConverter.java | MultiConverter.addConverter | https://github.com/cchabanois/transmorph/blob/118550f30b9680a84eab7496bd8b04118740dcec/src/main/java/net/entropysoft/transmorph/converters/MultiConverter.java#L60-L68 | train | java | add converter at given index. The index can be changed during conversion
if canReorder is true
@param index
@param converter | public void addConverter(int index, IConverter converter) {
converterList.add(index, converter);
if (converter instanceof IContainerConverter) {
IContainerConverter containerConverter = (IContainerConverter) converter;
if (containerConverter.getElementConverter() == null) {
containerConverter.setElem... | add converter at given index. The index can be changed during conversion
if canReorder is true
@param index
@param converter
public void addConverter(int index, IConverter converter) {
converterList.add(index, converter);
if (converter instanceof IContainerConverter) {
IContainerConverter containerConverter... | 101 | 125 | 366 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | 4465c4be156d564b39f74268979eb51bb65bb1428c0c3d460ca12faac68600de | Apache-2.0 | permissive | https://github.com/cchabanois/transmorph/blob/master/LICENSE |
08fddadcdabfbf9dae6f7aa0 | jbossws/jbossws-spi | src/main/java/org/jboss/wsf/spi/SPIProviderResolver.java | SPIProviderResolver.getInstance | https://github.com/jbossws/jbossws-spi/blob/845e66c18679ce3aaf76f849822110b4650a9d78/src/main/java/org/jboss/wsf/spi/SPIProviderResolver.java#L52-L56 | train | java | Get the SPIProviderResolver instance using the provided classloader for lookup
@param cl classloader to use for lookup
@return instance of this class | public static SPIProviderResolver getInstance(ClassLoader cl)
{
SPIProviderResolver resolver = (SPIProviderResolver)ServiceLoader.loadService(SPIProviderResolver.class.getName(), DEFAULT_SPI_PROVIDER_RESOLVER, cl);
return resolver;
} | Get the SPIProviderResolver instance using the provided classloader for lookup
@param cl classloader to use for lookup
@return instance of this class
public static SPIProviderResolver getInstance(ClassLoader cl)
{
SPIProviderResolver resolver = (SPIProviderResolver)ServiceLoader.loadService(SPIProviderRes... | 80 | 153 | 251 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | ea8c7c696ac61f43b26b0d2f528882a1c744300555559e5be08b6140585fdd98 | Apache-2.0 | permissive | https://github.com/jbossws/jbossws-spi/blob/main/LICENSE.txt |
a1d39704a095a94ea6ac2e73 | httpcache4j/httpcache4j | httpcache4j-api/src/main/java/org/codehaus/httpcache4j/util/DirectivesParser.java | DirectivesParser.createDirective | https://github.com/httpcache4j/httpcache4j/blob/9c07ebd63cd104a99eb9e771f760f14efa4fe0f6/httpcache4j-api/src/main/java/org/codehaus/httpcache4j/util/DirectivesParser.java#L95-L106 | train | java | Creates a header element.
Called from {@link #parseDirective}.
@return a header element representing the argument | private Directive createDirective(
final String name,
final String value,
final List<Parameter> params) {
if (isQuoted(value)) {
return new QuotedDirective(name, value, params);
}
if (HeaderConstants.LINK_HEADER.equals(name)) {
return n... | Creates a header element.
Called from {@link #parseDirective}.
@return a header element representing the argument
private Directive createDirective(
final String name,
final String value,
final List<Parameter> params) {
if (isQuoted(value)) {
return new QuotedDi... | 104 | 114 | 419 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | bf77d8bba4ceee6886b91a937b36379ec0900440fe0c0518a7e42d794ced85bd | Apache-2.0 | permissive | https://github.com/httpcache4j/httpcache4j/blob/master/LICENSE.txt |
a6bd22924fce342c75b45f88 | httpcache4j/httpcache4j | httpcache4j-api/src/main/java/org/codehaus/httpcache4j/util/DirectivesParser.java | DirectivesParser.createParameter | https://github.com/httpcache4j/httpcache4j/blob/9c07ebd63cd104a99eb9e771f760f14efa4fe0f6/httpcache4j-api/src/main/java/org/codehaus/httpcache4j/util/DirectivesParser.java#L256-L261 | train | java | Creates a Parameter
@param name the name
@param value the value, or <code>null</code>
@return a name-value pair representing the arguments | static Parameter createParameter(final String name, final String value) {
if (value != null && isQuoted(value)) {
return new QuotedParameter(name, value);
}
return new Parameter(name, value);
} | Creates a Parameter
@param name the name
@param value the value, or <code>null</code>
@return a name-value pair representing the arguments
static Parameter createParameter(final String name, final String value) {
if (value != null && isQuoted(value)) {
return new QuotedParameter(name, value);
... | 79 | 140 | 233 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | 7b6fdb26d7681aeea0b14177957bc364ad6a8bb9ea74d0a0f620c3e2ad9de4ba | Apache-2.0 | permissive | https://github.com/httpcache4j/httpcache4j/blob/master/LICENSE.txt |
29add73eff991cc8e872a8e6 | Canadensys/canadensys-core | src/main/java/net/canadensys/utils/LangUtils.java | LangUtils.getClassAnnotationValue | https://github.com/Canadensys/canadensys-core/blob/5e13569f7c0f4cdc7080da72643ff61123ad76fd/src/main/java/net/canadensys/utils/LangUtils.java#L19-L28 | train | java | Get the value of a Annotation in a class declaration.
@param classType
@param annotationType
@param attributeName
@return the value of the annotation as String or null if something goes wrong | public static <T, A extends Annotation> String getClassAnnotationValue(Class<T> classType, Class<A> annotationType, String attributeName) {
String value = null;
Annotation annotation = classType.getAnnotation(annotationType);
if (annotation != null) {
try {
value = (String) annotation.annotationType().getM... | Get the value of a Annotation in a class declaration.
@param classType
@param annotationType
@param attributeName
@return the value of the annotation as String or null if something goes wrong
public static <T, A extends Annotation> String getClassAnnotationValue(Class<T> classType, Class<A> annotationType, String attr... | 130 | 191 | 412 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | 364c0796d11468535240e8ddd718f5e1196134e956df7b2a43aa1d0395a441f8 | MIT | permissive | https://github.com/Canadensys/canadensys-core/blob/master/LICENSE |
74f3ebce192f670a763dd8cd | tractionsoftware/gwt-traction | src/main/java/com/tractionsoftware/gwt/user/client/ui/impl/UTCDateBoxImplHtml5.java | UTCDateBoxImplHtml5.string2long | https://github.com/tractionsoftware/gwt-traction/blob/efc1423c619439763fb064b777b7235e9ce414a3/src/main/java/com/tractionsoftware/gwt/user/client/ui/impl/UTCDateBoxImplHtml5.java#L136-L145 | train | java | Parses the supplied text and converts it to a Long
corresponding to that midnight in UTC on the specified date.
@return null if it fails to parsing using the specified
DateTimeFormat | private Long string2long(String text, DateTimeFormat fmt) {
// null or "" returns null
if (text == null) return null;
text = text.trim();
if (text.length() == 0) return null;
Date date = fmt.parse(text);
return date != null ? UTCDateBox.date2utc(date) : ... | Parses the supplied text and converts it to a Long
corresponding to that midnight in UTC on the specified date.
@return null if it fails to parsing using the specified
DateTimeFormat
private Long string2long(String text, DateTimeFormat fmt) {
// null or "" returns null
if (text == null) retur... | 119 | 183 | 331 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | 034715ca060725cda56e059a69b72cd71c178824589c903e0d53b16e09822c3a | Apache-2.0 | permissive | https://github.com/tractionsoftware/gwt-traction/blob/master/LICENSE |
c13c02bf74378e591711dd02 | tractionsoftware/gwt-traction | src/main/java/com/tractionsoftware/gwt/user/client/ui/impl/UTCDateBoxImplHtml5.java | UTCDateBoxImplHtml5.long2string | https://github.com/tractionsoftware/gwt-traction/blob/efc1423c619439763fb064b777b7235e9ce414a3/src/main/java/com/tractionsoftware/gwt/user/client/ui/impl/UTCDateBoxImplHtml5.java#L152-L157 | train | java | Formats the supplied value using the specified DateTimeFormat.
@return "" if the value is null | private String long2string(Long value, DateTimeFormat fmt) {
// for html5 inputs, use "" for no value
if (value == null) return "";
Date date = UTCDateBox.utc2date(value);
return date != null ? fmt.format(date) : null;
} | Formats the supplied value using the specified DateTimeFormat.
@return "" if the value is null
private String long2string(Long value, DateTimeFormat fmt) {
// for html5 inputs, use "" for no value
if (value == null) return "";
Date date = UTCDateBox.utc2date(value);
return date != null... | 80 | 95 | 256 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | fe92e58a6d382a7e8ecc3b525ddf8194b1df362172ddf3f35e1ccdc6b2cd55c6 | Apache-2.0 | permissive | https://github.com/tractionsoftware/gwt-traction/blob/master/LICENSE |
99f18bd9b1da03c034387857 | mgormley/optimize | src/main/java/edu/jhu/hlt/optimize/SGDFobos.java | SGDFobos.init | https://github.com/mgormley/optimize/blob/3d1b93260b99febb8a5ecd9e8543c223e151a8d3/src/main/java/edu/jhu/hlt/optimize/SGDFobos.java#L71-L77 | train | java | Initializes all the parameters for optimization. | @Override
protected void init(DifferentiableBatchFunction function, IntDoubleVector point) {
super.init(function, point);
this.accumLr = new DoubleArrayList();
this.iterOfLastStep = new int[function.getNumDimensions()];
Arrays.fill(iterOfLastStep, -1);
} | Initializes all the parameters for optimization.
@Override
protected void init(DifferentiableBatchFunction function, IntDoubleVector point) {
super.init(function, point);
this.accumLr = new DoubleArrayList();
this.iterOfLastStep = new int[function.getNumDimensions()];
Arrays.fill(it... | 73 | 48 | 302 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | 6c2aceb1fef5587bceb866e68c6f9f20c25883daf6025f3c7576290633f93f38 | Apache-2.0 | permissive | https://github.com/mgormley/optimize/blob/master/LICENSE |
c172747f8649bf22d5897e4a | mgormley/optimize | src/main/java/edu/jhu/hlt/optimize/AdaGradComidL1.java | AdaGradComidL1.init | https://github.com/mgormley/optimize/blob/3d1b93260b99febb8a5ecd9e8543c223e151a8d3/src/main/java/edu/jhu/hlt/optimize/AdaGradComidL1.java#L75-L82 | train | java | Initializes all the parameters for optimization. | @Override
protected void init(DifferentiableBatchFunction function, IntDoubleVector point) {
super.init(function, point);
this.iterOfLastStep = new int[function.getNumDimensions()];
Arrays.fill(iterOfLastStep, -1);
this.gradSumSquares = new double[function.getNumDimensions()]... | Initializes all the parameters for optimization.
@Override
protected void init(DifferentiableBatchFunction function, IntDoubleVector point) {
super.init(function, point);
this.iterOfLastStep = new int[function.getNumDimensions()];
Arrays.fill(iterOfLastStep, -1);
this.gradSu... | 90 | 48 | 387 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | aaab022e3bbd848af097fb2e94f4837ab7934391b2e58120bc6d8f581f3cb364 | Apache-2.0 | permissive | https://github.com/mgormley/optimize/blob/master/LICENSE |
5a10b5eb7a30661cc3aa2ee4 | mgormley/optimize | src/main/java/edu/jhu/hlt/optimize/AdaGradComidL1.java | AdaGradComidL1.getLearningRate | https://github.com/mgormley/optimize/blob/3d1b93260b99febb8a5ecd9e8543c223e151a8d3/src/main/java/edu/jhu/hlt/optimize/AdaGradComidL1.java#L123-L137 | train | java | Gets the learning rate for the current iteration.
@param i The index of the current model parameter. | private double getLearningRate(int i) {
if (gradSumSquares[i] < 0) {
throw new RuntimeException("Gradient sum of squares entry is < 0: " + gradSumSquares[i]);
}
double learningRate = prm.eta / (prm.constantAddend + Math.sqrt(gradSumSquares[i]));
assert !Double.isNaN(learningR... | Gets the learning rate for the current iteration.
@param i The index of the current model parameter.
private double getLearningRate(int i) {
if (gradSumSquares[i] < 0) {
throw new RuntimeException("Gradient sum of squares entry is < 0: " + gradSumSquares[i]);
}
double learningRate =... | 184 | 100 | 683 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | 2e040a683b6dfd82e2f788f320fe552836a3b38987344f6776f61106b63f8f34 | Apache-2.0 | permissive | https://github.com/mgormley/optimize/blob/master/LICENSE |
41bd2b4819fdb0ccbba7ef8e | tractionsoftware/gwt-traction | src/main/java/com/tractionsoftware/gwt/user/client/util/RgbaColor.java | RgbaColor.from | https://github.com/tractionsoftware/gwt-traction/blob/efc1423c619439763fb064b777b7235e9ce414a3/src/main/java/com/tractionsoftware/gwt/user/client/util/RgbaColor.java#L81-L100 | train | java | Parses an RgbaColor from a hexadecimal, rgb, rgba, hsl, or hsla
value.
@return returns the parsed color | public static RgbaColor from(String color) {
if (color.startsWith("#")) {
return fromHex(color);
}
else if (color.startsWith("rgba")) {
return fromRgba(color);
}
else if (color.startsWith("rgb")) {
return fromRgb(color);
}
else ... | Parses an RgbaColor from a hexadecimal, rgb, rgba, hsl, or hsla
value.
@return returns the parsed color
public static RgbaColor from(String color) {
if (color.startsWith("#")) {
return fromHex(color);
}
else if (color.startsWith("rgba")) {
return fromRgba(color);
... | 145 | 104 | 555 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | ed76f2f69b475ee1b450c692ae208a73779922d15175508a63220978f2452262 | Apache-2.0 | permissive | https://github.com/tractionsoftware/gwt-traction/blob/master/LICENSE |
509e551c67d2cd37554853ea | tractionsoftware/gwt-traction | src/main/java/com/tractionsoftware/gwt/user/client/util/RgbaColor.java | RgbaColor.fromHex | https://github.com/tractionsoftware/gwt-traction/blob/efc1423c619439763fb064b777b7235e9ce414a3/src/main/java/com/tractionsoftware/gwt/user/client/util/RgbaColor.java#L107-L129 | train | java | Parses an RgbaColor from a hexadecimal value.
@return returns the parsed color | public static RgbaColor fromHex(String hex) {
if (hex.length() == 0 || hex.charAt(0) != '#') return getDefaultColor();
// #rgb
if (hex.length() == 4) {
return new RgbaColor(parseHex(hex, 1, 2),
parseHex(hex, 2, 3),
p... | Parses an RgbaColor from a hexadecimal value.
@return returns the parsed color
public static RgbaColor fromHex(String hex) {
if (hex.length() == 0 || hex.charAt(0) != '#') return getDefaultColor();
// #rgb
if (hex.length() == 4) {
return new RgbaColor(parseHex(hex, 1, 2),
... | 178 | 79 | 652 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | 303a5108a335cdaf85dce113215498a9c40286b3c172d7c5ad85dacd8cc514be | Apache-2.0 | permissive | https://github.com/tractionsoftware/gwt-traction/blob/master/LICENSE |
e94996fbd0c1efa9dccca5fb | tractionsoftware/gwt-traction | src/main/java/com/tractionsoftware/gwt/user/client/util/RgbaColor.java | RgbaColor.fromRgb | https://github.com/tractionsoftware/gwt-traction/blob/efc1423c619439763fb064b777b7235e9ce414a3/src/main/java/com/tractionsoftware/gwt/user/client/util/RgbaColor.java#L136-L148 | train | java | Parses an RgbaColor from an rgb value.
@return the parsed color | public static RgbaColor fromRgb(String rgb) {
if (rgb.length() == 0) return getDefaultColor();
String[] parts = getRgbParts(rgb).split(",");
if (parts.length == 3) {
return new RgbaColor(parseInt(parts[0]),
parseInt(parts[1]),
... | Parses an RgbaColor from an rgb value.
@return the parsed color
public static RgbaColor fromRgb(String rgb) {
if (rgb.length() == 0) return getDefaultColor();
String[] parts = getRgbParts(rgb).split(",");
if (parts.length == 3) {
return new RgbaColor(parseInt(parts[0]),
... | 101 | 64 | 429 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | c0b4c42b814fefac7259db4d2279c40ffc664b84141c136f9fbda7ca0c9c488e | Apache-2.0 | permissive | https://github.com/tractionsoftware/gwt-traction/blob/master/LICENSE |
34dc576e2a34e1d8f05497c1 | tractionsoftware/gwt-traction | src/main/java/com/tractionsoftware/gwt/user/client/util/RgbaColor.java | RgbaColor.fromRgba | https://github.com/tractionsoftware/gwt-traction/blob/efc1423c619439763fb064b777b7235e9ce414a3/src/main/java/com/tractionsoftware/gwt/user/client/util/RgbaColor.java#L155-L168 | train | java | Parses an RgbaColor from an rgba value.
@return the parsed color | public static RgbaColor fromRgba(String rgba) {
if (rgba.length() == 0) return getDefaultColor();
String[] parts = getRgbaParts(rgba).split(",");
if (parts.length == 4) {
return new RgbaColor(parseInt(parts[0]),
parseInt(parts[1]),
... | Parses an RgbaColor from an rgba value.
@return the parsed color
public static RgbaColor fromRgba(String rgba) {
if (rgba.length() == 0) return getDefaultColor();
String[] parts = getRgbaParts(rgba).split(",");
if (parts.length == 4) {
return new RgbaColor(parseInt(parts[0]),
... | 110 | 65 | 489 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | 579e0a0d070f6cee4e7068a7b931cbe1125cb54f6bfec41da5b5343d9de94231 | Apache-2.0 | permissive | https://github.com/tractionsoftware/gwt-traction/blob/master/LICENSE |
db25139d5c5b174cb0c1de99 | tractionsoftware/gwt-traction | src/main/java/com/tractionsoftware/gwt/user/client/util/RgbaColor.java | RgbaColor.fromHsl | https://github.com/tractionsoftware/gwt-traction/blob/efc1423c619439763fb064b777b7235e9ce414a3/src/main/java/com/tractionsoftware/gwt/user/client/util/RgbaColor.java#L176-L185 | train | java | Parses an RgbaColor from a CSS3 HSL value, e.g. hsl(25, 100%,
80%)
@return the parsed color | public static RgbaColor fromHsl(String hsl) {
String[] parts = getHslParts(hsl).split(",");
if (parts.length == 3) {
float[] HSL = new float[] { parseInt(parts[0]), parseInt(parts[1]), parseInt(parts[2]) };
return fromHsl(HSL);
}
else {
return getDefau... | Parses an RgbaColor from a CSS3 HSL value, e.g. hsl(25, 100%,
80%)
@return the parsed color
public static RgbaColor fromHsl(String hsl) {
String[] parts = getHslParts(hsl).split(",");
if (parts.length == 3) {
float[] HSL = new float[] { parseInt(parts[0]), parseInt(parts[1]), parseInt(part... | 119 | 92 | 346 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | 93a20ae11b8ad121fdaf481a4c48db38fce75571c7d4bf06605acb98e3912d2b | Apache-2.0 | permissive | https://github.com/tractionsoftware/gwt-traction/blob/master/LICENSE |
54d4ac8d1d50c27115a3d3ad | tractionsoftware/gwt-traction | src/main/java/com/tractionsoftware/gwt/user/client/util/RgbaColor.java | RgbaColor.fromHsla | https://github.com/tractionsoftware/gwt-traction/blob/efc1423c619439763fb064b777b7235e9ce414a3/src/main/java/com/tractionsoftware/gwt/user/client/util/RgbaColor.java#L193-L206 | train | java | Parses an RgbaColor from a CSS3 HSLA value, e.g. hsla(25, 100%,
80%, 0.5)
@return returns the parsed color | public static RgbaColor fromHsla(String hsl) {
String[] parts = getHslaParts(hsl).split(",");
if (parts.length == 4) {
float[] HSL = new float[] { parseInt(parts[0]), parseInt(parts[1]), parseInt(parts[2]) };
RgbaColor ret = fromHsl(HSL);
if (ret != null) {
... | Parses an RgbaColor from a CSS3 HSLA value, e.g. hsla(25, 100%,
80%, 0.5)
@return returns the parsed color
public static RgbaColor fromHsla(String hsl) {
String[] parts = getHslaParts(hsl).split(",");
if (parts.length == 4) {
float[] HSL = new float[] { parseInt(parts[0]), parseInt(parts[1... | 153 | 107 | 472 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | 4c8a483ef8634080b4715b9011af0f62d355ddec4f90157cc8a584dd544a45ed | Apache-2.0 | permissive | https://github.com/tractionsoftware/gwt-traction/blob/master/LICENSE |
6b4d6985713affa1bfd5583f | tractionsoftware/gwt-traction | src/main/java/com/tractionsoftware/gwt/user/client/util/RgbaColor.java | RgbaColor.withHsl | https://github.com/tractionsoftware/gwt-traction/blob/efc1423c619439763fb064b777b7235e9ce414a3/src/main/java/com/tractionsoftware/gwt/user/client/util/RgbaColor.java#L389-L393 | train | java | Returns a new color with a new value of the specified HSL
component. | private RgbaColor withHsl(int index, float value) {
float[] HSL = convertToHsl();
HSL[index] = value;
return RgbaColor.fromHsl(HSL);
} | Returns a new color with a new value of the specified HSL
component.
private RgbaColor withHsl(int index, float value) {
float[] HSL = convertToHsl();
HSL[index] = value;
return RgbaColor.fromHsl(HSL);
} | 62 | 68 | 162 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | efbcbe11513dca4a5ffe60507f9957d30263ab066516169a43e33ffaa2eab947 | Apache-2.0 | permissive | https://github.com/tractionsoftware/gwt-traction/blob/master/LICENSE |
0587c0747bc558a73d78b168 | tractionsoftware/gwt-traction | src/main/java/com/tractionsoftware/gwt/user/client/util/RgbaColor.java | RgbaColor.adjustHue | https://github.com/tractionsoftware/gwt-traction/blob/efc1423c619439763fb064b777b7235e9ce414a3/src/main/java/com/tractionsoftware/gwt/user/client/util/RgbaColor.java#L429-L433 | train | java | Returns a new color that has the hue adjusted by the specified
amount. | public RgbaColor adjustHue(float degrees) {
float[] HSL = convertToHsl();
HSL[0] = hueCheck(HSL[0] + degrees); // ensure [0-360)
return RgbaColor.fromHsl(HSL);
} | Returns a new color that has the hue adjusted by the specified
amount.
public RgbaColor adjustHue(float degrees) {
float[] HSL = convertToHsl();
HSL[0] = hueCheck(HSL[0] + degrees); // ensure [0-360)
return RgbaColor.fromHsl(HSL);
} | 74 | 70 | 189 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | 194c95f905e3888c7327a13b4d156a67d5f5194b20fff1ac056803ba44fb4c39 | Apache-2.0 | permissive | https://github.com/tractionsoftware/gwt-traction/blob/master/LICENSE |
7ce2e0b064cfb149866ab5af | tractionsoftware/gwt-traction | src/main/java/com/tractionsoftware/gwt/user/client/util/RgbaColor.java | RgbaColor.opacify | https://github.com/tractionsoftware/gwt-traction/blob/efc1423c619439763fb064b777b7235e9ce414a3/src/main/java/com/tractionsoftware/gwt/user/client/util/RgbaColor.java#L439-L441 | train | java | Returns a new color that has the alpha adjusted by the
specified amount. | public RgbaColor opacify(float amount) {
return new RgbaColor(r, g, b, alphaCheck(a + amount));
} | Returns a new color that has the alpha adjusted by the
specified amount.
public RgbaColor opacify(float amount) {
return new RgbaColor(r, g, b, alphaCheck(a + amount));
} | 46 | 72 | 109 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | 4d39a987b53f5af5bcc345d5c2abe53dccea219a2f8a13d9f8981eda21ed69f3 | Apache-2.0 | permissive | https://github.com/tractionsoftware/gwt-traction/blob/master/LICENSE |
62861eb32cb5ef46cf87b857 | tractionsoftware/gwt-traction | src/main/java/com/tractionsoftware/gwt/user/client/util/RgbaColor.java | RgbaColor.getPaletteVaryLightness | https://github.com/tractionsoftware/gwt-traction/blob/efc1423c619439763fb064b777b7235e9ce414a3/src/main/java/com/tractionsoftware/gwt/user/client/util/RgbaColor.java#L494-L503 | train | java | palettes | public RgbaColor[] getPaletteVaryLightness(int count) {
// a max of 80 and an offset of 10 keeps us away from the
// edges
float[] spread = getSpreadInRange(l(), count, 80, 10);
RgbaColor[] ret = new RgbaColor[count];
for (int i = 0; i < count; i++) {
ret[i] = withLig... | palettes
public RgbaColor[] getPaletteVaryLightness(int count) {
// a max of 80 and an offset of 10 keeps us away from the
// edges
float[] spread = getSpreadInRange(l(), count, 80, 10);
RgbaColor[] ret = new RgbaColor[count];
for (int i = 0; i < count; i++) {
ret[i]... | 108 | 8 | 374 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | 9fd188a26392eebcbc6ea51c0b18bc596b4225da74931b6ca962f8abcbf60a2c | Apache-2.0 | permissive | https://github.com/tractionsoftware/gwt-traction/blob/master/LICENSE |
e4beb60c167ae68fc83b44f2 | tractionsoftware/gwt-traction | src/main/java/com/tractionsoftware/gwt/user/client/util/RgbaColor.java | RgbaColor.getSpreadInRange | https://github.com/tractionsoftware/gwt-traction/blob/efc1423c619439763fb064b777b7235e9ce414a3/src/main/java/com/tractionsoftware/gwt/user/client/util/RgbaColor.java#L509-L526 | train | java | Returns a spread of integers in a range [0,max) that includes
count. The spread is sorted from largest to smallest. | protected static final float[] getSpreadInRange(float member, int count, int max, int offset) {
// to find the spread, we first find the min that is a
// multiple of max/count away from the member
int interval = max / count;
float min = (member + offset) % interval;
if (min == ... | Returns a spread of integers in a range [0,max) that includes
count. The spread is sorted from largest to smallest.
protected static final float[] getSpreadInRange(float member, int count, int max, int offset) {
// to find the spread, we first find the min that is a
// multiple of max/count away from t... | 160 | 115 | 556 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | 475d70d76bd52daf4e3e24f7a7d551b85ab8dac004f72b1059507a1518ea87f4 | Apache-2.0 | permissive | https://github.com/tractionsoftware/gwt-traction/blob/master/LICENSE |
03e7c25a1f2dad93083b8f80 | tractionsoftware/gwt-traction | src/main/java/com/tractionsoftware/gwt/user/client/util/RgbaColor.java | RgbaColor.adjustSL | https://github.com/tractionsoftware/gwt-traction/blob/efc1423c619439763fb064b777b7235e9ce414a3/src/main/java/com/tractionsoftware/gwt/user/client/util/RgbaColor.java#L577-L597 | train | java | Takes two adjustments and applies the one that conforms to the
range. If the first modification moves the value out of range
[0-100], the second modification will be applied <b>and clipped
if necessary</b>.
@param index
The index in HSL
@param first
The first modification that will be applied and
bounds checked
@param... | private RgbaColor adjustSL(int index, float first, float second) {
float[] HSL = convertToHsl();
float firstvalue = HSL[index] + first;
// check if it's in bounds
if (slCheck(firstvalue) == firstvalue) {
// it is, keep this transform
HSL[index] = firstvalue;
... | Takes two adjustments and applies the one that conforms to the
range. If the first modification moves the value out of range
[0-100], the second modification will be applied <b>and clipped
if necessary</b>.
@param index
The index in HSL
@param first
The first modification that will be applied and
bounds checked
@param... | 255 | 361 | 708 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | 14ce467331e1617779f2c7495b061c0f40b68bb6b4cf03435d712d142d5fe24c | Apache-2.0 | permissive | https://github.com/tractionsoftware/gwt-traction/blob/master/LICENSE |
b6808a1f8e5850c00109776d | tractionsoftware/gwt-traction | src/main/java/com/tractionsoftware/gwt/user/client/util/RgbaColor.java | RgbaColor.convertToHsl | https://github.com/tractionsoftware/gwt-traction/blob/efc1423c619439763fb064b777b7235e9ce414a3/src/main/java/com/tractionsoftware/gwt/user/client/util/RgbaColor.java#L613-L653 | train | java | Returns a triple of hue [0-360), saturation [0-100], and
lightness [0-100]. These are kept as float[] so that for any
RgbaColor color,
color.equals(RgbaColor.fromHsl(color.convertToHsl())) is true.
<p>
<i>Implementation based on <a
href="http://en.wikipedia.org/wiki/HSL_and_HSV"
>wikipedia</a></i> | public float[] convertToHsl() {
float H, S, L;
// first normalize [0,1]
float R = r / 255f;
float G = g / 255f;
float B = b / 255f;
// compute min and max
float M = max(R, G, B);
float m = min(R, G, B);
L = (M + m) / 2f;
if (M == m) {
... | Returns a triple of hue [0-360), saturation [0-100], and
lightness [0-100]. These are kept as float[] so that for any
RgbaColor color,
color.equals(RgbaColor.fromHsl(color.convertToHsl())) is true.
<p>
<i>Implementation based on <a
href="http://en.wikipedia.org/wiki/HSL_and_HSV"
>wikipedia</a></i>
public float[] conv... | 371 | 299 | 890 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | 190e82715caa2adac733886e175d0ad164366292e463bdc19343b37b7d46c834 | Apache-2.0 | permissive | https://github.com/tractionsoftware/gwt-traction/blob/master/LICENSE |
e5d6b3281875276279225344 | tractionsoftware/gwt-traction | src/main/java/com/tractionsoftware/gwt/user/client/util/RgbaColor.java | RgbaColor.fromHsl | https://github.com/tractionsoftware/gwt-traction/blob/efc1423c619439763fb064b777b7235e9ce414a3/src/main/java/com/tractionsoftware/gwt/user/client/util/RgbaColor.java#L673-L700 | train | java | Creates a new RgbaColor from the specified HSL components.
<p>
<i>Implementation based on <a
href="http://en.wikipedia.org/wiki/HSL_and_HSV">wikipedia</a>
and <a
href="http://www.w3.org/TR/css3-color/#hsl-color">w3c</a></i>
@param H
Hue [0,360)
@param S
Saturation [0,100]
@param L
Lightness [0,100] | public static RgbaColor fromHsl(float H, float S, float L) {
// convert to [0-1]
H /= 360f;
S /= 100f;
L /= 100f;
float R, G, B;
if (S == 0) {
// grey
R = G = B = L;
}
else {
float m2 = L <= 0.5 ? L * (S + 1f) : L + S... | Creates a new RgbaColor from the specified HSL components.
<p>
<i>Implementation based on <a
href="http://en.wikipedia.org/wiki/HSL_and_HSV">wikipedia</a>
and <a
href="http://www.w3.org/TR/css3-color/#hsl-color">w3c</a></i>
@param H
Hue [0,360)
@param S
Saturation [0,100]
@param L
Lightness [0,100]
public static Rgb... | 353 | 301 | 701 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | 677926ea05e314d26d5429cdf06db57fabf0dba065914a82ecf5bed3fc48440c | Apache-2.0 | permissive | https://github.com/tractionsoftware/gwt-traction/blob/master/LICENSE |
4b13ca10a997991cebd3858f | tractionsoftware/gwt-traction | src/main/java/com/tractionsoftware/gwt/user/client/util/RgbaColor.java | RgbaColor.hue2rgb | https://github.com/tractionsoftware/gwt-traction/blob/efc1423c619439763fb064b777b7235e9ce414a3/src/main/java/com/tractionsoftware/gwt/user/client/util/RgbaColor.java#L705-L712 | train | java | See http://www.w3.org/TR/css3-color/#hsl-color | private static float hue2rgb(float m1, float m2, float h) {
if (h < 0) h += 1;
if (h > 1) h -= 1;
if (h * 6f < 1) return m1 + (m2 - m1) * 6f * h;
if (h * 2f < 1) return m2;
if (h * 3f < 2) return m1 + (m2 - m1) * (2 / 3f - h) * 6f;
return m1;
} | See http://www.w3.org/TR/css3-color/#hsl-color
private static float hue2rgb(float m1, float m2, float h) {
if (h < 0) h += 1;
if (h > 1) h -= 1;
if (h * 6f < 1) return m1 + (m2 - m1) * 6f * h;
if (h * 2f < 1) return m2;
if (h * 3f < 2) return m1 + (m2 - m1) * (2 / 3f - h) * 6f;
... | 151 | 46 | 296 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | 2ea850895ac8c0d7e43b2751260e65db6bd6253ca5772c533bdc7aef314f7c91 | Apache-2.0 | permissive | https://github.com/tractionsoftware/gwt-traction/blob/master/LICENSE |
1b6764d973512e7fe237ed8a | tractionsoftware/gwt-traction | src/main/java/com/tractionsoftware/gwt/user/client/util/RgbaColor.java | RgbaColor.toHex | https://github.com/tractionsoftware/gwt-traction/blob/efc1423c619439763fb064b777b7235e9ce414a3/src/main/java/com/tractionsoftware/gwt/user/client/util/RgbaColor.java#L720-L725 | train | java | Returns the color in hexadecimal format (#rrggbb) | public String toHex() {
String rs = hexpad(Integer.toHexString(r));
String gs = hexpad(Integer.toHexString(g));
String bs = hexpad(Integer.toHexString(b));
return "#" + rs + gs + bs;
} | Returns the color in hexadecimal format (#rrggbb)
public String toHex() {
String rs = hexpad(Integer.toHexString(r));
String gs = hexpad(Integer.toHexString(g));
String bs = hexpad(Integer.toHexString(b));
return "#" + rs + gs + bs;
} | 62 | 49 | 220 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | d550dbc7a20e63ae7b47d0f540dccdd30229b87bfb67f2801e70a163428211cf | Apache-2.0 | permissive | https://github.com/tractionsoftware/gwt-traction/blob/master/LICENSE |
73714ed15778b95cd1433d40 | tractionsoftware/gwt-traction | src/main/java/com/tractionsoftware/gwt/user/client/util/RgbaColor.java | RgbaColor.toHsl | https://github.com/tractionsoftware/gwt-traction/blob/efc1423c619439763fb064b777b7235e9ce414a3/src/main/java/com/tractionsoftware/gwt/user/client/util/RgbaColor.java#L748-L751 | train | java | Returns the CSS3 HSL representation, e.g. hsl(120, 100%, 50%) | public String toHsl() {
float[] HSL = convertToHsl();
return "hsl(" + Math.round(HSL[0]) + "," + Math.round(HSL[1]) + "%," + Math.round(HSL[2]) + "%)";
} | Returns the CSS3 HSL representation, e.g. hsl(120, 100%, 50%)
public String toHsl() {
float[] HSL = convertToHsl();
return "hsl(" + Math.round(HSL[0]) + "," + Math.round(HSL[1]) + "%," + Math.round(HSL[2]) + "%)";
} | 80 | 61 | 173 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | 900b31f67ed081cd527f598019d7771fa82565e322503a7630cb4dd8cdd51650 | Apache-2.0 | permissive | https://github.com/tractionsoftware/gwt-traction/blob/master/LICENSE |
e9b5780128b3fe6ea4f5cba4 | tractionsoftware/gwt-traction | src/main/java/com/tractionsoftware/gwt/user/client/util/RgbaColor.java | RgbaColor.toHsla | https://github.com/tractionsoftware/gwt-traction/blob/efc1423c619439763fb064b777b7235e9ce414a3/src/main/java/com/tractionsoftware/gwt/user/client/util/RgbaColor.java#L757-L760 | train | java | Returns the CSS3 HSLA representation, e.g. hsl(120, 100%, 50%,
0.5) | public String toHsla() {
float[] HSL = convertToHsl();
return "hsl(" + Math.round(HSL[0]) + "," + Math.round(HSL[1]) + "%," + Math.round(HSL[2]) + "%," + a + ")";
} | Returns the CSS3 HSLA representation, e.g. hsl(120, 100%, 50%,
0.5)
public String toHsla() {
float[] HSL = convertToHsl();
return "hsl(" + Math.round(HSL[0]) + "," + Math.round(HSL[1]) + "%," + Math.round(HSL[2]) + "%," + a + ")";
} | 90 | 67 | 184 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | 9fd4397ab7c056b121660ce506d842c38793e4de4d9668869387a97dbe52a05b | Apache-2.0 | permissive | https://github.com/tractionsoftware/gwt-traction/blob/master/LICENSE |
e9ad456a34a353ffb38191a8 | tractionsoftware/gwt-traction | src/main/java/com/tractionsoftware/gwt/user/client/util/RgbaColor.java | RgbaColor.max | https://github.com/tractionsoftware/gwt-traction/blob/efc1423c619439763fb064b777b7235e9ce414a3/src/main/java/com/tractionsoftware/gwt/user/client/util/RgbaColor.java#L826-L845 | train | java | misc utility methods | private float max(float x, float y, float z) {
if (x > y) {
// not y
if (x > z) {
return x;
}
else {
return z;
}
}
else {
// not x
if (y > z) {
return y;
... | misc utility methods
private float max(float x, float y, float z) {
if (x > y) {
// not y
if (x > z) {
return x;
}
else {
return z;
}
}
else {
// not x
if (y > z) {
... | 90 | 20 | 398 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | 4826430f6212afde45ba7cd411463c453c56cd5f7fa4e7a80fb068ecdbe5b026 | Apache-2.0 | permissive | https://github.com/tractionsoftware/gwt-traction/blob/master/LICENSE |
837dd0fa03e37f3eb9a15483 | cchabanois/transmorph | src/main/java/net/entropysoft/transmorph/converters/ObjectToObjectUsingConstructor.java | ObjectToObjectUsingConstructor.getCompatibleConstructor | https://github.com/cchabanois/transmorph/blob/118550f30b9680a84eab7496bd8b04118740dcec/src/main/java/net/entropysoft/transmorph/converters/ObjectToObjectUsingConstructor.java#L94-L110 | train | java | Get a compatible constructor
@param type
Class to look for constructor in
@param argumentType
Argument type for constructor
@return the compatible constructor or null if none found | public Constructor<?> getCompatibleConstructor(Class<?> type,
Class<?> argumentType) {
try {
return type.getConstructor(new Class[] { argumentType });
} catch (Exception e) {
// get public classes and interfaces
Class<?>[] types = type.getClasses();
for (int i = 0; i < types.length; i++) {
... | Get a compatible constructor
@param type
Class to look for constructor in
@param argumentType
Argument type for constructor
@return the compatible constructor or null if none found
public Constructor<?> getCompatibleConstructor(Class<?> type,
Class<?> argumentType) {
try {
return type.getConstructor(new Cl... | 152 | 181 | 457 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | f70aeea8d2f3a5dfd16fdab73e066fab60692b5585a29f170ae3cc3c9390b3a6 | Apache-2.0 | permissive | https://github.com/cchabanois/transmorph/blob/master/LICENSE |
4773eb0dc6fa43cab79a5619 | cchabanois/transmorph | src/main/java/net/entropysoft/transmorph/Transmorph.java | Transmorph.convert | https://github.com/cchabanois/transmorph/blob/118550f30b9680a84eab7496bd8b04118740dcec/src/main/java/net/entropysoft/transmorph/Transmorph.java#L77-L80 | train | java | Convert an object to another object with given type
@param <T>
@param source
object to convert
@param typeReference
reference to {@link java.lang.reflect.Type}
@return the converted object if conversion failed
@throws ConverterException | public <T> T convert(Object source, TypeReference<T> typeReference)
throws ConverterException {
return (T) convert(new ConversionContext(), source, typeReference);
} | Convert an object to another object with given type
@param <T>
@param source
object to convert
@param typeReference
reference to {@link java.lang.reflect.Type}
@return the converted object if conversion failed
@throws ConverterException
public <T> T convert(Object source, TypeReference<T> typeReference)
throws Co... | 85 | 237 | 174 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | 139c633c576fd3c635defa4f00dfd5d7bc854270d6c17f54e5508adba8362f78 | Apache-2.0 | permissive | https://github.com/cchabanois/transmorph/blob/master/LICENSE |
0b8488de9cbff29fc62c9f08 | cchabanois/transmorph | src/main/java/net/entropysoft/transmorph/Transmorph.java | Transmorph.convert | https://github.com/cchabanois/transmorph/blob/118550f30b9680a84eab7496bd8b04118740dcec/src/main/java/net/entropysoft/transmorph/Transmorph.java#L104-L107 | train | java | Convert an object to another object with given class
@param <T>
@param source
object to convert
@param clazz
destination class
@return the converted object
@throws ConverterException
if conversion failed | public <T> T convert(Object source, Class<T> clazz)
throws ConverterException {
return (T) convert(new ConversionContext(), source, clazz);
} | Convert an object to another object with given class
@param <T>
@param source
object to convert
@param clazz
destination class
@return the converted object
@throws ConverterException
if conversion failed
public <T> T convert(Object source, Class<T> clazz)
throws ConverterException {
return (T) convert(new Conv... | 76 | 204 | 150 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | 0b5e38ed44ec60f8bf4836d097b21765f8e3059c51ec2079f263fcf25bc267b4 | Apache-2.0 | permissive | https://github.com/cchabanois/transmorph/blob/master/LICENSE |
cbd9671ebd4c4a6ac3949635 | cchabanois/transmorph | src/main/java/net/entropysoft/transmorph/Transmorph.java | Transmorph.convert | https://github.com/cchabanois/transmorph/blob/118550f30b9680a84eab7496bd8b04118740dcec/src/main/java/net/entropysoft/transmorph/Transmorph.java#L122-L125 | train | java | Convert an object to another object with given class
@param <T>
@param context
@param source
object to convert
@param clazz
destination class
@return the converted object
@throws ConverterException
if conversion failed | public <T> T convert(ConversionContext context, Object source,
Class<T> clazz) throws ConverterException {
return (T) convert(context, source, TypeReference.get(clazz));
} | Convert an object to another object with given class
@param <T>
@param context
@param source
object to convert
@param clazz
destination class
@return the converted object
@throws ConverterException
if conversion failed
public <T> T convert(ConversionContext context, Object source,
Class<T> clazz) throws Converter... | 85 | 219 | 180 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | 0279a60e8ba578cd117931b316074a8420dcfc26ef7ad6e4d8f926a60a394e11 | Apache-2.0 | permissive | https://github.com/cchabanois/transmorph/blob/master/LICENSE |
6aeca42ea701f849d8facd1d | cchabanois/transmorph | src/main/java/net/entropysoft/transmorph/Transmorph.java | Transmorph.convert | https://github.com/cchabanois/transmorph/blob/118550f30b9680a84eab7496bd8b04118740dcec/src/main/java/net/entropysoft/transmorph/Transmorph.java#L145-L162 | train | java | Convert an object to another object given a parameterized type signature
@param context
@param destinationType
the destination type
@param source
the source object
@return the converted object
@throws ConverterException
if conversion failed | public <T> T convert(ConversionContext context, Object source,
TypeReference<T> destinationType) throws ConverterException {
try {
return (T) multiConverter.convert(context, source, destinationType);
} catch (ConverterException e) {
throw e;
} catch (Exception e) {
// There is a problem with on... | Convert an object to another object given a parameterized type signature
@param context
@param destinationType
the destination type
@param source
the source object
@return the converted object
@throws ConverterException
if conversion failed
public <T> T convert(ConversionContext context, Object source,
TypeRefer... | 216 | 242 | 724 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | a5c79a1de7032e0bf4a0de5bec26e7581538757ff534f368d62e3d60d8a8affc | Apache-2.0 | permissive | https://github.com/cchabanois/transmorph/blob/master/LICENSE |
1d905396d749d5c761baddfb | mgormley/optimize | src/main/java/edu/jhu/hlt/util/Utilities.java | Utilities.logSubtractExact | https://github.com/mgormley/optimize/blob/3d1b93260b99febb8a5ecd9e8543c223e151a8d3/src/main/java/edu/jhu/hlt/util/Utilities.java#L222-L236 | train | java | Subtracts two probabilities that are stored as log probabilities.
Note that x >= y.
@param x log(p)
@param y log(q)
@return log(p - q) = log(exp(p) + exp(q))
@throws IllegalStateException if x < y | public static double logSubtractExact(double x, double y) {
if (x < y) {
throw new IllegalStateException("x must be >= y. x=" + x + " y=" + y);
}
// p = 0 or q = 0, where x = log(p), y = log(q)
if (Double.NEGATIVE_INFINITY == y) {
return x;
} else... | Subtracts two probabilities that are stored as log probabilities.
Note that x >= y.
@param x log(p)
@param y log(q)
@return log(p - q) = log(exp(p) + exp(q))
@throws IllegalStateException if x < y
public static double logSubtractExact(double x, double y) {
if (x < y) {
throw new IllegalStateExcept... | 184 | 197 | 468 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | eda9c3516ba654b884dc38b0a2c446b84ea01364120f34cc2219b34a85f8cdf1 | Apache-2.0 | permissive | https://github.com/mgormley/optimize/blob/master/LICENSE |
85e1efd6cd7742d6a75eabd0 | mgormley/optimize | src/main/java/edu/jhu/hlt/util/Utilities.java | Utilities.sampleWithoutReplacement | https://github.com/mgormley/optimize/blob/3d1b93260b99febb8a5ecd9e8543c223e151a8d3/src/main/java/edu/jhu/hlt/util/Utilities.java#L419-L434 | train | java | Samples a set of m integers without replacement from the range [0,...,n-1].
@param m The number of integers to return.
@param n The number of integers from which to sample.
@return The sample as an unsorted integer array. | public static int[] sampleWithoutReplacement(int m, int n) {
// This implements a modified form of the genshuf() function from
// Programming Pearls pg. 129.
// TODO: Design a faster method that only generates min(m, n-m) integers.
int[] array = getIndexArray(n);
... | Samples a set of m integers without replacement from the range [0,...,n-1].
@param m The number of integers to return.
@param n The number of integers from which to sample.
@return The sample as an unsorted integer array.
public static int[] sampleWithoutReplacement(int m, int n) {
// This implements a modifie... | 191 | 221 | 583 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | 18d2545c1ac3172935d0908fc569f795547c395d42c995a8348688dcb8cffb89 | Apache-2.0 | permissive | https://github.com/mgormley/optimize/blob/master/LICENSE |
e98d2961ce2041a7f90ad9d7 | mgormley/optimize | src/main/java/edu/jhu/hlt/util/Utilities.java | Utilities.compare | https://github.com/mgormley/optimize/blob/3d1b93260b99febb8a5ecd9e8543c223e151a8d3/src/main/java/edu/jhu/hlt/util/Utilities.java#L483-L488 | train | java | Compares two double values up to some delta.
@param a
@param b
@param delta
@return The value 0 if a equals b, a value greater than 0 if if a > b, and a value less than 0 if a < b. | public static int compare(double a, double b, double delta) {
if (equals(a, b, delta)) {
return 0;
}
return Double.compare(a, b);
} | Compares two double values up to some delta.
@param a
@param b
@param delta
@return The value 0 if a equals b, a value greater than 0 if if a > b, and a value less than 0 if a < b.
public static int compare(double a, double b, double delta) {
if (equals(a, b, delta)) {
return 0;
}
... | 95 | 181 | 171 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | 534628ae2542709c28e02d5cc396e5a13de8fae22174863626351227a2122262 | Apache-2.0 | permissive | https://github.com/mgormley/optimize/blob/master/LICENSE |
5d5a041601c39f187767f529 | mgormley/optimize | src/main/java/edu/jhu/hlt/util/Utilities.java | Utilities.getLongIndexArray | https://github.com/mgormley/optimize/blob/3d1b93260b99febb8a5ecd9e8543c223e151a8d3/src/main/java/edu/jhu/hlt/util/Utilities.java#L559-L565 | train | java | Gets an array where array[i] = i.
@param length The length of the array.
@return The new index array. | public static long[] getLongIndexArray(int length) {
long[] index = new long[length];
for (int i=0; i<index.length; i++) {
index[i] = i;
}
return index;
} | Gets an array where array[i] = i.
@param length The length of the array.
@return The new index array.
public static long[] getLongIndexArray(int length) {
long[] index = new long[length];
for (int i=0; i<index.length; i++) {
index[i] = i;
}
return index;
} | 76 | 101 | 202 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | a8e6dc2a2027dbb88bcaedafb36facbcf269929acd4c490d5f332cb4af038e4c | Apache-2.0 | permissive | https://github.com/mgormley/optimize/blob/master/LICENSE |
449d64cbade1209b2cd65de5 | mgormley/optimize | src/main/java/edu/jhu/hlt/util/Utilities.java | Utilities.fill | https://github.com/mgormley/optimize/blob/3d1b93260b99febb8a5ecd9e8543c223e151a8d3/src/main/java/edu/jhu/hlt/util/Utilities.java#L715-L726 | train | java | Faster version of Arrays.fill(). That standard version does NOT use
memset, and only iterates over the array filling each value. This method
works out to be much faster and seems to be using memset as appropriate. | public static void fill(final Object[] array, final Object value) {
// final int n = array.length;
// if (n > 0) {
// array[0] = value;
// }
// for (int i = 1; i < n; i += i) {
// System.arraycopy(array, 0, array, i, ((n - ... | Faster version of Arrays.fill(). That standard version does NOT use
memset, and only iterates over the array filling each value. This method
works out to be much faster and seems to be using memset as appropriate.
public static void fill(final Object[] array, final Object value) {
// final int n = array... | 177 | 213 | 462 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | e1ce3acf7b3a06987bc81cc38c80975fa83e1996dbf9b829e14f20ed7492cf66 | Apache-2.0 | permissive | https://github.com/mgormley/optimize/blob/master/LICENSE |
cfefabcbc4d3d5674362bacc | cchabanois/transmorph | src/main/java/net/entropysoft/transmorph/signature/parser/ClassFileTypeSignatureParser.java | ClassFileTypeSignatureParser.parseTypeArg | https://github.com/cchabanois/transmorph/blob/118550f30b9680a84eab7496bd8b04118740dcec/src/main/java/net/entropysoft/transmorph/signature/parser/ClassFileTypeSignatureParser.java#L207-L225 | train | java | "* | ( + | - )? FieldTypeSignature"
@return | private TypeArgSignature parseTypeArg() {
int ch = peekChar();
switch (ch) {
case '*':
return new TypeArgSignature(
(char) nextChar(TypeArgSignature.UNBOUNDED_WILDCARD), null);
case '+':
return new TypeArgSignature(
(char) nextChar(TypeArgSignature.UPPERBOUND_WILDCARD),
parseFieldT... | "* | ( + | - )? FieldTypeSignature"
@return
private TypeArgSignature parseTypeArg() {
int ch = peekChar();
switch (ch) {
case '*':
return new TypeArgSignature(
(char) nextChar(TypeArgSignature.UNBOUNDED_WILDCARD), null);
case '+':
return new TypeArgSignature(
(char) nextChar(TypeArgSig... | 160 | 44 | 594 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | 656bcca41560cc600e943988913e9ea3138a81b564841e015200cc1c3d972973 | Apache-2.0 | permissive | https://github.com/cchabanois/transmorph/blob/master/LICENSE |
cf60689d1a07628cca7569b3 | cchabanois/transmorph | src/main/java/net/entropysoft/transmorph/signature/parser/ClassFileTypeSignatureParser.java | ClassFileTypeSignatureParser.parseJavaId | https://github.com/cchabanois/transmorph/blob/118550f30b9680a84eab7496bd8b04118740dcec/src/main/java/net/entropysoft/transmorph/signature/parser/ClassFileTypeSignatureParser.java#L256-L267 | train | java | parse a java id
@return | private String parseJavaId() {
StringBuilder sb = new StringBuilder();
int ch;
while (true) {
ch = peekChar();
if (ch == EOS || !isJavaIdentifierPart(ch)) {
return sb.toString();
}
sb.append((char) ch);
nextChar();
}
} | parse a java id
@return
private String parseJavaId() {
StringBuilder sb = new StringBuilder();
int ch;
while (true) {
ch = peekChar();
if (ch == EOS || !isJavaIdentifierPart(ch)) {
return sb.toString();
}
sb.append((char) ch);
nextChar();
}
} | 77 | 24 | 257 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | dd90c2390d75aac1108e1de5838d48a57831d67eb54ece6174c8a585580a9d91 | Apache-2.0 | permissive | https://github.com/cchabanois/transmorph/blob/master/LICENSE |
abfd72343b7edb20ba177207 | cchabanois/transmorph | src/main/java/net/entropysoft/transmorph/signature/parser/ClassFileTypeSignatureParser.java | ClassFileTypeSignatureParser.parseOuterClassName | https://github.com/cchabanois/transmorph/blob/118550f30b9680a84eab7496bd8b04118740dcec/src/main/java/net/entropysoft/transmorph/signature/parser/ClassFileTypeSignatureParser.java#L274-L283 | train | java | parse the outer class name
@return | private String parseOuterClassName() {
StringBuilder sb = new StringBuilder();
sb.append(parseJavaId());
while (peekChar() == packageSeparator) { // '/' or '.'
nextChar(packageSeparator);
sb.append('.');
sb.append(parseJavaId());
}
return sb.toString();
} | parse the outer class name
@return
private String parseOuterClassName() {
StringBuilder sb = new StringBuilder();
sb.append(parseJavaId());
while (peekChar() == packageSeparator) { // '/' or '.'
nextChar(packageSeparator);
sb.append('.');
sb.append(parseJavaId());
}
return sb.toString();
... | 73 | 35 | 284 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | 04875887a8d5cee3e8c14471d7f12c14c80bafa6d786851be4b88c2a4b9bb93c | Apache-2.0 | permissive | https://github.com/cchabanois/transmorph/blob/master/LICENSE |
32e20aad09da1d6df25788dd | cchabanois/transmorph | src/main/java/net/entropysoft/transmorph/signature/parser/ClassFileTypeSignatureParser.java | ClassFileTypeSignatureParser.parseClassName | https://github.com/cchabanois/transmorph/blob/118550f30b9680a84eab7496bd8b04118740dcec/src/main/java/net/entropysoft/transmorph/signature/parser/ClassFileTypeSignatureParser.java#L327-L343 | train | java | parse the class name (outer class and inner class)
@return | public ClassTypeSignature parseClassName() {
// read ID (/Id)*
String outerClassName = parseOuterClassName();
TypeArgSignature[] typeArgSignatures = new TypeArgSignature[0];
int ch = peekChar();
if (acceptGenerics && ch == '<') {
typeArgSignatures = parseTypeArgs();
}
ClassTypeSignature class... | parse the class name (outer class and inner class)
@return
public ClassTypeSignature parseClassName() {
// read ID (/Id)*
String outerClassName = parseOuterClassName();
TypeArgSignature[] typeArgSignatures = new TypeArgSignature[0];
int ch = peekChar();
if (acceptGenerics && ch == '<') {
typeArgS... | 157 | 59 | 576 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | 3025424d9a42f74e5894f6d563e382c0e809c3d4955402609f8a7baa886dcae5 | Apache-2.0 | permissive | https://github.com/cchabanois/transmorph/blob/master/LICENSE |
82a0f8642e189e83194e4896 | httpcache4j/httpcache4j | httpcache4j-core/src/main/java/org/codehaus/httpcache4j/cache/HTTPCache.java | HTTPCache.isInvalidatingHEADResponse | https://github.com/httpcache4j/httpcache4j/blob/9c07ebd63cd104a99eb9e771f760f14efa4fe0f6/httpcache4j-core/src/main/java/org/codehaus/httpcache4j/cache/HTTPCache.java#L212-L214 | train | java | http://tools.ietf.org/html/rfc2616#section-9.4 | private boolean isInvalidatingHEADResponse(HTTPRequest request, CacheItem item, HTTPResponse resolvedResponse) {
return request.getMethod() == HTTPMethod.HEAD && item != null && resolvedResponse.getStatus() != Status.NOT_MODIFIED;
} | http://tools.ietf.org/html/rfc2616#section-9.4
private boolean isInvalidatingHEADResponse(HTTPRequest request, CacheItem item, HTTPResponse resolvedResponse) {
return request.getMethod() == HTTPMethod.HEAD && item != null && resolvedResponse.getStatus() != Status.NOT_MODIFIED;
} | 64 | 46 | 244 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | 0c0cb48920e1ce536e8ebee40c7068de49102e0062f1807b99fa09b75e227604 | Apache-2.0 | permissive | https://github.com/httpcache4j/httpcache4j/blob/master/LICENSE.txt |
898a313526e4e52e3240585d | httpcache4j/httpcache4j | httpcache4j-core/src/main/java/org/codehaus/httpcache4j/cache/HTTPCache.java | HTTPCache.isSuccessfulResponseToUnsafeRequest | https://github.com/httpcache4j/httpcache4j/blob/9c07ebd63cd104a99eb9e771f760f14efa4fe0f6/httpcache4j-core/src/main/java/org/codehaus/httpcache4j/cache/HTTPCache.java#L223-L226 | train | java | http://tools.ietf.org/html/draft-ietf-httpbis-p6-cache-22#section-6 | private boolean isSuccessfulResponseToUnsafeRequest(HTTPResponse resolvedResponse) {
Status.Category category = resolvedResponse.getStatus().getCategory();
return category == Status.Category.SUCCESS || category == Status.Category.REDIRECTION;
} | http://tools.ietf.org/html/draft-ietf-httpbis-p6-cache-22#section-6
private boolean isSuccessfulResponseToUnsafeRequest(HTTPResponse resolvedResponse) {
Status.Category category = resolvedResponse.getStatus().getCategory();
return category == Status.Category.SUCCESS || category == Status.Category.REDIR... | 66 | 67 | 264 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | b0a9d4ccdc36163d7c60343755281c5af83108fd047a4b759caec0adacea918f | Apache-2.0 | permissive | https://github.com/httpcache4j/httpcache4j/blob/master/LICENSE.txt |
b05c02295a5b1e32a24e1ff4 | mgormley/optimize | src/main/java/edu/jhu/hlt/optimize/function/AbstractSumBatchFunction.java | AbstractSumBatchFunction.getValue | https://github.com/mgormley/optimize/blob/3d1b93260b99febb8a5ecd9e8543c223e151a8d3/src/main/java/edu/jhu/hlt/optimize/function/AbstractSumBatchFunction.java#L20-L26 | train | java | Gets value of this function at the current point, computed on the given batch of examples.
@param batch A set of indices indicating the examples over which the gradient should be computed.
@return The value of the function at the point. | public double getValue(int[] batch) {
double value = 0.0;
for (int i=0; i<batch.length; i++) {
value += getValue(i);
}
return value;
} | Gets value of this function at the current point, computed on the given batch of examples.
@param batch A set of indices indicating the examples over which the gradient should be computed.
@return The value of the function at the point.
public double getValue(int[] batch) {
double value = 0.0;
for (int... | 92 | 236 | 182 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | 06565a57f265037fb3711e1a6d421c5cc49c5a44390ddbf76bbd108c1f83140e | Apache-2.0 | permissive | https://github.com/mgormley/optimize/blob/master/LICENSE |
ecbece4171e3f36d9b983bec | mgormley/optimize | src/main/java/edu/jhu/hlt/optimize/function/AbstractSumBatchFunction.java | AbstractSumBatchFunction.getGradient | https://github.com/mgormley/optimize/blob/3d1b93260b99febb8a5ecd9e8543c223e151a8d3/src/main/java/edu/jhu/hlt/optimize/function/AbstractSumBatchFunction.java#L33-L37 | train | java | Gets the gradient at the current point, computed on the given batch of examples.
@param batch A set of indices indicating the examples over which the gradient should be computed.
@param gradient The output gradient, a vector of partial derivatives. | public void getGradient(int[] batch, double[] gradient) {
for (int i=0; i<batch.length; i++) {
addGradient(i, gradient);
}
} | Gets the gradient at the current point, computed on the given batch of examples.
@param batch A set of indices indicating the examples over which the gradient should be computed.
@param gradient The output gradient, a vector of partial derivatives.
public void getGradient(int[] batch, double[] gradient) {
for ... | 85 | 248 | 156 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | 9f0d06d4af654c585862e655551ec0d3821c80bfceda1283dbf67d7b5e572930 | Apache-2.0 | permissive | https://github.com/mgormley/optimize/blob/master/LICENSE |
267b6415f9d9840d1cd7d9f7 | mgormley/optimize | src/main/java/edu/jhu/hlt/optimize/functions/L2.java | L2.getValue | https://github.com/mgormley/optimize/blob/3d1b93260b99febb8a5ecd9e8543c223e151a8d3/src/main/java/edu/jhu/hlt/optimize/functions/L2.java#L38-L43 | train | java | Gets the negated sum of squares times 1/2 \lambda. | @Override
public double getValue(IntDoubleVector params) {
double sum = params.dot(params);
sum *= 1./2. * lambda;
return - sum;
} | Gets the negated sum of squares times 1/2 \lambda.
@Override
public double getValue(IntDoubleVector params) {
double sum = params.dot(params);
sum *= 1./2. * lambda;
return - sum;
} | 53 | 50 | 162 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | ccec26543eed4177ecb04d0bfc42cb4fe5b7a215b4a2ac41033df00fa0b379ad | Apache-2.0 | permissive | https://github.com/mgormley/optimize/blob/master/LICENSE |
998388d356e1b5862b2c6b5d | mgormley/optimize | src/main/java/edu/jhu/hlt/optimize/functions/L2.java | L2.getGradient | https://github.com/mgormley/optimize/blob/3d1b93260b99febb8a5ecd9e8543c223e151a8d3/src/main/java/edu/jhu/hlt/optimize/functions/L2.java#L49-L56 | train | java | TODO: Why do Sutton & McCallum include the sum of the parameters here and not just the value for each term of the gradient. | @Override
public IntDoubleVector getGradient(IntDoubleVector params) {
IntDoubleDenseVector gradient = new IntDoubleDenseVector(numParams);
for (int j=0; j<numParams; j++) {
gradient.set(j, - params.get(j) * lambda);
}
return gradient;
} | TODO: Why do Sutton & McCallum include the sum of the parameters here and not just the value for each term of the gradient.
@Override
public IntDoubleVector getGradient(IntDoubleVector params) {
IntDoubleDenseVector gradient = new IntDoubleDenseVector(numParams);
for (int j=0; j<numParams; j++) {
... | 96 | 123 | 289 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | b4bfb4a4336cd40d56d35159e8cc3cd576ab7b9bfea461b0fb771e6f6934d1f3 | Apache-2.0 | permissive | https://github.com/mgormley/optimize/blob/master/LICENSE |
dbc654395f6eda710837bb33 | httpcache4j/httpcache4j | httpcache4j-api/src/main/java/org/codehaus/httpcache4j/HTTPResponse.java | HTTPResponse.transform | https://github.com/httpcache4j/httpcache4j/blob/9c07ebd63cd104a99eb9e771f760f14efa4fe0f6/httpcache4j-api/src/main/java/org/codehaus/httpcache4j/HTTPResponse.java#L104-L109 | train | java | TODO: consider removing this | public <A> Optional<A> transform(final ThrowableFunction<Payload, A, IOException> f) {
if (hasPayload()) {
return payload.flatMap(p -> lift(p, f));
}
return Optional.empty();
} | TODO: consider removing this
public <A> Optional<A> transform(final ThrowableFunction<Payload, A, IOException> f) {
if (hasPayload()) {
return payload.flatMap(p -> lift(p, f));
}
return Optional.empty();
} | 54 | 28 | 216 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | fa7432febf2934189e98044fa86c02b764bc3b451ed83e86a56e3e8bc1416b49 | Apache-2.0 | permissive | https://github.com/httpcache4j/httpcache4j/blob/master/LICENSE.txt |
7e7c414e2e12f70c57aed2d1 | erickok/RxCupboard | sample/src/main/java/nl/nl2312/rxcupboard2/sample/CupboardDbHelper.java | CupboardDbHelper.getConnection | https://github.com/erickok/RxCupboard/blob/2c75d880d7aae6d7b86538345b9daa3e438697e8/sample/src/main/java/nl/nl2312/rxcupboard2/sample/CupboardDbHelper.java#L28-L34 | train | java | Returns a raw handle to the SQLite database connection. Do not close!
@param context A context, which is used to (when needed) set up a connection to the database
@return The single, unique connection to the database, as is (also) used by our Cupboard instance | public synchronized static SQLiteDatabase getConnection(Context context) {
if (database == null) {
// Construct the single helper and open the unique(!) db connection for the app
database = new CupboardDbHelper(context.getApplicationContext()).getWritableDatabase();
}
return database;
} | Returns a raw handle to the SQLite database connection. Do not close!
@param context A context, which is used to (when needed) set up a connection to the database
@return The single, unique connection to the database, as is (also) used by our Cupboard instance
public synchronized static SQLiteDatabase getConnection(Co... | 118 | 260 | 300 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | 8eef48c7fe082a7114d4d835025081ba3bb558f44843bd6d08e59b3ecfaffbda | Apache-2.0 | permissive | https://github.com/erickok/RxCupboard/blob/master/LICENSE |
018b4102950d9bae17d0dd28 | cchabanois/transmorph | src/main/java/net/entropysoft/transmorph/type/TypeReference.java | TypeReference.get | https://github.com/cchabanois/transmorph/blob/118550f30b9680a84eab7496bd8b04118740dcec/src/main/java/net/entropysoft/transmorph/type/TypeReference.java#L70-L72 | train | java | Gets type token for the given {@code Class} instance. | public static <T> TypeReference<T> get(Class<T> type) {
return new SimpleTypeReference<T>(type);
} | Gets type token for the given {@code Class} instance.
public static <T> TypeReference<T> get(Class<T> type) {
return new SimpleTypeReference<T>(type);
} | 40 | 53 | 101 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | 72ee6ccc9f6a48395a0cb4446ee9ab08c0205512e7c70cf34b1880ae0c1b2c41 | Apache-2.0 | permissive | https://github.com/cchabanois/transmorph/blob/master/LICENSE |
e29953caa0b871430c1b6177 | cchabanois/transmorph | src/main/java/net/entropysoft/transmorph/type/TypeReference.java | TypeReference.isNumber | https://github.com/cchabanois/transmorph/blob/118550f30b9680a84eab7496bd8b04118740dcec/src/main/java/net/entropysoft/transmorph/type/TypeReference.java#L144-L152 | train | java | check if type is a number type (either primitive or instance of Number)
@param type
@return
@throws ClassNotFoundException | public boolean isNumber() {
if (type == Byte.TYPE || type == Short.TYPE || type == Integer.TYPE
|| type == Long.TYPE || type == Float.TYPE
|| type == Double.TYPE) {
return true;
} else {
return isRawTypeSubOf(Number.class);
}
} | check if type is a number type (either primitive or instance of Number)
@param type
@return
@throws ClassNotFoundException
public boolean isNumber() {
if (type == Byte.TYPE || type == Short.TYPE || type == Integer.TYPE
|| type == Long.TYPE || type == Float.TYPE
|| type == Double.TYPE) {
return true;
} ... | 94 | 123 | 248 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | 697a3cfbca60d4f4a5e04165ab54010799b6051490d365e1abc6bc5793ca3869 | Apache-2.0 | permissive | https://github.com/cchabanois/transmorph/blob/master/LICENSE |
d7ad8f8b74b5425fc9179ae3 | cchabanois/transmorph | src/main/java/net/entropysoft/transmorph/type/TypeReference.java | TypeReference.getSuperclassTypeParameter | https://github.com/cchabanois/transmorph/blob/118550f30b9680a84eab7496bd8b04118740dcec/src/main/java/net/entropysoft/transmorph/type/TypeReference.java#L263-L270 | train | java | Gets type from super class's type parameter. | @SuppressWarnings("unchecked")
public static Type getSuperclassTypeParameter(Class<?> subclass) {
Type superclass = subclass.getGenericSuperclass();
if (superclass instanceof Class) {
throw new RuntimeException("Missing type parameter.");
}
return ((ParameterizedType) superclass).getActualTypeArguments()[0]... | Gets type from super class's type parameter.
@SuppressWarnings("unchecked")
public static Type getSuperclassTypeParameter(Class<?> subclass) {
Type superclass = subclass.getGenericSuperclass();
if (superclass instanceof Class) {
throw new RuntimeException("Missing type parameter.");
}
return ((Parameterize... | 75 | 44 | 324 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | 77de2d136f04885a53f5f37cb25b6c04439a5c595ba73d3b10b563347af2cbf3 | Apache-2.0 | permissive | https://github.com/cchabanois/transmorph/blob/master/LICENSE |
50cd3a6dfcc5443bdea53f38 | tractionsoftware/gwt-traction | src/main/java/com/tractionsoftware/gwt/user/client/ui/AutoSizingBase.java | AutoSizingBase.onLoad | https://github.com/tractionsoftware/gwt-traction/blob/efc1423c619439763fb064b777b7235e9ce414a3/src/main/java/com/tractionsoftware/gwt/user/client/ui/AutoSizingBase.java#L180-L197 | train | java | Matches the styles and adjusts the size. This needs to be
called after the input is added to the DOM, so we do it in
onLoad. | @Override
protected void onLoad() {
super.onLoad();
// these styles need to be the same for the box and shadow so
// that we can measure properly
matchStyles("display");
matchStyles("fontSize");
matchStyles("fontFamily");
matchStyles("fontWeight");
matchStyles("lineHeight");
matchStyles("paddingTop");
ma... | Matches the styles and adjusts the size. This needs to be
called after the input is added to the DOM, so we do it in
onLoad.
@Override
protected void onLoad() {
super.onLoad();
// these styles need to be the same for the box and shadow so
// that we can measure properly
matchStyles("display");
matchStyles("f... | 125 | 124 | 428 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | e2b5c1ae3ae345145ee3b08f09fa0257c938ed324d20814d0f78706a9af23d1b | Apache-2.0 | permissive | https://github.com/tractionsoftware/gwt-traction/blob/master/LICENSE |
10bf9825d809fb6516ed4d95 | tractionsoftware/gwt-traction | src/main/java/com/tractionsoftware/gwt/user/client/ui/AutoSizingBase.java | AutoSizingBase.matchStyles | https://github.com/tractionsoftware/gwt-traction/blob/efc1423c619439763fb064b777b7235e9ce414a3/src/main/java/com/tractionsoftware/gwt/user/client/ui/AutoSizingBase.java#L207-L219 | train | java | style manipulation | public void matchStyles(String name) {
String value = MiscUtils.getComputedStyle(box.getElement(), name);
if (value != null) {
try {
// we might have a bogus value (e.g. width: -10px). we
// just let it fail quietly.
shadow.getElement().getStyl... | style manipulation
public void matchStyles(String name) {
String value = MiscUtils.getComputedStyle(box.getElement(), name);
if (value != null) {
try {
// we might have a bogus value (e.g. width: -10px). we
// just let it fail quietly.
shadow.... | 110 | 18 | 508 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | 8221d3077352b8ec21e8f7365b587317e86fd8241a6e6a8c20ada61aa15ca82c | Apache-2.0 | permissive | https://github.com/tractionsoftware/gwt-traction/blob/master/LICENSE |
71d1d35551ec99da45f1f51e | tractionsoftware/gwt-traction | src/main/java/com/tractionsoftware/gwt/user/client/ui/AutoSizingBase.java | AutoSizingBase.onKeyDown | https://github.com/tractionsoftware/gwt-traction/blob/efc1423c619439763fb064b777b7235e9ce414a3/src/main/java/com/tractionsoftware/gwt/user/client/ui/AutoSizingBase.java#L233-L237 | train | java | On key down we assume the key will go at the end. It's the most
common case and not that distracting if that's not true. | @Override
public void onKeyDown(KeyDownEvent event) {
char c = MiscUtils.getCharCode(event.getNativeEvent());
onKeyCodeEvent(event, box.getValue()+c);
} | On key down we assume the key will go at the end. It's the most
common case and not that distracting if that's not true.
@Override
public void onKeyDown(KeyDownEvent event) {
char c = MiscUtils.getCharCode(event.getNativeEvent());
onKeyCodeEvent(event, box.getValue()+c);
} | 66 | 120 | 162 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | e08cc091ee015522ff8c864544941e5e872e30003bf4e424d3b7a022609b3a34 | Apache-2.0 | permissive | https://github.com/tractionsoftware/gwt-traction/blob/master/LICENSE |
f9b50d7fb854bf35fc69a371 | jbossws/jbossws-spi | src/main/java/org/jboss/wsf/spi/metadata/webservices/WebservicesMetaData.java | WebservicesMetaData.serialize | https://github.com/jbossws/jbossws-spi/blob/845e66c18679ce3aaf76f849822110b4650a9d78/src/main/java/org/jboss/wsf/spi/metadata/webservices/WebservicesMetaData.java#L75-L90 | train | java | Serialize as a String | public String serialize()
{
//Construct the webservices.xml definitions
StringBuilder buffer = new StringBuilder();
// header: opening webservices tag
createHeader(buffer);
// webservice-description subelements
for (WebserviceDescriptionMetaData wm : webserviceDescriptions)
... | Serialize as a String
public String serialize()
{
//Construct the webservices.xml definitions
StringBuilder buffer = new StringBuilder();
// header: opening webservices tag
createHeader(buffer);
// webservice-description subelements
for (WebserviceDescriptionMetaData wm : webse... | 90 | 21 | 465 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | 27a61e5da76062e00217a48b321f7ef66e29d5676aebe17f5012756400e61a63 | Apache-2.0 | permissive | https://github.com/jbossws/jbossws-spi/blob/main/LICENSE.txt |
2865e4e9cba77ec1b28d05a4 | tractionsoftware/gwt-traction | src/main/java/com/tractionsoftware/gwt/user/client/util/DomUtils.java | DomUtils.setEnabled | https://github.com/tractionsoftware/gwt-traction/blob/efc1423c619439763fb064b777b7235e9ce414a3/src/main/java/com/tractionsoftware/gwt/user/client/util/DomUtils.java#L45-L48 | train | java | It's enough to just set the disabled attribute on the
element, but we want to also add a "disabled" class so that we can
style it.
At some point we'll just be able to use .button:disabled,
but that doesn't work in IE8- | public static void setEnabled(Element element, boolean enabled) {
element.setPropertyBoolean("disabled", !enabled);
setStyleName(element, "disabled", !enabled);
} | It's enough to just set the disabled attribute on the
element, but we want to also add a "disabled" class so that we can
style it.
At some point we'll just be able to use .button:disabled,
but that doesn't work in IE8-
public static void setEnabled(Element element, boolean enabled) {
element.setPropertyBoolea... | 92 | 219 | 175 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | cf1817496751b1055023e1be113ca1a80085d26ce2bbb780511cdc0bd3d659c8 | Apache-2.0 | permissive | https://github.com/tractionsoftware/gwt-traction/blob/master/LICENSE |
78f747a1fde9a54e3a3cdebe | cchabanois/transmorph | src/main/java/net/entropysoft/transmorph/converters/beans/BeanToBean.java | BeanToBean.getPropertySourceMethod | https://github.com/cchabanois/transmorph/blob/118550f30b9680a84eab7496bd8b04118740dcec/src/main/java/net/entropysoft/transmorph/converters/beans/BeanToBean.java#L161-L177 | train | java | get the property source method corresponding to given destination
property
@param sourceObject
@param destinationObject
@param destinationProperty
@return | private Method getPropertySourceMethod(Object sourceObject,
Object destinationObject, String destinationProperty) {
BeanToBeanMapping beanToBeanMapping = beanToBeanMappings.get(ClassPair
.get(sourceObject.getClass(), destinationObject
.getClass()));
String sourceProperty = null;
if (beanToBeanM... | get the property source method corresponding to given destination
property
@param sourceObject
@param destinationObject
@param destinationProperty
@return
private Method getPropertySourceMethod(Object sourceObject,
Object destinationObject, String destinationProperty) {
BeanToBeanMapping beanToBeanMapping = be... | 152 | 155 | 605 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | 94c7e6bf0891eaa2929208d80e978514dbb78832138bcac791a813f583605835 | Apache-2.0 | permissive | https://github.com/cchabanois/transmorph/blob/master/LICENSE |
d59928e3294945ec0ba70446 | cchabanois/transmorph | src/main/java/net/entropysoft/transmorph/converters/beans/BeanToBean.java | BeanToBean.getBeanPropertyType | https://github.com/cchabanois/transmorph/blob/118550f30b9680a84eab7496bd8b04118740dcec/src/main/java/net/entropysoft/transmorph/converters/beans/BeanToBean.java#L187-L198 | train | java | get the bean property type
@param clazz
@param propertyName
@param originalType
@return | protected TypeReference<?> getBeanPropertyType(Class<?> clazz,
String propertyName, TypeReference<?> originalType) {
TypeReference<?> propertyDestinationType = null;
if (beanDestinationPropertyTypeProvider != null) {
propertyDestinationType = beanDestinationPropertyTypeProvider
.getPropertyType(claz... | get the bean property type
@param clazz
@param propertyName
@param originalType
@return
protected TypeReference<?> getBeanPropertyType(Class<?> clazz,
String propertyName, TypeReference<?> originalType) {
TypeReference<?> propertyDestinationType = null;
if (beanDestinationPropertyTypeProvider != null) {
... | 117 | 88 | 486 | CodeSearchNet permissive-repo filter (dataset-level; per-row license absent) | code_search_net | 2026-12-05 | c7445de0efebfda2c55b0cf4d4258eee9dc635443eee4f280d7f06d148a7550b | Apache-2.0 | permissive | https://github.com/cchabanois/transmorph/blob/master/LICENSE |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.