Polygenic risk scores are a completely unknown, and therefore useless, quantity until they are properly evaluated. These evaluations are completed in the context of a model, for example a comparison of a polygenic risk score against a disease label can be considered an univariate linear regression. However, there are many factors that may confound a polygenic risk score, which is why most evaluations are multivariate models that contain common risk factors such as age and sex. Moreover, since disease is often considered an all or nothing affair we can use a logistic regression model, which better handles a binary covariate than a linear regression model. Now, most investigations of polygenic risk scores stop here and simply use a logistic regression model with a few basic covariates. However, just as logistic regression is better than linear regression, there are further model modifications we can make to produce a better model.
Although, it is important to note in this process that the descriptions of better, improved or enhanced are all difficult to objectively evaluate. Which is why we have to both consider the qualitative operation of the model modification and the quantitative effect on the prediction. While many, many model modifications are possible, we considered modifications that fall into five main catagories of assumptions. We will analyze these assumptions in turn:


Javalanche report for class:
org.joda.time.TimeOfDay
1: /*
2: * Copyright 2001-2011 Stephen Colebourne
3: *
4: * Licensed under the Apache License, Version 2.0 (the "License");
5: * you may not use this file except in compliance with the License.
6: * You may obtain a copy of the License at
7: *
8: * http://www.apache.org/licenses/LICENSE-2.0
9: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16: package org.joda.time;
17:
18: import java.io.Serializable;
19: import java.util.Calendar;
20: import java.util.Date;
21: import java.util.Locale;
22:
23: import org.joda.time.base.BasePartial;
24: import org.joda.time.chrono.ISOChronology;
25: import org.joda.time.field.AbstractPartialFieldProperty;
26: import org.joda.time.field.FieldUtils;
27: import org.joda.time.format.ISODateTimeFormat;
28:
29: /**
30: * TimeOfDay is an immutable partial supporting the hour, minute, second
31: * and millisecond fields.
32: *

33: * NOTE: This class only supports the four fields listed above. Thus, you
34: * cannot query the millisOfDay or secondOfDay fields for example.
35: * The new LocalTime class removes this restriction.
36: *

37: * Calculations on TimeOfDay are performed using a {@link Chronology}.
38: * This chronology is set to be in the UTC time zone for all calculations.
39: *

40: * Each individual field can be queried in two ways:
41: *

42: *
getHourOfDay()
43: *
hourOfDay().get()
44: *

45: * The second technique also provides access to other useful methods on the
46: * field:
47: *

48: *
numeric value - hourOfDay().get()
49: *
text value - hourOfDay().getAsText()
50: *
short text value - hourOfDay().getAsShortText()
51: *
maximum/minimum values - hourOfDay().getMaximumValue()
52: *
add/subtract - hourOfDay().addToCopy()
53: *
set - hourOfDay().setCopy()
54: *

55: *

56: * TimeOfDay is thread-safe and immutable, provided that the Chronology is as well.
57: * All standard Chronology classes supplied are thread-safe and immutable.
58: *
59: * @author Stephen Colebourne
60: * @author Brian S O'Neill
61: * @since 1.0
62: * @deprecated Use LocalTime which has a much better internal implementation and
63: * has been available since 1.3
64: */
65: @Deprecated
66: public final class TimeOfDay
67: extends BasePartial
68: implements ReadablePartial, Serializable {
69: // NOTE: No toDateTime(YearMonthDay) as semantics are confusing when
70: // different chronologies
71:
72: /** Serialization version */
73: private static final long serialVersionUID =<PHONE_NUMBER>803318660L;
74: /** The singleton set of field types */
75: private static final DateTimeFieldType[] FIELD_TYPES = new DateTimeFieldType[] {
76: DateTimeFieldType.hourOfDay(),
77: DateTimeFieldType.minuteOfHour(),
78: DateTimeFieldType.secondOfMinute(),
79: DateTimeFieldType.millisOfSecond(),
80: };
81:
82: /** Constant for midnight. */
83: public static final TimeOfDay MIDNIGHT = new TimeOfDay(0, 0, 0, 0);
84:
85: /** The index of the hourOfDay field in the field array */
86: public static final int HOUR_OF_DAY = 0;
87: /** The index of the minuteOfHour field in the field array */
88: public static final int MINUTE_OF_HOUR = 1;
89: /** The index of the secondOfMinute field in the field array */
90: public static final int SECOND_OF_MINUTE = 2;
91: /** The index of the millisOfSecond field in the field array */
92: public static final int MILLIS_OF_SECOND = 3;
93:
94: //-----------------------------------------------------------------------
95: /**
96: * Constructs a TimeOfDay from a java.util.Calendar
97: * using exactly the same field values avoiding any time zone effects.
98: *

99: * Each field is queried from the Calendar and assigned to the TimeOfDay.
100: * This is useful to ensure that the field values are the same in the
101: * created TimeOfDay no matter what the time zone is. For example, if
102: * the Calendar states that the time is 04:29, then the created TimeOfDay
103: * will always have the time 04:29 irrespective of time zone issues.
104: *

105: * This factory method ignores the type of the calendar and always
106: * creates a TimeOfDay with ISO chronology.
107: *
108: * @param calendar the Calendar to extract fields from
109: * @return the created TimeOfDay
110: * @throws IllegalArgumentException if the calendar is null
111: * @throws IllegalArgumentException if the time is invalid for the ISO chronology
112: * @since 1.2
113: */
114: public static TimeOfDay fromCalendarFields(Calendar calendar) {
115: if (calendar == null) {
116: throw new IllegalArgumentException("The calendar must not be null");
117: }
118: return new TimeOfDay(
119: calendar.get(Calendar.HOUR_OF_DAY),
120: calendar.get(Calendar.MINUTE),
121: calendar.get(Calendar.SECOND),
122: calendar.get(Calendar.MILLISECOND)
123: );
124: }
125:
126: /**
127: * Constructs a TimeOfDay from a java.util.Date
128: * using exactly the same field values avoiding any time zone effects.
129: *

130: * Each field is queried from the Date and assigned to the TimeOfDay.
131: * This is useful to ensure that the field values are the same in the
132: * created TimeOfDay no matter what the time zone is. For example, if
133: * the Calendar states that the time is 04:29, then the created TimeOfDay
134: * will always have the time 04:29 irrespective of time zone issues.
135: *

136: * This factory method always creates a TimeOfDay with ISO chronology.
137: *
138: * @param date the Date to extract fields from
139: * @return the created TimeOfDay
140: * @throws IllegalArgumentException if the calendar is null
141: * @throws IllegalArgumentException if the date is invalid for the ISO chronology
142: * @since 1.2
143: */
144: public static TimeOfDay fromDateFields(Date date) {
145: if (date == null) {
146: throw new IllegalArgumentException("The date must not be null");
147: }
148: return new TimeOfDay(
149: date.getHours(),
150: date.getMinutes(),
151: date.getSeconds(),
152: (((int) (date.getTime() % 1000)) + 1000) % 1000
153: );
154: }
155:
156: //-----------------------------------------------------------------------
157: /**
158: * Constructs a TimeOfDay from the specified millis of day using the
159: * ISO chronology.
160: *

161: * The millisOfDay value may exceed the number of millis in one day,
162: * but additional days will be ignored.
163: * This method uses the UTC time zone internally.
164: *
165: * @param millisOfDay the number of milliseconds into a day to convert
166: */
167: public static TimeOfDay fromMillisOfDay(long millisOfDay) {
168: return fromMillisOfDay(millisOfDay, null);
169: }
170:
171: /**
172: * Constructs a TimeOfDay from the specified millis of day using the
173: * specified chronology.
174: *

175: * The millisOfDay value may exceed the number of millis in one day,
176: * but additional days will be ignored.
177: * This method uses the UTC time zone internally.
178: *
179: * @param millisOfDay the number of milliseconds into a day to convert
180: * @param chrono the chronology, null means ISO chronology
181: */
182: public static TimeOfDay fromMillisOfDay(long millisOfDay, Chronology chrono) {
183: chrono = DateTimeUtils.getChronology(chrono);
184: chrono = chrono.withUTC();
185: return new TimeOfDay(millisOfDay, chrono);
186: }
187:
188: // Constructors
189: //-----------------------------------------------------------------------
190: /**
191: * Constructs a TimeOfDay with the current time, using ISOChronology in
192: * the default zone to extract the fields.
193: *

194: * The constructor uses the default time zone, resulting in the local time
195: * being initialised. Once the constructor is complete, all further calculations
196: * are performed without reference to a timezone (by switching to UTC).
197: */
198: public TimeOfDay() {
199: super();
200: }
201:
202: /**
203: * Constructs a TimeOfDay with the current time, using ISOChronology in
204: * the specified zone to extract the fields.
205: *

206: * The constructor uses the specified time zone to obtain the current time.
207: * Once the constructor is complete, all further calculations
208: * are performed without reference to a timezone (by switching to UTC).
209: *
210: * @param zone the zone to use, null means default zone
211: * @since 1.1
212: */
213: public TimeOfDay(DateTimeZone zone) {
214: super(ISOChronology.getInstance(zone));
215: }
216:
217: /**
218: * Constructs a TimeOfDay with the current time, using the specified chronology
219: * and zone to extract the fields.
220: *

221: * The constructor uses the time zone of the chronology specified.
222: * Once the constructor is complete, all further calculations are performed
223: * without reference to a timezone (by switching to UTC).
224: *
225: * @param chronology the chronology, null means ISOChronology in the default zone
226: */
227: public TimeOfDay(Chronology chronology) {
228: super(chronology);
229: }
230:
231: /**
232: * Constructs a TimeOfDay extracting the partial fields from the specified
233: * milliseconds using the ISOChronology in the default zone.
234: *

235: * The constructor uses the default time zone, resulting in the local time
236: * being initialised. Once the constructor is complete, all further calculations
237: * are performed without reference to a timezone (by switching to UTC).
238: *
239: * @param instant the milliseconds from 1970-01-01T00:00:00Z
240: */
241: public TimeOfDay(long instant) {
242: super(instant);
243: }
244:
245: /**
246: * Constructs a TimeOfDay extracting the partial fields from the specified
247: * milliseconds using the chronology provided.
248: *

249: * The constructor uses the time zone of the chronology specified.
250: * Once the constructor is complete, all further calculations are performed
251: * without reference to a timezone (by switching to UTC).
252: *
253: * @param instant the milliseconds from 1970-01-01T00:00:00Z
254: * @param chronology the chronology, null means ISOChronology in the default zone
255: */
256: public TimeOfDay(long instant, Chronology chronology) {
257: super(instant, chronology);
258: }
259:
260: /**
261: * Constructs a TimeOfDay from an Object that represents a time.
262: *

263: * The recognised object types are defined in
264: * {@link org.joda.time.convert.ConverterManager ConverterManager} and
265: * include ReadableInstant, String, Calendar and Date.
266: * The String formats are described by {@link ISODateTimeFormat#timeParser()}.
267: *

268: * The chronology used will be derived from the object, defaulting to ISO.
269: *

270: * NOTE: Prior to v1.3 the string format was described by
271: * {@link ISODateTimeFormat#dateTimeParser()}. Dates are now rejected.
272: *
273: * @param instant the datetime object, null means now
274: * @throws IllegalArgumentException if the instant is invalid
275: */
276: public TimeOfDay(Object instant) {
277: super(instant, null, ISODateTimeFormat.timeParser());
278: }
279:
280: /**
281: * Constructs a TimeOfDay from an Object that represents a time, using the
282: * specified chronology.
283: *

284: * The recognised object types are defined in
285: * {@link org.joda.time.convert.ConverterManager ConverterManager} and
286: * include ReadableInstant, String, Calendar and Date.
287: * The String formats are described by {@link ISODateTimeFormat#timeParser()}.
288: *

289: * The constructor uses the time zone of the chronology specified.
290: * Once the constructor is complete, all further calculations are performed
291: * without reference to a timezone (by switching to UTC).
292: * The specified chronology overrides that of the object.
293: *

294: * NOTE: Prior to v1.3 the string format was described by
295: * {@link ISODateTimeFormat#dateTimeParser()}. Dates are now rejected.
296: *
297: * @param instant the datetime object, null means now
298: * @param chronology the chronology, null means ISO default
299: * @throws IllegalArgumentException if the instant is invalid
300: */
301: public TimeOfDay(Object instant, Chronology chronology) {
302: super(instant, DateTimeUtils.getChronology(chronology), ISODateTimeFormat.timeParser());
303: }
304:
305: /**
306: * Constructs a TimeOfDay with specified hour and minute and zero seconds and milliseconds
307: * using ISOChronology in the default zone.
308: *

309: * The constructor uses the no time zone initialising the fields as provided.
310: * Once the constructor is complete, all further calculations
311: * are performed without reference to a timezone (by switching to UTC).
312: *
313: * @param hourOfDay the hour of the day
314: * @param minuteOfHour the minute of the hour
315: */
316: public TimeOfDay(int hourOfDay, int minuteOfHour) {
317: this(hourOfDay, minuteOfHour, 0, 0, null);
318: }
319:
320: /**
321: * Constructs a TimeOfDay with specified hour and minute and zero seconds and milliseconds.
322: *

323: * The constructor uses the time zone of the chronology specified.
324: * Once the constructor is complete, all further calculations are performed
325: * without reference to a timezone (by switching to UTC).
326: *
327: * @param hourOfDay the hour of the day
328: * @param minuteOfHour the minute of the hour
329: * @param chronology the chronology, null means ISOChronology in the default zone
330: */
331: public TimeOfDay(int hourOfDay, int minuteOfHour, Chronology chronology) {
332: this(hourOfDay, minuteOfHour, 0, 0, chronology);
333: }
334:
335: /**
336: * Constructs a TimeOfDay with specified time field values and zero milliseconds
337: * using ISOChronology in the default zone.
338: *

339: * The constructor uses the no time zone initialising the fields as provided.
340: * Once the constructor is complete, all further calculations
341: * are performed without reference to a timezone (by switching to UTC).
342: *
343: * @param hourOfDay the hour of the day
344: * @param minuteOfHour the minute of the hour
345: * @param secondOfMinute the second of the minute
346: */
347: public TimeOfDay(int hourOfDay, int minuteOfHour, int secondOfMinute) {
348: this(hourOfDay, minuteOfHour, secondOfMinute, 0, null);
349: }
350:
351: /**
352: * Constructs a TimeOfDay with specified time field values and zero milliseconds.
353: *

354: * The constructor uses the time zone of the chronology specified.
355: * Once the constructor is complete, all further calculations are performed
356: * without reference to a timezone (by switching to UTC).
357: *
358: * @param hourOfDay the hour of the day
359: * @param minuteOfHour the minute of the hour
360: * @param secondOfMinute the second of the minute
361: * @param chronology the chronology, null means ISOChronology in the default zone
362: */
363: public TimeOfDay(int hourOfDay, int minuteOfHour, int secondOfMinute, Chronology chronology) {
364: this(hourOfDay, minuteOfHour, secondOfMinute, 0, chronology);
365: }
366:
367: /**
368: * Constructs a TimeOfDay with specified time field values using
369: * ISOChronology in the default zone.
370: *

371: * The constructor uses the no time zone initialising the fields as provided.
372: * Once the constructor is complete, all further calculations
373: * are performed without reference to a timezone (by switching to UTC).
374: *
375: * @param hourOfDay the hour of the day
376: * @param minuteOfHour the minute of the hour
377: * @param secondOfMinute the second of the minute
378: * @param millisOfSecond the millisecond of the second
379: */
380: public TimeOfDay(int hourOfDay, int minuteOfHour, int secondOfMinute, int millisOfSecond) {
381: this(hourOfDay, minuteOfHour, secondOfMinute, millisOfSecond, null);
382: }
383:
384: /**
385: * Constructs a TimeOfDay with specified time field values and chronology.
386: *

387: * The constructor uses the time zone of the chronology specified.
388: * Once the constructor is complete, all further calculations are performed
389: * without reference to a timezone (by switching to UTC).
390: *
391: * @param hourOfDay the hour of the day
392: * @param minuteOfHour the minute of the hour
393: * @param secondOfMinute the second of the minute
394: * @param millisOfSecond the millisecond of the second
395: * @param chronology the chronology, null means ISOChronology in the default zone
396: */
397: public TimeOfDay(int hourOfDay, int minuteOfHour,
398: int secondOfMinute, int millisOfSecond, Chronology chronology) {
399: super(new int[] {hourOfDay, minuteOfHour, secondOfMinute, millisOfSecond}, chronology);
400: }
401:
402: /**
403: * Constructs a TimeOfDay with chronology from this instance and new values.
404: *
405: * @param partial the partial to base this new instance on
406: * @param values the new set of values
407: */
408: TimeOfDay(TimeOfDay partial, int[] values) {
409: super(partial, values);
410: }
411:
412: /**
413: * Constructs a TimeOfDay with values from this instance and a new chronology.
414: *
415: * @param partial the partial to base this new instance on
416: * @param chrono the new chronology
417: */
418: TimeOfDay(TimeOfDay partial, Chronology chrono) {
419: super(partial, chrono);
420: }
421:
422: //-----------------------------------------------------------------------
423: /**
424: * Gets the number of fields in this partial.
425: *
426: * @return the field count
427: */
428: public int size() {
429: return 4;
430: }
431:
432: /**
433: * Gets the field for a specific index in the chronology specified.
434: *

435: * This method must not use any instance variables.
436: *
437: * @param index the index to retrieve
438: * @param chrono the chronology to use
439: * @return the field
440: */
441: protected DateTimeField getField(int index, Chronology chrono) {
442: switch (index) {
443: case HOUR_OF_DAY:
444: return chrono.hourOfDay();
445: case MINUTE_OF_HOUR:
446: return chrono.minuteOfHour();
447: case SECOND_OF_MINUTE:
448: return chrono.secondOfMinute();
449: case MILLIS_OF_SECOND:
450: return chrono.millisOfSecond();
451: default:
452: throw new IndexOutOfBoundsException("Invalid index: " + index);
453: }
454: }
455:
456: /**
457: * Gets the field type at the specified index.
458: *
459: * @param index the index to retrieve
460: * @return the field at the specified index
461: * @throws IndexOutOfBoundsException if the index is invalid
462: */
463: public DateTimeFieldType getFieldType(int index) {
464: return FIELD_TYPES[index];
465: }
466:
467: /**
468: * Gets an array of the field type of each of the fields that this partial supports.
469: *

470: * The fields are returned largest to smallest, Hour, Minute, Second, Millis.
471: *
472: * @return the array of field types (cloned), largest to smallest
473: */
474: public DateTimeFieldType[] getFieldTypes() {
475: return (DateTimeFieldType[]) FIELD_TYPES.clone();
476: }
477:
478: //-----------------------------------------------------------------------
479: /**
480: * Returns a copy of this time with the specified chronology.
481: * This instance is immutable and unaffected by this method call.
482: *

483: * This method retains the values of the fields, thus the result will
484: * typically refer to a different instant.
485: *

486: * The time zone of the specified chronology is ignored, as TimeOfDay
487: * operates without a time zone.
488: *
489: * @param newChronology the new chronology, null means ISO
490: * @return a copy of this datetime with a different chronology
491: * @throws IllegalArgumentException if the values are invalid for the new chronology
492: */
493: public TimeOfDay withChronologyRetainFields(Chronology newChronology) {
494: newChronology = DateTimeUtils.getChronology(newChronology);
495: newChronology = newChronology.withUTC();
496: if (newChronology == getChronology()) {
497: return this;
498: } else {
499: TimeOfDay newTimeOfDay = new TimeOfDay(this, newChronology);
500: newChronology.validate(newTimeOfDay, getValues());
501: return newTimeOfDay;
502: }
503: }
504:
505: /**
506: * Returns a copy of this time with the specified field set to a new value.
507: *

508: * For example, if the field type is minuteOfHour then the day
509: * would be changed in the returned instance.
510: *

511: * These three lines are equivalent:
512: *

513: * TimeOfDay updated = tod.withField(DateTimeFieldType.minuteOfHour(), 6);
514: * TimeOfDay updated = tod.minuteOfHour().setCopy(6);
515: * TimeOfDay updated = tod.property(DateTimeFieldType.minuteOfHour()).setCopy(6);
516: *

517: *
518: * @param fieldType the field type to set, not null
519: * @param value the value to set
520: * @return a copy of this instance with the field set
521: * @throws IllegalArgumentException if the value is null or invalid
522: */
523: public TimeOfDay withField(DateTimeFieldType fieldType, int value) {
524: int index = indexOfSupported(fieldType);
525: if (value == getValue(index)) {
526: return this;
527: }
528: int[] newValues = getValues();
529: newValues = getField(index).set(this, index, newValues, value);
530: return new TimeOfDay(this, newValues);
531: }
532:
533: /**
534: * Returns a copy of this time with the value of the specified field increased,
535: * wrapping to what would be a new day if required.
536: *

537: * If the addition is zero, then this is returned.
538: *

539: * These three lines are equivalent:
540: *

541: * TimeOfDay added = tod.withFieldAdded(DurationFieldType.minutes(), 6);
542: * TimeOfDay added = tod.plusMinutes(6);
543: * TimeOfDay added = tod.minuteOfHour().addToCopy(6);
544: *

545: *
546: * @param fieldType the field type to add to, not null
547: * @param amount the amount to add
548: * @return a copy of this instance with the field updated
549: * @throws IllegalArgumentException if the value is null or invalid
550: * @throws ArithmeticException if the new datetime exceeds the capacity
551: */
552: public TimeOfDay withFieldAdded(DurationFieldType fieldType, int amount) {
553: int index = indexOfSupported(fieldType);
554: if (amount == 0) {
555: return this;
556: }
557: int[] newValues = getValues();
558: newValues = getField(index).addWrapPartial(this, index, newValues, amount);
559: return new TimeOfDay(this, newValues);
560: }
561:
562: /**
563: * Returns a copy of this time with the specified period added,
564: * wrapping to what would be a new day if required.
565: *

566: * If the addition is zero, then this is returned.
567: * Fields in the period that aren't present in the partial are ignored.
568: *

569: * This method is typically used to add multiple copies of complex
570: * period instances. Adding one field is best achieved using methods
571: * like {@link #withFieldAdded(DurationFieldType, int)}
572: * or {@link #plusHours(int)}.
573: *
574: * @param period the period to add to this one, null means zero
575: * @param scalar the amount of times to add, such as -1 to subtract once
576: * @return a copy of this instance with the period added
577: * @throws ArithmeticException if the new datetime exceeds the capacity
578: */
579: public TimeOfDay withPeriodAdded(ReadablePeriod period, int scalar) {
580: if (period == null || scalar == 0) {
581: return this;
582: }
583: int[] newValues = getValues();
584: for (int i = 0; i < period.size(); i++) {
585: DurationFieldType fieldType = period.getFieldType(i);
586: int index = indexOf(fieldType);
587: if (index >= 0) {
588: newValues = getField(index).addWrapPartial(this, index, newValues,
589: FieldUtils.safeMultiply(period.getValue(i), scalar));
590: }
591: }
592: return new TimeOfDay(this, newValues);
593: }
594:
595: //-----------------------------------------------------------------------
596: /**
597: * Returns a copy of this time with the specified period added,
598: * wrapping to what would be a new day if required.
599: *

600: * If the amount is zero or null, then this is returned.
601: *

602: * This method is typically used to add complex period instances.
603: * Adding one field is best achieved using methods
604: * like {@link #plusHours(int)}.
605: *
606: * @param period the duration to add to this one, null means zero
607: * @return a copy of this instance with the period added
608: * @throws ArithmeticException if the new datetime exceeds the capacity of a long
609: */
610: public TimeOfDay plus(ReadablePeriod period) {
611: return withPeriodAdded(period, 1);
612: }
613:
614: //-----------------------------------------------------------------------
615: /**
616: * Returns a copy of this time plus the specified number of hours.
617: *

618: * This time instance is immutable and unaffected by this method call.
619: *

620: * The following three lines are identical in effect:
621: *

622: * TimeOfDay added = dt.plusHours(6);
623: * TimeOfDay added = dt.plus(Period.hours(6));
624: * TimeOfDay added = dt.withFieldAdded(DurationFieldType.hours(), 6);
625: *

626: *
627: * @param hours the amount of hours to add, may be negative
628: * @return the new time plus the increased hours
629: * @since 1.1
630: */
631: public TimeOfDay plusHours(int hours) {
632: return withFieldAdded(DurationFieldType.hours(), hours);
633: }
634:
635: /**
636: * Returns a copy of this time plus the specified number of minutes.
637: *

638: * This time instance is immutable and unaffected by this method call.
639: *

640: * The following three lines are identical in effect:
641: *

642: * TimeOfDay added = dt.plusMinutes(6);
643: * TimeOfDay added = dt.plus(Period.minutes(6));
644: * TimeOfDay added = dt.withFieldAdded(DurationFieldType.minutes(), 6);
645: *

646: *
647: * @param minutes the amount of minutes to add, may be negative
648: * @return the new time plus the increased minutes
649: * @since 1.1
650: */
651: public TimeOfDay plusMinutes(int minutes) {
652: return withFieldAdded(DurationFieldType.minutes(), minutes);
653: }
654:
655: /**
656: * Returns a copy of this time plus the specified number of seconds.
657: *

658: * This time instance is immutable and unaffected by this method call.
659: *

660: * The following three lines are identical in effect:
661: *

662: * TimeOfDay added = dt.plusSeconds(6);
663: * TimeOfDay added = dt.plus(Period.seconds(6));
664: * TimeOfDay added = dt.withFieldAdded(DurationFieldType.seconds(), 6);
665: *

666: *
667: * @param seconds the amount of seconds to add, may be negative
668: * @return the new time plus the increased seconds
669: * @since 1.1
670: */
671: public TimeOfDay plusSeconds(int seconds) {
672: return withFieldAdded(DurationFieldType.seconds(), seconds);
673: }
674:
675: /**
676: * Returns a copy of this time plus the specified number of millis.
677: *

678: * This time instance is immutable and unaffected by this method call.
679: *

680: * The following three lines are identical in effect:
681: *

682: * TimeOfDay added = dt.plusMillis(6);
683: * TimeOfDay added = dt.plus(Period.millis(6));
684: * TimeOfDay added = dt.withFieldAdded(DurationFieldType.millis(), 6);
685: *

686: *
687: * @param millis the amount of millis to add, may be negative
688: * @return the new time plus the increased millis
689: * @since 1.1
690: */
691: public TimeOfDay plusMillis(int millis) {
692: return withFieldAdded(DurationFieldType.millis(), millis);
693: }
694:
695: //-----------------------------------------------------------------------
696: /**
697: * Returns a copy of this time with the specified period taken away,
698: * wrapping to what would be a new day if required.
699: *

700: * If the amount is zero or null, then this is returned.
701: *

702: * This method is typically used to subtract complex period instances.
703: * Subtracting one field is best achieved using methods
704: * like {@link #minusHours(int)}.
705: *
706: * @param period the period to reduce this instant by
707: * @return a copy of this instance with the period taken away
708: * @throws ArithmeticException if the new time exceeds capacity
709: */
710: public TimeOfDay minus(ReadablePeriod period) {
711: return withPeriodAdded(period, -1);
712: }
713:
714: //-----------------------------------------------------------------------
715: /**
716: * Returns a copy of this time minus the specified number of hours.
717: *

718: * This time instance is immutable and unaffected by this method call.
719: *

720: * The following three lines are identical in effect:
721: *

722: * TimeOfDay subtracted = dt.minusHours(6);
723: * TimeOfDay subtracted = dt.minus(Period.hours(6));
724: * TimeOfDay subtracted = dt.withFieldAdded(DurationFieldType.hours(), -6);
725: *

726: *
727: * @param hours the amount of hours to subtract, may be negative
728: * @return the new time minus the increased hours
729: * @since 1.1
730: */
731: public TimeOfDay minusHours(int hours) {
732: return withFieldAdded(DurationFieldType.hours(), FieldUtils.safeNegate(hours));
733: }
734:
735: /**
736: * Returns a copy of this time minus the specified number of minutes.
737: *

738: * This time instance is immutable and unaffected by this method call.
739: *

740: * The following three lines are identical in effect:
741: *

742: * TimeOfDay subtracted = dt.minusMinutes(6);
743: * TimeOfDay subtracted = dt.minus(Period.minutes(6));
744: * TimeOfDay subtracted = dt.withFieldAdded(DurationFieldType.minutes(), -6);
745: *

746: *
747: * @param minutes the amount of minutes to subtract, may be negative
748: * @return the new time minus the increased minutes
749: * @since 1.1
750: */
751: public TimeOfDay minusMinutes(int minutes) {
752: return withFieldAdded(DurationFieldType.minutes(), FieldUtils.safeNegate(minutes));
753: }
754:
755: /**
756: * Returns a copy of this time minus the specified number of seconds.
757: *

758: * This time instance is immutable and unaffected by this method call.
759: *

760: * The following three lines are identical in effect:
761: *

762: * TimeOfDay subtracted = dt.minusSeconds(6);
763: * TimeOfDay subtracted = dt.minus(Period.seconds(6));
764: * TimeOfDay subtracted = dt.withFieldAdded(DurationFieldType.seconds(), -6);
765: *

766: *
767: * @param seconds the amount of seconds to subtract, may be negative
768: * @return the new time minus the increased seconds
769: * @since 1.1
770: */
771: public TimeOfDay minusSeconds(int seconds) {
772: return withFieldAdded(DurationFieldType.seconds(), FieldUtils.safeNegate(seconds));
773: }
774:
775: /**
776: * Returns a copy of this time minus the specified number of millis.
777: *

778: * This time instance is immutable and unaffected by this method call.
779: *

780: * The following three lines are identical in effect:
781: *

782: * TimeOfDay subtracted = dt.minusMillis(6);
783: * TimeOfDay subtracted = dt.minus(Period.millis(6));
784: * TimeOfDay subtracted = dt.withFieldAdded(DurationFieldType.millis(), -6);
785: *

786: *
787: * @param millis the amount of millis to subtract, may be negative
788: * @return the new time minus the increased millis
789: * @since 1.1
790: */
791: public TimeOfDay minusMillis(int millis) {
792: return withFieldAdded(DurationFieldType.millis(), FieldUtils.safeNegate(millis));
793: }
794:
795: //-----------------------------------------------------------------------
796: /**
797: * Gets the property object for the specified type, which contains
798: * many useful methods.
799: *
800: * @param type the field type to get the property for
801: * @return the property object
802: * @throws IllegalArgumentException if the field is null or unsupported
803: */
804: public Property property(DateTimeFieldType type) {
805: return new Property(this, indexOfSupported(type));
806: }
807:
808: //-----------------------------------------------------------------------
809: /**
810: * Converts this object to a LocalTime with the same time and chronology.
811: *
812: * @return a LocalTime with the same time and chronology
813: * @since 1.3
814: */
815: public LocalTime toLocalTime() {
816: return new LocalTime(getHourOfDay(), getMinuteOfHour(),
817: getSecondOfMinute(), getMillisOfSecond(), getChronology());
818: }
819:
820: //-----------------------------------------------------------------------
821: /**
822: * Converts this partial to a full datetime using the default time zone
823: * setting the time fields from this instance and the date fields from
824: * the current time.
825: *
826: * @return this date as a datetime with the time as the current time
827: */
828: public DateTime toDateTimeToday() {
829: return toDateTimeToday(null);
830: }
831:
832: /**
833: * Converts this partial to a full datetime using the specified time zone
834: * setting the time fields from this instance and the date fields from
835: * the current time.
836: *

837: * This method uses the chronology from this instance plus the time zone
838: * specified.
839: *
840: * @param zone the zone to use, null means default
841: * @return this date as a datetime with the time as the current time
842: */
843: public DateTime toDateTimeToday(DateTimeZone zone) {
844: Chronology chrono = getChronology().withZone(zone);
845: long instantMillis = DateTimeUtils.currentTimeMillis();
846: long resolved = chrono.set(this, instantMillis);
847: return new DateTime(resolved, chrono);
848: }
849:
850: //-----------------------------------------------------------------------
851: /**
852: * Get the hour of day (0-23) field value.
853: *
854: * @return the hour of day
855: */
856: public int getHourOfDay() {
857: return getValue(HOUR_OF_DAY);
858: }
859:
860: /**
861: * Get the minute of hour field value.
862: *
863: * @return the minute of hour
864: */
865: public int getMinuteOfHour() {
866: return getValue(MINUTE_OF_HOUR);
867: }
868:
869: /**
870: * Get the second of minute field value.
871: *
872: * @return the second of minute
873: */
874: public int getSecondOfMinute() {
875: return getValue(SECOND_OF_MINUTE);
876: }
877:
878: /**
879: * Get the millis of second field value.
880: *
881: * @return the millis of second
882: */
883: public int getMillisOfSecond() {
884: return getValue(MILLIS_OF_SECOND);
885: }
886:
887: //-----------------------------------------------------------------------
888: /**
889: * Returns a copy of this time with the hour of day field updated.
890: *

891: * TimeOfDay is immutable, so there are no set methods.
892: * Instead, this method returns a new instance with the value of
893: * hour of day changed.
894: *
895: * @param hour the hour of day to set
896: * @return a copy of this object with the field set
897: * @throws IllegalArgumentException if the value is invalid
898: * @since 1.3
899: */
900: public TimeOfDay withHourOfDay(int hour) {
901: int[] newValues = getValues();
902: newValues = getChronology().hourOfDay().set(this, HOUR_OF_DAY, newValues, hour);
903: return new TimeOfDay(this, newValues);
904: }
905:
906: /**
907: * Returns a copy of this time with the minute of hour field updated.
908: *

909: * TimeOfDay is immutable, so there are no set methods.
910: * Instead, this method returns a new instance with the value of
911: * minute of hour changed.
912: *
913: * @param minute the minute of hour to set
914: * @return a copy of this object with the field set
915: * @throws IllegalArgumentException if the value is invalid
916: * @since 1.3
917: */
918: public TimeOfDay withMinuteOfHour(int minute) {
919: int[] newValues = getValues();
920: newValues = getChronology().minuteOfHour().set(this, MINUTE_OF_HOUR, newValues, minute);
921: return new TimeOfDay(this, newValues);
922: }
923:
924: /**
925: * Returns a copy of this time with the second of minute field updated.
926: *

927: * TimeOfDay is immutable, so there are no set methods.
928: * Instead, this method returns a new instance with the value of
929: * second of minute changed.
930: *
931: * @param second the second of minute to set
932: * @return a copy of this object with the field set
933: * @throws IllegalArgumentException if the value is invalid
934: * @since 1.3
935: */
936: public TimeOfDay withSecondOfMinute(int second) {
937: int[] newValues = getValues();
938: newValues = getChronology().secondOfMinute().set(this, SECOND_OF_MINUTE, newValues, second);
939: return new TimeOfDay(this, newValues);
940: }
941:
942: /**
943: * Returns a copy of this time with the millis of second field updated.
944: *

945: * TimeOfDay is immutable, so there are no set methods.
946: * Instead, this method returns a new instance with the value of
947: * millis of second changed.
948: *
949: * @param millis the millis of second to set
950: * @return a copy of this object with the field set
951: * @throws IllegalArgumentException if the value is invalid
952: * @since 1.3
953: */
954: public TimeOfDay withMillisOfSecond(int millis) {
955: int[] newValues = getValues();
956: newValues = getChronology().millisOfSecond().set(this, MILLIS_OF_SECOND, newValues, millis);
957: return new TimeOfDay(this, newValues);
958: }
959:
960: //-----------------------------------------------------------------------
961: /**
962: * Get the hour of day field property which provides access to advanced functionality.
963: *
964: * @return the hour of day property
965: */
966: public Property hourOfDay() {
967: return new Property(this, HOUR_OF_DAY);
968: }
969:
970: /**
971: * Get the minute of hour field property which provides access to advanced functionality.
972: *
973: * @return the minute of hour property
974: */
975: public Property minuteOfHour() {
976: return new Property(this, MINUTE_OF_HOUR);
977: }
978:
979: /**
980: * Get the second of minute field property which provides access to advanced functionality.
981: *
982: * @return the second of minute property
983: */
984: public Property secondOfMinute() {
985: return new Property(this, SECOND_OF_MINUTE);
986: }
987:
988: /**
989: * Get the millis of second property which provides access to advanced functionality.
990: *
991: * @return the millis of second property
992: */
993: public Property millisOfSecond() {
994: return new Property(this, MILLIS_OF_SECOND);
995: }
996:
997: //-----------------------------------------------------------------------
998: /**
999: * Output the time in the ISO8601 format THH:mm:ss.SSS.
1000: *
1001: * @return ISO8601 formatted string
1002: */
1003: public String toString() {
1004: return ISODateTimeFormat.tTime().print(this);
1005: }
1006:
1007: //-----------------------------------------------------------------------
1008: /**
1009: * The property class for TimeOfDay.
1010: *

1011: * This class binds a TimeOfDay to a DateTimeField.
1012: *
1013: * @author Stephen Colebourne
1014: * @since 1.0
1015: * @deprecated Use LocalTime which has a much better internal implementation
1016: */
1017: @Deprecated
1018: public static class Property extends AbstractPartialFieldProperty implements Serializable {
1019:
1020: /** Serialization version */
1021: private static final long serialVersionUID =<PHONE_NUMBER>741063833L;
1022:
1023: /** The partial */
1024: private final TimeOfDay iTimeOfDay;
1025: /** The field index */
1026: private final int iFieldIndex;
1027:
1028: /**
1029: * Constructs a property.
1030: *
1031: * @param partial the partial instance
1032: * @param fieldIndex the index in the partial
1033: */
1034: Property(TimeOfDay partial, int fieldIndex) {
1035: super();
1036: iTimeOfDay = partial;
1037: iFieldIndex = fieldIndex;
1038: }
1039:
1040: /**
1041: * Gets the field that this property uses.
1042: *
1043: * @return the field
1044: */
1045: public DateTimeField getField() {
1046: return iTimeOfDay.getField(iFieldIndex);
1047: }
1048:
1049: /**
1050: * Gets the partial that this property belongs to.
1051: *
1052: * @return the partial
1053: */
1054: protected ReadablePartial getReadablePartial() {
1055: return iTimeOfDay;
1056: }
1057:
1058: /**
1059: * Gets the partial that this property belongs to.
1060: *
1061: * @return the partial
1062: */
1063: public TimeOfDay getTimeOfDay() {
1064: return iTimeOfDay;
1065: }
1066:
1067: /**
1068: * Gets the value of this field.
1069: *
1070: * @return the field value
1071: */
1072: public int get() {
1073: return iTimeOfDay.getValue(iFieldIndex);
1074: }
1075:
1076: //-----------------------------------------------------------------------
1077: /**
1078: * Adds to the value of this field in a copy of this TimeOfDay,
1079: * wrapping to what would be the next day if necessary.
1080: *

1081: * The value will be added to this field. If the value is too large to be
1082: * added solely to this field then it will affect larger fields.
1083: * Smaller fields are unaffected.
1084: *

1085: * If the result would be too large, beyond 23:59:59:999, then the
1086: * calculation wraps to 00:00:00.000. For the alternate strict behaviour
1087: * with no wrapping see {@link #addNoWrapToCopy(int)}.
1088: *

1089: * The TimeOfDay attached to this property is unchanged by this call.
1090: * Instead, a new instance is returned.
1091: *
1092: * @param valueToAdd the value to add to the field in the copy
1093: * @return a copy of the TimeOfDay with the field value changed
1094: * @throws IllegalArgumentException if the value isn't valid
1095: */
1096: public TimeOfDay addToCopy(int valueToAdd) {
1097: int[] newValues = iTimeOfDay.getValues();
1098: newValues = getField().addWrapPartial(iTimeOfDay, iFieldIndex, newValues, valueToAdd);
1099: return new TimeOfDay(iTimeOfDay, newValues);
1100: }
1101:
1102: /**
1103: * Adds to the value of this field in a copy of this TimeOfDay,
1104: * throwing an Exception if the bounds are exceeded.
1105: *

1106: * The value will be added to this field. If the value is too large to be
1107: * added solely to this field then it will affect larger fields.
1108: * Smaller fields are unaffected.
1109: *

1110: * If the result would be too large (beyond 23:59:59:999) or too
1111: * small (less than 00:00:00.000) then an Execption is thrown.
1112: * For the alternate behaviour which wraps to the next 'day',
1113: * see {@link #addToCopy(int)}.
1114: *

1115: * The TimeOfDay attached to this property is unchanged by this call.
1116: * Instead, a new instance is returned.
1117: *
1118: * @param valueToAdd the value to add to the field in the copy
1119: * @return a copy of the TimeOfDay with the field value changed
1120: * @throws IllegalArgumentException if the value isn't valid
1121: */
1122: public TimeOfDay addNoWrapToCopy(int valueToAdd) {
1123: int[] newValues = iTimeOfDay.getValues();
1124: newValues = getField().add(iTimeOfDay, iFieldIndex, newValues, valueToAdd);
1125: return new TimeOfDay(iTimeOfDay, newValues);
1126: }
1127:
1128: /**
1129: * Adds to the value of this field in a copy of this TimeOfDay wrapping
1130: * within this field if the maximum value is reached.
1131: *

1132: * The value will be added to this field. If the value is too large to be
1133: * added solely to this field then it wraps within this field.
1134: * Other fields are unaffected.
1135: *

1136: * For example,
1137: * 12:59:37 addWrapField one minute returns 12:00:37.
1138: *

1139: * The TimeOfDay attached to this property is unchanged by this call.
1140: * Instead, a new instance is returned.
1141: *
1142: * @param valueToAdd the value to add to the field in the copy
1143: * @return a copy of the TimeOfDay with the field value changed
1144: * @throws IllegalArgumentException if the value isn't valid
1145: */
1146: public TimeOfDay addWrapFieldToCopy(int valueToAdd) {
1147: int[] newValues = iTimeOfDay.getValues();
1148: newValues = getField().addWrapField(iTimeOfDay, iFieldIndex, newValues, valueToAdd);
1149: return new TimeOfDay(iTimeOfDay, newValues);
1150: }
1151:
1152: //-----------------------------------------------------------------------
1153: /**
1154: * Sets this field in a copy of the TimeOfDay.
1155: *

1156: * The TimeOfDay attached to this property is unchanged by this call.
1157: * Instead, a new instance is returned.
1158: *
1159: * @param value the value to set the field in the copy to
1160: * @return a copy of the TimeOfDay with the field value changed
1161: * @throws IllegalArgumentException if the value isn't valid
1162: */
1163: public TimeOfDay setCopy(int value) {
1164: int[] newValues = iTimeOfDay.getValues();
1165: newValues = getField().set(iTimeOfDay, iFieldIndex, newValues, value);
1166: return new TimeOfDay(iTimeOfDay, newValues);
1167: }
1168:
1169: /**
1170: * Sets this field in a copy of the TimeOfDay to a parsed text value.
1171: *

1172: * The TimeOfDay attached to this property is unchanged by this call.
1173: * Instead, a new instance is returned.
1174: *
1175: * @param text the text value to set
1176: * @param locale optional locale to use for selecting a text symbol
1177: * @return a copy of the TimeOfDay with the field value changed
1178: * @throws IllegalArgumentException if the text value isn't valid
1179: */
1180: public TimeOfDay setCopy(String text, Locale locale) {
1181: int[] newValues = iTimeOfDay.getValues();
1182: newValues = getField().set(iTimeOfDay, iFieldIndex, newValues, text, locale);
1183: return new TimeOfDay(iTimeOfDay, newValues);
1184: }
1185:
1186: /**
1187: * Sets this field in a copy of the TimeOfDay to a parsed text value.
1188: *

1189: * The TimeOfDay attached to this property is unchanged by this call.
1190: * Instead, a new instance is returned.
1191: *
1192: * @param text the text value to set
1193: * @return a copy of the TimeOfDay with the field value changed
1194: * @throws IllegalArgumentException if the text value isn't valid
1195: */
1196: public TimeOfDay setCopy(String text) {
1197: return setCopy(text, null);
1198: }
1199:
1200: //-----------------------------------------------------------------------
1201: /**
1202: * Returns a new TimeOfDay with this field set to the maximum value
1203: * for this field.
1204: *

1205: * The TimeOfDay attached to this property is unchanged by this call.
1206: *
1207: * @return a copy of the TimeOfDay with this field set to its maximum
1208: * @since 1.2
1209: */
1210: public TimeOfDay withMaximumValue() {
1211: return setCopy(getMaximumValue());
1212: }
1213:
1214: /**
1215: * Returns a new TimeOfDay with this field set to the minimum value
1216: * for this field.
1217: *

1218: * The TimeOfDay attached to this property is unchanged by this call.
1219: *
1220: * @return a copy of the TimeOfDay with this field set to its minimum
1221: * @since 1.2
1222: */
1223: public TimeOfDay withMinimumValue() {
1224: return setCopy(getMinimumValue());
1225: }
1226: }
1227:
1228: }
| ID | Line | Type | Detected |
|---|
| 9543 | 115 | Negate jump condition (Replace IFNONNULL with IFNULL) | |
| 9544 | 118 | Replace a constant (Replace 11 with 10(INT)) | |
| 9546 | 118 | Replace a constant (Replace 11 with 12(INT)) | |
| 9545 | 118 | Replace a constant (Replace 11 with 0(INT)) | |
| 9548 | 118(1) | Replace a constant (Replace 12 with 0(INT)) | |
| 9549 | 118(1) | Replace a constant (Replace 12 with 13(INT)) | |
| 9550 | 118(1) | Replace a constant (Replace 12 with 11(INT)) | |
| 9552 | 118(2) | Replace a constant (Replace 13 with 0(INT)) | |
| 9553 | 118(2) | Replace a constant (Replace 13 with 14(INT)) | |
| 9554 | 118(2) | Replace a constant (Replace 13 with 12(INT)) | |
| 9556 | 118(3) | Replace a constant (Replace 14 with 0(INT)) | |
| 9558 | 118(3) | Replace a constant (Replace 14 with 13(INT)) | |
| 9557 | 118(3) | Replace a constant (Replace 14 with 15(INT)) | |
| 9547 | 118 | Remove method call | |
| 9551 | 118(1) | Remove method call | |
| 9555 | 118(2) | Remove method call | |
| 9559 | 118(3) | Remove method call | |
| 9560 | 145 | Negate jump condition (Replace IFNONNULL with IFNULL) | |
| 9567 | 148 | Replace a constant (Replace 1000 with 999(LONG)) | |
| 9565 | 148 | Replace a constant (Replace 1000 with 1001(LONG)) | |
| 9566 | 148 | Replace a constant (Replace 1000 with 0(LONG)) | |
| 9571 | 148(1) | Replace a constant (Replace 1000 with 999(INT)) | |
| 9569 | 148(1) | Replace a constant (Replace 1000 with 1001(INT)) | |
| 9570 | 148(1) | Replace a constant (Replace 1000 with 0(INT)) | |
| 9574 | 148(2) | Replace a constant (Replace 1000 with 0(INT)) | |
| 9573 | 148(2) | Replace a constant (Replace 1000 with 1001(INT)) | |
| 9575 | 148(2) | Replace a constant (Replace 1000 with 999(INT)) | |
| 9568 | 148 | Replace arithmetic operator (Replace LREM with LDIV) | |
| 9572 | 148(1) | Replace arithmetic operator (Replace IADD with ISUB) | |
| 9576 | 148(2) | Replace arithmetic operator (Replace IREM with IDIV) | |
| 9561 | 148 | Remove method call | |
| 9562 | 148(1) | Remove method call | |
| 9563 | 148(2) | Remove method call | |
| 9564 | 148(3) | Remove method call | |
| 9577 | 168 | Remove method call | |
| 9578 | 183 | Remove method call | |
| 9579 | 184 | Remove method call | |
| 9580 | 317 | Replace a constant (Replace 0 with 1(INT)) | |
| 9581 | 317 | Replace a constant (Replace 0 with -1(INT)) | |
| 9583 | 317(1) | Replace a constant (Replace 0 with -1(INT)) | |
| 9582 | 317(1) | Replace a constant (Replace 0 with 1(INT)) | |
| 9584 | 332 | Replace a constant (Replace 0 with 1(INT)) | |
| 9585 | 332 | Replace a constant (Replace 0 with -1(INT)) | |
| 9586 | 332(1) | Replace a constant (Replace 0 with 1(INT)) | |
| 9587 | 332(1) | Replace a constant (Replace 0 with -1(INT)) | |
| 9588 | 348 | Replace a constant (Replace 0 with 1(INT)) | |
| 9589 | 348 | Replace a constant (Replace 0 with -1(INT)) | |
| 9591 | 364 | Replace a constant (Replace 0 with -1(INT)) | |
| 9590 | 364 | Replace a constant (Replace 0 with 1(INT)) | |
| 9594 | 399 | Replace a constant (Replace 4 with 5(INT)) | |
| 9592 | 399 | Replace a constant (Replace 4 with 3(INT)) | |
| 9593 | 399 | Replace a constant (Replace 4 with 0(INT)) | |
| 9595 | 399(1) | Replace a constant (Replace 0 with 1(INT)) | |
| 9596 | 399(1) | Replace a constant (Replace 0 with -1(INT)) | |
| 9598 | 399(2) | Replace a constant (Replace 1 with 0(INT)) | |
| 9597 | 399(2) | Replace a constant (Replace 1 with 2(INT)) | |
| 9600 | 399(3) | Replace a constant (Replace 2 with 1(INT)) | |
| 9601 | 399(3) | Replace a constant (Replace 2 with 0(INT)) | |
| 9599 | 399(3) | Replace a constant (Replace 2 with 3(INT)) | |
| 9604 | 399(4) | Replace a constant (Replace 3 with 4(INT)) | |
| 9602 | 399(4) | Replace a constant (Replace 3 with 2(INT)) | |
| 9603 | 399(4) | Replace a constant (Replace 3 with 0(INT)) | |
| 9606 | 429 | Replace a constant (Replace 4 with 0(INT)) | |
| 9607 | 429 | Replace a constant (Replace 4 with 5(INT)) | |
| 9605 | 429 | Replace a constant (Replace 4 with 3(INT)) | |
| 9608 | 444 | Remove method call | |
| 9609 | 446 | Remove method call | |
| 9610 | 448 | Remove method call | |
| 9611 | 450 | Remove method call | |
| 9612 | 452 | Remove method call | |
| 9613 | 452(1) | Remove method call | |
| 9614 | 452(2) | Remove method call | |
| 9615 | 475 | Remove method call | |
| 9616 | 494 | Remove method call | |
| 9617 | 495 | Remove method call | |
| 9619 | 496 | Negate jump condition (Replace IF_ACMPNE with IF_ACMPEQ) | |
| 9618 | 496 | Remove method call | |
| 9620 | 500 | Remove method call | |
| 9621 | 500(1) | Remove method call | |
| 9622 | 524 | Remove method call | |
| 9624 | 525 | Negate jump condition (Replace IF_ICMPNE with IF_ICMPEQ) | |
| 9623 | 525 | Remove method call | |
| 9625 | 528 | Remove method call | |
| 9626 | 529 | Remove method call | |
| 9627 | 529(1) | Remove method call | |
| 9628 | 553 | Remove method call | |
| 9629 | 554 | Negate jump condition (Replace IFNE with IFEQ) | |
| 9630 | 557 | Remove method call | |
| 9631 | 558 | Remove method call | |
| 9632 | 558(1) | Remove method call | |
| 9633 | 580 | Negate jump condition (Replace IFNULL with IFNONNULL) | |
| 9634 | 580(1) | Negate jump condition (Replace IFNE with IFEQ) | |
| 9635 | 583 | Remove method call | |
| 9637 | 584 | Replace a constant (Replace 0 with -1(INT)) | |
| 9636 | 584 | Replace a constant (Replace 0 with 1(INT)) | |
| 9639 | 584 | Negate jump condition (Replace IF_ICMPGE with IF_ICMPLT) | |
| 9638 | 584 | Remove method call | |
| 9640 | 585 | Remove method call | |
| 9641 | 586 | Remove method call | |
| 9642 | 587 | Negate jump condition (Replace IFLT with IFGE) | |
| 9643 | 588 | Remove method call | |
| 9644 | 588(1) | Remove method call | |
| 9645 | 588(2) | Remove method call | |
| 9646 | 588(3) | Remove method call | |
| 9647 | 611 | Replace a constant (Replace 1 with 2(INT)) | |
| 9648 | 611 | Replace a constant (Replace 1 with 0(INT)) | |
| 9649 | 611 | Remove method call | |
| 9650 | 632 | Remove method call | |
| 9651 | 632(1) | Remove method call | |
| 9652 | 652 | Remove method call | |
| 9653 | 652(1) | Remove method call | |
| 9654 | 672 | Remove method call | |
| 9655 | 672(1) | Remove method call | |
| 9656 | 692 | Remove method call | |
| 9657 | 692(1) | Remove method call | |
| 9658 | 711 | Replace a constant (Replace -1 with 0(INT)) | |
| 9659 | 711 | Replace a constant (Replace -1 with -2(INT)) | |
| 9660 | 711 | Remove method call | |
| 9661 | 732 | Remove method call | |
| 9662 | 732(1) | Remove method call | |
| 9663 | 732(2) | Remove method call | |
| 9664 | 752 | Remove method call | |
| 9665 | 752(1) | Remove method call | |
| 9666 | 752(2) | Remove method call | |
| 9667 | 772 | Remove method call | |
| 9668 | 772(1) | Remove method call | |
| 9669 | 772(2) | Remove method call | |
| 9670 | 792 | Remove method call | |
| 9671 | 792(1) | Remove method call | |
| 9672 | 792(2) | Remove method call | |
| 9673 | 805 | Remove method call | |
| 9674 | 816 | Remove method call | |
| 9675 | 816(1) | Remove method call | |
| 9676 | 816(2) | Remove method call | |
| 9677 | 816(3) | Remove method call | |
| 9678 | 816(4) | Remove method call | |
| 9679 | 829 | Remove method call | |
| 9680 | 844 | Remove method call | |
| 9681 | 844(1) | Remove method call | |
| 9682 | 845 | Remove method call | |
| 9683 | 846 | Remove method call | |
| 9684 | 857 | Replace a constant (Replace 0 with 1(INT)) | |
| 9685 | 857 | Replace a constant (Replace 0 with -1(INT)) | |
| 9686 | 857 | Remove method call | |
| 9687 | 866 | Replace a constant (Replace 1 with 2(INT)) | |
| 9688 | 866 | Replace a constant (Replace 1 with 0(INT)) | |
| 9689 | 866 | Remove method call | |
| 9692 | 875 | Replace a constant (Replace 2 with 0(INT)) | |
| 9690 | 875 | Replace a constant (Replace 2 with 3(INT)) | |
| 9691 | 875 | Replace a constant (Replace 2 with 1(INT)) | |
| 9693 | 875 | Remove method call | |
| 9695 | 884 | Replace a constant (Replace 3 with 0(INT)) | |
| 9696 | 884 | Replace a constant (Replace 3 with 4(INT)) | |
| 9694 | 884 | Replace a constant (Replace 3 with 2(INT)) | |
| 9697 | 884 | Remove method call | |
| 9698 | 901 | Remove method call | |
| 9701 | 902 | Replace a constant (Replace 0 with 1(INT)) | |
| 9702 | 902 | Replace a constant (Replace 0 with -1(INT)) | |
| 9699 | 902 | Remove method call | |
| 9700 | 902(1) | Remove method call | |
| 9703 | 902(2) | Remove method call | |
| 9704 | 919 | Remove method call | |
| 9708 | 920 | Replace a constant (Replace 1 with 0(INT)) | |
| 9707 | 920 | Replace a constant (Replace 1 with 2(INT)) | |
| 9705 | 920 | Remove method call | |
| 9706 | 920(1) | Remove method call | |
| 9709 | 920(2) | Remove method call | |
| 9710 | 937 | Remove method call | |
| 9713 | 938 | Replace a constant (Replace 2 with 3(INT)) | |
| 9714 | 938 | Replace a constant (Replace 2 with 1(INT)) | |
| 9715 | 938 | Replace a constant (Replace 2 with 0(INT)) | |
| 9711 | 938 | Remove method call | |
| 9712 | 938(1) | Remove method call | |
| 9716 | 938(2) | Remove method call | |
| 9717 | 955 | Remove method call | |
| 9721 | 956 | Replace a constant (Replace 3 with 0(INT)) | |
| 9722 | 956 | Replace a constant (Replace 3 with 4(INT)) | |
| 9720 | 956 | Replace a constant (Replace 3 with 2(INT)) | |
| 9718 | 956 | Remove method call | |
| 9719 | 956(1) | Remove method call | |
| 9723 | 956(2) | Remove method call | |
| 9725 | 967 | Replace a constant (Replace 0 with -1(INT)) | |
| 9724 | 967 | Replace a constant (Replace 0 with 1(INT)) | |
| 9726 | 976 | Replace a constant (Replace 1 with 2(INT)) | |
| 9727 | 976 | Replace a constant (Replace 1 with 0(INT)) | |
| 9728 | 985 | Replace a constant (Replace 2 with 3(INT)) | |
| 9730 | 985 | Replace a constant (Replace 2 with 0(INT)) | |
| 9729 | 985 | Replace a constant (Replace 2 with 1(INT)) | |
| 9733 | 994 | Replace a constant (Replace 3 with 4(INT)) | |
| 9731 | 994 | Replace a constant (Replace 3 with 2(INT)) | |
| 9732 | 994 | Replace a constant (Replace 3 with 0(INT)) | |
| 9734 | 1004 | Remove method call | |
| 9735 | 1004(1) | Remove method call | |
| 21196 | 1046 | Remove method call | |
| 21197 | 1073 | Remove method call | |
| 21198 | 1097 | Remove method call | |
| 21199 | 1098 | Remove method call | |
| 21200 | 1098(1) | Remove method call | |
| 21201 | 1123 | Remove method call | |
| 21202 | 1124 | Remove method call | |
| 21203 | 1124(1) | Remove method call | |
| 21204 | 1147 | Remove method call | |
| 21205 | 1148 | Remove method call | |
| 21206 | 1148(1) | Remove method call | |
| 21207 | 1164 | Remove method call | |
| 21208 | 1165 | Remove method call | |
| 21209 | 1165(1) | Remove method call | |
| 21210 | 1181 | Remove method call | |
| 21211 | 1182 | Remove method call | |
| 21212 | 1182(1) | Remove method call | |
| 21213 | 1197 | Remove method call | |
| 21214 | 1211 | Remove method call | |
| 21215 | 1211(1) | Remove method call | |
| 21216 | 1224 | Remove method call | |
| 21217 | 1224(1) | Remove method call | |


Women In Danger
Log In
Sign Up
Home Page
About
Danger Alerts
Sign Up
Full name
Username
Email
Mobile Number
Password
Confirm Password
Sign Up


| Class | Description |
|---|---|
| PropAllDiff |
Ensures that all sets are different
|
| PropAllDisjoint |
Ensures that all non-empty sets are disjoint
In order to forbid multiple empty set, use propagator PropAtMost1Empty in addition
|
| PropAllEqual |
Ensures that all sets are equal
|
| PropAtMost1Empty |
At most one set can be empty
|
| PropBoolChannel |
Channeling between a set variable and boolean variables
|
| PropCardinality |
A propagator ensuring that |set| = card
|
| PropElement |
Propagator for element constraint over sets
states that
array[index-offSet] = set
|
| PropIntBoundedMemberSet |
Propagator for Member constraint: iv is in set
|
| PropIntChannel |
Channeling between set variables and integer variables
x in sets[y-offSet1] <=> ints[x-offSet2] = y
|
| PropIntEnumMemberSet |
Propagator for Member constraint: iv is in set
|
| PropIntersection | |
| PropInverse |
Inverse set propagator
x in sets[y-offSet1] <=> y in inverses[x-offSet2]
|
| PropMaxElement |
Retrieves the maximum element of the set
the set must not be empty
|
| PropMinElement |
Retrieves the minimum element of the set
the set must not be empty
|
| PropNbEmpty |
Restricts the number of empty sets
|{s in sets such that |s|=0}| = nbEmpty
|
| PropNotEmpty |
Restricts the set var not to be empty
|
| PropNotMemberIntSet |
Not Member propagator filtering Int->Set
|
| PropNotMemberSetInt |
Not Member propagator filtering Set->Int
|
| PropOffSet |
set2 is an offSet view of set1
x in set1 <=> x+offSet in set2
|
| PropSetIntValuesUnion |
Maintain a link between a set variable and the union of values taken by an array of
integer variables
Not idempotent (use two of them)
|
| PropSubsetEq |
Ensures that X subseteq Y
|
| PropSumOfElements |
Sums elements given by a set variable
|
| PropSymmetric |
Propagator for symmetric sets
x in set[y-offSet] <=> y in set[x-offSet]
|
| PropUnion | |
| SCF |
A short-named version of
SetConstraintsFactory
|
| SetConstraintsFactory |
Constraints over set variables
|
Copyright © 2015. All rights reserved.


#thedevconf and #tdc2019 tweets
Java tweets (contain Java-related strings)
Other tweets
See discarded tweets
(tweets that don't contain links)


|
Rendu
An OpenGL rendering engine for experimentations
|
Commposite OBJ files loading. More...
Classes | |
| struct | Material |
| OBJ material descriptor. More... | |
| struct | Object |
| Associate a mesh and a material. More... | |
| class | ObjectMaterialUse |
| Associate an object and a material with geometry in an OBJ. More... | |
| class | RawGeometry |
| Contains all the geometry information from an OBJ file. More... | |
Functions | |
| void | parseMultiObj (std::istream &objFile, RawGeometry &geometry, std::vector< std::string > &materialsFiles, std::vector< ObjectMaterialUse > &objectMatUses) |
| void | populateMesh (const RawGeometry &geom, size_t lowerBound, size_t upperBound, Mesh &mesh) |
| void | parseMtlFile (std::istream &inMat, const std::string &rootPath, std::map< std::string, Material > &materials) |
| int | load (const std::string &filePath, std::vector< Object > &objects, std::map< std::string, Material > &materials) |
Commposite OBJ files loading.
| int CompositeObj::load | ( | const std::string & | filePath, |
| std::vector< Object > & | objects, | ||
| std::map< std::string, Material > & | materials | ||
| ) |
Load a multi-objects, multi-materials OBJ file.
| filePath | the path to the OBJ file |
| objects | will be filled the objects infos |
| materials | will be filled with the materials infos |
| void CompositeObj::parseMtlFile | ( | std::istream & | inMat, |
| const std::string & | rootPath, | ||
| std::map< std::string, Material > & | materials | ||
| ) |
Parse a MTL file to extract materials.
| inMat | the stream to parse |
| rootPath | the root path for all texture paths |
| materials | contains the materials that might be udpated by this file |
| void CompositeObj::parseMultiObj | ( | std::istream & | objFile, |
| RawGeometry & | geometry, | ||
| std::vector< std::string > & | materialsFiles, | ||
| std::vector< ObjectMaterialUse > & | objectMatUses | ||
| ) |
Parse an OBJ file to extract objects geometry, material library files and object-material associations.
| objFile | the stream to parse |
| geometry | will contain all the geometry stored in the file |
| materialsFiles | will contain a list of material files referenced. |
| objectMatUses | will contain a list of object/material associations. |
| void CompositeObj::populateMesh | ( | const RawGeometry & | geom, |
| size_t | lowerBound, | ||
| size_t | upperBound, | ||
| Mesh & | mesh | ||
| ) |
Build a mesh from a subset of the raw geometry data.
| geom | the raw geoemtry data |
| lowerBound | the index of the object first face |
| upperBound | the index after the object last face |
| mesh | will be updated with geoemtry data |


Keep order total as amount of USD 1
{ "order": { "location_id": "T9YA9HVEWWHEA", "fulfillments": [ { "shipment_details": { "recipient": { "address": { "address_line_1": "address_line_1", "address_line_2": "address_line_2", "address_line_3": "address_line_3", "administrative_district_level_1": "administrative_district_level_1", "administrative_district_level_2": "administrative_district_level_2", "administrative_district_level_3": "administrative_district_level_3", "country": "US", "first_name": "first_name", "last_name": "last_name", "locality": "locality", "organization": "organization", "postal_code": "postal_code", "sublocality": "sublocality", "sublocality_2": "sublocality_2" }, "display_name": "test user <%= ts %>", "email_address": "email<%= ts<EMAIL_ADDRESS>"phone_number": "11111111" }, "shipping_note": "shipping_note" }, "state": "PROPOSED", "type": "SHIPMENT" } ], "state": "OPEN", "line_items": [ { "quantity": "1", "base_price_money": { "amount": 1, "currency": "USD" }, "name": "item" } ] } }
Submit
No request sent


15 Videos
3 Contributors
Drupal 7
15 Videos
3 Contributors
Drupal 8
15 Videos
3 Contributors
Angular JS
15 Videos
3 Contributors
UX/UI Studio
15 Videos
3 Contributors
Front-end Developement
15 Videos
3 Contributors
Cake PHP
15 Videos
3 Contributors
PHP & MySQL
15 Videos
3 Contributors
E-Commerce
15 Videos
3 Contributors
Agile
15 Videos
3 Contributors
UX/UI Studio
15 Videos
1.2k Views
Front-end Developement
15 Videos
1.2k Views
Cake PHP
15 Videos
1.2k Views
Add a Channel
A slug will appear in the url. (ex: yourwebsite.com/channels/channel-name). Slug name should be all small letters.
Agile Videos
0 Videos
Your channel is created.
The Channel "Agile Videos" have been created. You can access your page from this link


Maha stunner: BJP will provide strong govt, says Fadnavis
Back at the helm as Maharashtra chief minister following a dramatic turn of events, Devendra Fadnavis on Saturday said the Bharatiya Janata Party will provide a strong government which will work for farmers.
IMAGE: Devendra Fadnavis celebrates his swearing-in with other senior Maharashtra BJP leaders at the BJP office in Mumbai. Photograph: Sahil Salvi/Rediff.com
Thanking BJP workers after taking oath as the CM early morning, Fadnavis said, "Modi hai to mumkin hai (Everything possible under leadership of PM Narendra Modi)".
In a surprise development, the BJP turned the tables on the prospective Congress-Nationalist Congress Party-Shiv Sena alliance by taking oath as the CM, after NCP's Ajit Pawar staged a early morning coup and joined hands with the BJP.
Ajit, nephew of NCP chief Sharad Pawar, took oath as deputy chief minister.
IMAGE: BJP supporters celebrate after BJP's Devendra Fadnavis was elected as the Maharashtra chief minister for a second term. Photograph: PTI Photo
Fadnavis thanked Ajit, MLAs, and Independent legislators for their support.
"It is true that some friends are not with us anymore," he said apparently referring to the Shiv Sena, which fell out with the BJP after assembly poll results over its demand for a rotational chief ministership.
"Our commitment is to provide a strong government for the next five years. Our commitment is to the people of the state," Fadnavis said.
IMAGE: Supporters give sweets to posters of Fadnavis, Narendra Modi and Amit Shah to celebrate the Maharashtra coup. Photograph: PTI Photo
He thanked PM Modi, Union Home Minister and BJP chief Amit Shah and acting BJP president J P Nadda.
Ajit's coup came two days after Sharad Pawar said a consensus had emerged between his party and the Congress on Uddhav Thackeray as the next chief minister of the state.
IMAGE: BJP workers dance to celebrate the swearing-in of Fadnavis. Photograph: PTI Photo


Select the main CSV file, the file containing the games you want to remove from the first, and the target file.
The CSV file to remove games from
The CSV files with the games to remove
The merged file to be saved
Delete


Trader Jakal:
This is not enough money! Who do you think I am? If you ever try to buy something without enough money again, I will throw you out of the shop!


Australia's 'Big Things'
A tour of the census data via a road trip of some of Australia’s most iconic landmarks
A tour of the census data via a road trip of some of Australia’s most iconic landmarks
The aim of our project was to find some interesting insights in the census data and a way for the community to engage with these insights.
The 2016 census posed many interesting questions to give observations about the Australian population and who the ‘typical’ Australian is, like where we live, where we’re from, and the average age. However, the scope of census data is quite broad, much of which may be less publicised. A few, perhaps less known aspects of the 2016 census data, were investigated with both some expected and surprising results. These led to questions that the general public can engage with through a buzzfeed quiz, and in particular targeting a younger demographic that may be less inclined to delve into more formal presentations of the census data.
The buzzfeed quiz user will answer a short succession of questions, based on an informal interpretation of an aspect of the 2016 census data. By way of an individual combination of answers the user will arrive at a collection of interesting census statistics particular to them. The Buzzfeed quiz is presented as a personality quiz, which asks ‘which Australian Big Thing are you?’ Ideally the individual answer combination and iconic Australian landmark will bear some relevance to each other, although it may be a little ‘cheeky’.
The following 3 census 2016 datasets that were investigated
The amount of unpaid work performed in a person’s own home, measured in hours in the week prior to the 2016 census night, was given in age bands for individuals 15+ years old for males and females.
A comparison of the duration of unpaid domestic work between the genders showed that males were most likely to do less than 5 hours a week, compared to females with a general trend of the relative proportions increasing with the number of hours.
A cross the age bands, younger people were more likely to do less unpaid domestic work. A general trend of more hours corresponds with an increase in age, peaking in the 45-54 age band, followed by a decreasing trend with an increase in age from 55 years onwards. These observations were not gender specific, both males and females showed similar correlations between age and duration of unpaid domestic work.
This 2016 census data was informally translated in the buzzfeed quiz as; how clean is your house?
Journalist Allie Severin says that you don’t need English to be an Australian citizen. But is it so ? Should the national anthem’s lyrics “We’ve boundless plains to share…but only if you can speak English..” be changed ? So a cool way to find out about the on-going trend of people speaking “ocker” English in Australia was to analyse the Census data and find out how proficient are we in English.
It seems that as of in 2016, proficient users of English in this continent has taken a dip. More so the age groups of 15-24 years and 25-34 years show an eagerness to learn English, but since 2016, this has taken a backward step as well. So the question remains? Is English losing its importance now? Or is it slowly being replaced by some other language? So let the citizens answer, do you speak ocker English?
Majority (88%) of Australian population stays in a residence with 2-4 bedrooms. Only 5.6% of the population settles in a 1 bedroom or bedsitters kind of accommodations and as small as 1% of the citizens in spacious houses with 6 or more bedrooms.
Conceptually the Buzzfeed quiz is a decision-tree which can be scaled up by adding more decision nodes, and if successful other fun quizzes exploring different parts of the census data with a variety of themes may be developed.
2016 Census Community Profiles


Best Shopping Mall Bot
please fill this form to gain access
please enter a valid age
are you wearing a face mask?
Yes, I am wearing a face mask,
😷
No, I am not wearing a face mask,
😐
Enter Mall
Visitors allowed
😷
Visitors Not allowed
😐
Total Visitors
🙂


Library Reference
This page provides a reference for the Tetra standard library.
The library is currently quite small. Future versions of Tetra
will expand the standard library.
base
This library is opened in all
Tetra programs, and provides the most input and output functions.
- print(*)
This function takes any number of arguments and prints them to the screen.
The arguments are printed one after the other without any white space
automatically inserted.
- str(*) string
This function takes any number of arguments and returns them as a string.
It uses the same format as the print
function, except that it
returns the result as a string instead of printing to the screen.
- input() string
This function reads a string from the user of the program. It does not
return until the user has entered input.
- input(prompt string) string
This version of the input function takes a prompt string as an argument. The
prompt will be printed to the screen before waiting for the users input.
math
This library provides
basic math functions and constants.
- PI
This constant has an approximation of the value of PI.
- sqrt(value real) real
This function returns the square root of its argument.
- sin(value real) real
This function returns the sine of its argument, an angle measured in degrees.
- cos(value real) real
This function returns the cosine of its argument, an angle measured in degrees.
- tan(value real) real
This function returns the tangent of its argument, an angle measured in degrees.
- abs(value real) real
This function returns the absolute value of its argument.
string functions
This section lists all
of the functions of string variables.
- toInt() int
This function returns an integer version of the string. If the string has
non-digits in it, then it will return the value 0.
- toReal() real
This function returns a real version of the string. If the string does not
contain a valid real number, then it will return the value 0.0
- toBool() bool
This function returns a real version of the string. If the string does not
equal either "true" or "false", then the function will return false.
- length() int
This function returns the length of the string as an integer.
list functions
This section lists all
of the functions of list variables.
- length() int
This function returns the length of the string as an integer.
- resize(newSize int)
This function resizes the list to be larger. If the new size is less than the current
size, then elements at the end of the list will be lost. If the new size is larger,
then new elements will be added at the end (with default values).
dictionary functions
This section lists all
of the functions of dictionary variables.
- length() int
This function returns the length of the string as an integer.
- values() [valtype]
This function returns the values of the dictionary in a list. The return type
is a list of the type of values the dictionary is storing.
- keys() [keytype]
This function returns the keys of the dictionary in a list. The return type
is a list of the type of keys the dictionary is storing.


Table creation
Table must be created before saving data. Table has columns more than one. If you create a table, cloudata creates empty tablet and assign to TabletServer.
Table name must start with the alphabet and a-z, A-Z, 0-9, '_' are avaliable.
You can create table with NTable class. Following code is simple
example and you can find complete source code in cloudata examples
pacakge.
CloudataConf conf = new CloudataConf();
private void createTable() throws IOException {
String tableName = "SampleTable";
//Column names
String[] columns = new String[]{"Column1", "Column2"};
String description = "This is test table";
//TableSchema object.
TableSchema tableSchema = new TableSchema(tableName, description, columns);
//set number of version, 0: unlimited, default:3
tableSchema.setNumOfVersion(0);
//check table exists.
boolean exists = CTable.existsTable(conf, tableName);
if(exists) {
System.out.println("Already exists table");
return;
}
//create table
CTable.createTable(conf, tableSchema);
}
private void dropTable() throws IOException {
CTable.dropTable(conf, "SampleTable");
}
Data saving
You can put/get into/from cloudata's table with NTable class. NTable class has put, get method.
RowFilter, CellFilter is used to specify a more complex search condition.
private void putRow() throws IOException {
String tableName = "SampleTable";
//get CTable object
CTable ctable = CTable.openTable(conf, tableName);
//create rowkey object
Row.Key rowKey = new Row.Key("RowKey1");
//create row object
Row row = new Row(rowKey);
//add Cell to row
row.addCell("Column1", new Cell(new Cell.Key("CK1"), "TestData1".getBytes()));
row.addCell("Column2", new Cell(Cell.Key.EMPTY_KEY, "TestData2".getBytes()));
//put method stores data into Tablet
ctable.put(row);
//put another row
row = new Row(new Row.Key("RowKey2"));
row.addCell("Column1", new Cell(new Cell.Key("CK1"), "TestData3".getBytes()));
ctable.put(row);
}
Data retreving
Cloudata has two kinds of data retreving API. Frist is online data retreving. For online operation like web
application you can use get() method in NTable. get() method requires
Row.Key parameter. so If you want to retreive from table for
real-time operation, you must know Row.Key. Cloudata has like and between operation for online data retreving. Like,
between operation return Row array but maxinum number of Cell.Value is
5000. Like operation's Row.Key parameter must have at least 4 bytes.
Second is scanning. Scanner is high speed data retreving tool. You can
scan full or range data fastly with scanner. Scanner is used
InputFormat for Hadoop MapReduce Job.
Online data retreving
private void getRow() throws IOException {
String tableName = "SampleTable";
CTable ctable = CTable.openTable(conf, tableName);
Row row = ctable.get(new Row.Key("RK1"));
List| column1Cells = row.getCellList("Column1");
for(Cell eachCell: column1Cells) {
System.out.println(eachCell.getValue().getValueAsString());
}
//get multiple versoin in a single row-cell
//already 100 versions stored in putRow() method. show FirstApp in examples code
RowFilter rowFilter = new RowFilter(new Row.Key("RowKey10"));
CellFilter cellFilter = new CellFilter("Column1");
cellFilter.setStartTimestamp(Long.MIN_VALUE);
cellFilter.setEndTimestamp(Long.MAX_VALUE);
rowFilter.addCellFilter(cellFilter);
row = ctable.get(rowFilter);
Cell cell = row.getCellList("Column1").get(0);
for(Cell.Value eachValue: cell.getValues()) {
System.out.println(eachValue.getValueAsString());
}
//like operation, where rowkey = 'RowKey%'
RowFilter likeRowFilter = new RowFilter(new Row.Key("RowKey"), RowFilter.OP_LIKE);
likeRowFilter.addCellFilter(new CellFilter("Column1"));
rowFilter.addCellFilter(cellFilter);
Row[] rows = ctable.gets(likeRowFilter);
if(rows == null || rows.length == 0) {
System.out.println("No data");
} else {
for(Row eachRow: rows) {
cell = eachRow.getCellList("Column1").get(0);
for(Cell.Value eachValue: cell.getValues()) {
System.out.println(eachValue.getValueAsString());
}
}
}
} |
Scanning
Scanner is optimized batch processing.
private void scanning() throws IOException {
CTable ctable = CTable.openTable(conf, tableName);
TableScanner scanner = null;
try {
scanner = ScannerFactory.openScanner(ctable, ctable.getColumnsArray());
System.out.println("---------- scan by ScanCell -----------");
ScanCell scanCell = null;
while( (scanCell = scanner.next()) != null ) {
System.out.println(scanCell.toString());
}
} finally {
//must close
if(scanner != null) {
scanner.close();
}
}
scanner = null;
try {
scanner = ScannerFactory.openScanner(ctable, ctable.getColumnsArray());
System.out.println("---------- scan by Row -----------");
Row row = null;
while( (row = scanner.nextRow()) != null ) {
row.print("Column1");
}
} finally {
//must close
if(scanner != null) {
scanner.close();
}
}
}


You have seen the basic structure of a C program, so it will be easy to understand other basic building blocks of the C programming language.
A C program consists of various tokens and a token is either a keyword, an identifier, a constant, a string literal, or a symbol. For example, the following C statement consists of five tokens −
printf("Hello, World! \n");
The individual tokens are −
printf ( "Hello, World! \n" ) ;
In a C program, the semicolon is a statement terminator. That is, each individual statement must be ended with a semicolon. It indicates the end of one logical entity.
Given below are two different statements −
printf("Hello, World! \n"); return 0;
Comments are like helping text in your C program and they are ignored by the compiler. They start with /* and terminate with the characters */ as shown below −
/* my first program in C */
You cannot have comments within comments and they do not occur within a string or character literals.
A C identifier is a name used to identify a variable, function, or any other user-defined item. An identifier starts with a letter A to Z, a to z, or an underscore '_' followed by zero or more letters, underscores, and digits (0 to 9).
C does not allow punctuation characters such as @, $, and % within identifiers. C is a case-sensitive programming language. Thus, Manpower and manpower are two different identifiers in C. Here are some examples of acceptable identifiers −
mohd zara abc move_name a_123 myname50 _temp j a23b9 retVal
The following list shows the reserved words in C. These reserved words may not be used as constants or variables or any other identifier names.
| auto | else | long | switch |
| break | enum | register | typedef |
| case | extern | return | union |
| char | float | short | unsigned |
| const | for | signed | void |
| continue | goto | sizeof | volatile |
| default | if | static | while |
| do | int | struct | _Packed |
| double |
A line containing only whitespace, possibly with a comment, is known as a blank line, and a C compiler totally ignores it.
Whitespace is the term used in C to describe blanks, tabs, newline characters and comments. Whitespace separates one part of a statement from another and enables the compiler to identify where one element in a statement, such as int, ends and the next element begins. Therefore, in the following statement −
int age;
there must be at least one whitespace character (usually a space) between int and age for the compiler to be able to distinguish them. On the other hand, in the following statement −
fruit = apples + oranges; // get the total fruit
no whitespace characters are necessary between fruit and =, or between = and apples, although you are free to include some if you wish to increase readability.


---
layout: post
title: '9/9 progress '
date: '2013-09-09T21:21:00.002-06:00'
author: Jacob .
tags:
- progress-reports
- progress
modified_time: '2013-09-09T21:21:50.639-06:00'
blogger_id: tag:blogger.com,1999:blog-6400085873105072120.post-5294300572476010940
blogger_orig_url: http://www.svlark.com/2013/09/99-progress.html
---
We got our Rosetta Stone Spanish stuff today. Can't wait to get into it. It's such a cool program.
We did our homeschool retro and planning meeting yesterday.
I've been learning lots from Seaworthy Offshore Sailboat: A Guide to Essential Features, Handling, and Gear.


We met the Primetime robotics team, they are a 3rd year team and we had a meeting with them where we asked them to show us how to use Git. We learned that we can use either Bitbucket or Github. We asked a bunch of questions about the engineering notebook and what happens at the competition. We also asked a few questions on the website, for example we were wondering how they made their website. We asked how many controllers they used, and what way of code did they do. They taught us about things to know about FTC and gave us tips. While we taught them how to use CAD, a 3-D modeling app.
Vist their website here.


UseRoutingMiddleware
Index
測試連結
GET
/package/create/3
/package/track/-3
/package/track/
/hello/Joe
/hello/Joe/Smith
POST
/hello/Joe
/hi/John


Does Swades arrange airport pick-up for new students?
Swades can share links from where reasonable pick-up can be arranged.
Incase a student volunteer is available on the date and time of your arrival, a pick-up can be arranged
What are amongst the first things that I must do on arrival at SCU?
Do I have to bring my International Driving License (IDP) / Indian License?
There is no harm in getting your International Driving License (IDP) or Indian License. You can use your IDP and drive for 1 year in the US and you can use your Indian License and drive for 6 months (Please check the official DMV website for the latest news on these durations) Having your IDP or Indian License, you can use them to get Zipcar membership from which you can rent a car and go grocery shopping or nearby places if you wish to.
When can I start my internship? When am I eligible for an internship?
On F-1 Visa, you will have to do 3 consecutive quarters of full-time course-work to be eligible (8 units per quarter for engineering and 9 unit per quarter for MSIS/MBA), and then you will be eligible for doing an internship.
You can work 40hrs/week during the summer quarter and 20hrs/week during any other quarter when you have course-work.
Who are Advisor, what do they do?
Advisors are professors who are here to help you with your course work and what courses to take.
For few majors (eg: CS), SCU assigns you an advisor and for other majors (eg: EE), you can choose your advisor after coming to US within a month.
Advisors are important for approving your Program of Studies.
Please always stay in touch with your advisors.
Should I get a Laptop from India or should I buy a laptop on coming to the US?
If you already own a laptop in India, and plan to use that in the future, get it with you. If you are planning to buy a new one, buy one from the US.
There are 2 reasons for this:


The adventure
With my scarf rapped around my neck, I walked into the old lab in which I use to be the person that opens the labs so I have the keys and the door code to enter.
I dropped all of bags on the table and lightly placed my glass bottle on the table. This reminds me of my final year project days when we use to fight the war. However, my mind was quite occupied with the work that I needed to complete, so I headed on.
After a couple of pages into my textbook, I laid back into my seat. Dropped my back rest and slide down so that my head can rest on the top of the seat. Now I started to feel my surroundings and my memories started to drip in bit by bit.
The first time, I took Apple into this lab was the first day that our fire of affinity started to burn. That day was so unexpected. I remember that morning to also be really cold… this is what happened that day…
I was walking back from the small coffee shop around the corner to the building of the labs when I decided to take a sneaky route. On the way, I heard someone call my name
I was surprised to hear anyone call my name during this time of the morning. It was around 6:45am. I am always that early bird because of my distance from home.
So I turned around to see this long silky haired girl and short, calling me. It was obviously Apple. We knew each other since high school when we use to play chess. So I greeted her back with a hug and said "Good morning"
So she told me that it is interesting because she never knew about this route that I am about to take even though she has been around for awhile now.
So we hopped along to my labs. I found it somewhat interesting that she followed me all the way to my labs. It was very unexpected but because she did that, I found it a lot easier to converse with her. I am a person that really doesn’t mind awkward moments. I tend to just go with the flow and then evaluate for myself later how I feel about the situation that just passed. I opened the security steel gate. With one hand on the handle of the door and my body leaned against the door, I told her that it’s a bit messy. Then I opened the door as she answered "Its ok" She gazed around and told me that it isn’t actually messy at all.
I showed her around to the room. Pointed out where the foosball table was, where we would normally sit to work. We ended up standing at the front of the room. I can’t really remember if I got her number that day or not but from day day onwards, I had her number. The last thing I did with her that day was walking her out.
My Thoughts
This is when my feelings took me back to the initial "happy feeling" when I saw her for the first time. I started taking an objective perspective of this situation to see what it actually is that is happening to my psychological self.
Why was I missing her? What makes me feel like I miss her? I came to the realisation that the things around me is stimulating the memory that I have of her. Which is then bringing up the feeling I have about her. Then the next set of questions started to pop up in my mind. Why are these things causing my brain to bring back such memories? Such feelings?
It seems like people tend to remember feelings a lot stronger than logical procedures of action. Feelings and emotions has a deeper meaning to us than anything else. Which starts to make sense why a lot of people cannot let go of different objects in their lives because of the memories they hold onto. Some people have their grand parent’s ashes strapped around their neck. Some people kept their childhood teddy bear that is already been stripped into pieces steadily placed on their top shelf. Fascinatingly, these objects tell us a lot about their emotional journey that they have been through.
People are emotional beings that get attached to events. Objects in our lives remind us of our feelings that we had when we were going through such experiences.
Thinking about this concept, I started to evaluate people around me. I seem to see a lot of people who base their actions on their accumulated emotions about someone. These accumulations all start from the first impression of someone.
When we are already angry with someone, it makes it really difficult to continue the conversation whenever we have to communicate with them. I can relate to that a lot in my life. The same can be applied to a lot of scenarios in my friends lives. What I seem to find interesting about this is that it is actually really hard to let go of the emotions we use to have about someone and face them as a totally new person. Even if the person has completely changed, we will still grip onto a lot of those emotions that we unravelled with the person.
When the scripts say that we should keep our enemies closer than our friends, we basically failing to do that every time we meet someone that we hate. We need to let go. We need to let go of our attachments. We need to give people a chance. We need to forgive people. We need to treat everyone like the creation of God.
These statements are easy to say, yet so difficult to do. Especially during the interaction with that particular person that burns your flames of anger. Can we respect someone that we hate? Can we respect someone that frustrates us? Can we forgive someone that hurt us before? Can we love someone just like how God loves us?
I am sure this ocean will let me know the meaning of life once I am ready for it…


|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ConstrainedElement
Represents a (potentially) constrained Java element such as a type, field or
method. Such an element has a set of MetaConstraint
s and can be
marked for a cascaded validation. Furthermore each constrained element has a
configuration source
which determines its origin.
The hierarchy of constrained elements resembles the physical structure of the represented Java types. In particular it doesn't provide the notion of properties and it doesn't aggregate meta data for overridden elements in an inheritance hierarchy.
Identity of implementations is based on the element location and constraint source. That means that for instance in a set there can be two configurations for one and the same Java field created by two different configuration sources (e.g. via annotation and XML) but not two configurations for the same field originating from one configuration source.
Implementations are strictly read-only.
| Nested Class Summary | |
|---|---|
static class |
ConstrainedElement.ConstrainedElementKind
The kind of a ConstrainedElement . |
| Method Summary | |
|---|---|
Set<MetaConstraint<?>> |
getConstraints()
Returns a set containing the constraints specified for this constrained element. |
Map<Class<?>,Class<?>> |
getGroupConversions()
Returns a map with the group conversions for this constrained element, as e.g. |
ConstrainedElement.ConstrainedElementKind |
getKind()
Returns the kind of this constrained element. |
ConstraintLocation |
getLocation()
Returns the location of this constrained element. |
boolean |
isCascading()
Whether cascading validation for the represented element shall be performed or not. |
boolean |
isConstrained()
Whether this element is constrained or not. |
| Methods inherited from interface java.lang.Iterable |
|---|
iterator |
| Method Detail |
|---|
ConstrainedElement.ConstrainedElementKind getKind()
ConstraintLocation getLocation()
Set<MetaConstraint<?>> getConstraints()
null
.Map<Class<?>,Class<?>> getGroupConversions()
@ConvertGroup
annotation.
null
.boolean isCascading()
True
, if cascading validation for the represented
element shall be performed, false
otherwise.boolean isConstrained()
True
, if this element is constrained,
false
otherwise.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |


Eventasia
Please sign in or create a new account
Email address
Password
Sign In
Create New Account
Sign In With Google
Sign In With Twitter
Logout
Events
TicketMaster
Stubhub
Enter Preferences
Location
How many Events
Submit
Group 3


Negative Numbers in Combinatorics
I came across Negative Numbers in Combinatorics while working on STA 732 HW1.
Suppose a set S has n elements, number of subsets of S of size k is:
\begin{equation*} {n \choose k} = \frac{n(n-1) \dots (n-k+1)}{k!}. \end{equation*}
Now if there were a set with -2 number of element, how many subsets of size 3 would it have? We can try naively applying the same formula:
\begin{equation*} {-2 \choose 3} = \frac{(-2)(-3)(-4)}{3!} = -4. \end{equation*}
This gives us a number, but how to understand it?
Note that a set, by definition can only consist of unique elements. here we introduce the notion of multisets, with unbounded multiplicity. For example, the following are three different and yet valid multisets: {x,x}, {x,y}, and {y,y}.
Now coming back to the question above, let S = {x,y}, where both x and y are “negative elements”, i.e., they can be selected more than once into a multiset. Then the unique subsets of S of size 3 are: {x,x,x}, {y,y,y}, {x,x,y}, {x,y,y}, a total of 4, which matches with the number 4 we got above. But what about the negative sign？ Here let’s say that a multiset with k negative elements has weight of \((-1)^k\). And hence we have
Theorem: For a set S with m negative elements, \({-m \choose k}\) is the sum of the weights of all the k-element multiset-subsets of S.
Proof:
\[\begin{aligned} {-m \choose k} &= \frac{(-m)(-m-1) \dots (-m-k+1)}{k!} \\ &= (-1)^k {m+k-1 \choose k}. \end{aligned}\]Now we need to show that the number of unique multisets by choosing k from m elements, is indeed \({m+k-1 \choose k}\). We can use a counting method called “stars and bars”. This might be rather basic, but it’s the first time I come across this idea. I find it quite interesting.
Now think about choosing k from 2 negative elements. As the order doesn’t matter here, this is equivalent to … imagine we have k stars, lying in one line
\[* * * \dots * * *\]We want to put one bar in between to separate these stars into two groups, for example this is one possibility:
\[* | * * \dots * * *\]How many different ways are there to place this bar? This is exactly equivalent to the problem above. Here there are a total of (k+1) places for me to place this bar, and hence it’s \({k+1 \choose 1} = {2+k-1 \choose 2-1}\) number of different possibilities. And if we generalize it an (m choose k) problem, obviously the answer is
\[{m+k-1 \choose m-1} = {m+k-1 \choose k}.\]This completes the proof.
This also works for hybrid sets, i.e., sets with both positive and negative elements:
- a positive element can only be chosen once, with weight 1
- a negative element can be chosen any number of times, with weight (-1)
For example, consider a set S = {a, x, y} where a is a positive element, while x and y are negative elements. In total S has (-1) elements. So how many subsets (potentially multisets) of size 3 does S have?
- For subsets with only negative elements, each subset/ multiset has weight of \((-1)^3 = (-1)\) and there are a total of 4 subsets
- For subsets with one positive element a, and two negative elements, the weight is 1, and there are a total of 3 subsets.
- All together, the sum of the weights of all the unique subsets is 3-4=-1. This is same as \(-1 \choose 3\).
This is where I decided to stop. I did not try to further prove the case for hybrid sets.
References:
- For general understanding of this concept: http://faculty.uml.edu/jpropp/msri-up12.pdf
- For the “stars and bars” technique: https://brilliant.org/wiki/integer-equations-star-and-bars/


Adrienne L. Massanari
"personas serve to reinscribe the conceptual separation between the user and designer despite technological developments (like Web 2.0) that blur this boundary"


Harvard-Yale game delayed by on-field protest
by ReutersA climate change protest got in the way of Harvard and Yale’s historic Ivy League football rivalry game on Saturday, as activists delayed the start of the second half by running onto the field in New Haven, Conn.
With the Crimson taking a 15-3 lead into the locker room at halftime, protesters from both schools went to midfield at around 1:40 p.m. ET following the performance by the Yale band. The group eventually grew from a few dozen into the hundreds, and after the field was cleared, the game was resumed at 2:48 p.m. ET.
Written on one of the several banners carried onto the field was, “”Nobody wins. Yale & Harvard are complicit in climate injustice.”
Players who were warming up for the second half returned to their locker rooms until order was restored.
ESPN reported that a number of protesters tied themselves together and asked to be arrested. Some of the spectators were taken off the field by police. A few remaining protesters who stayed on or around the field after order was restored were told by Yale Police Chief Ronnell Higgins they would be arrested.
According to Harvard student Caleb Schwartz, who is a spokesman for the group Divest Harvard, the protest has been planned for months.
“This is a very deliberate choice of targeting this specific to get our action out there,” Schwartz told ESPN’s Paul Kix.
Harvard and Yale went on to finish the 136th edition of their rivalry called “The Game,” which the Bulldogs won 50-43 in overtime.
–Field Level Media