Guest User

Untitled

a guest
Jun 18th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.58 KB | None | 0 0
  1. } catch (FooException e) {
  2. //do something
  3. } catch (BarException e) {
  4. //do something
  5. } catch (Exception e) {
  6. throw e;
  7. }
  8.  
  9. } catch (FooException e) {
  10. //do something
  11. } catch (BarException e) {
  12. //do something
  13. }
  14.  
  15. if (!(flag == false))
  16.  
  17. if (flag)
  18.  
  19. if (x == 1)
  20. return true;
  21. else
  22. return false;
  23.  
  24. return (x == 1);
  25.  
  26. <div class="red">Error message!</div>
  27.  
  28. red { color: #f00; }
  29.  
  30. <div class="red yellowback">Error message 2.0!</div>
  31.  
  32. <div class="yellowback">
  33. <h1 class="red">Error message 3.0!</h1>
  34. </div>
  35.  
  36. <div id="errormessages">Error message!</div>
  37.  
  38. <p id="errormessages">Error message!</p>
  39.  
  40. #errormessages {
  41. color: #f00;
  42. background-color: #ff0;
  43. }
  44.  
  45. } catch (Exception e) {
  46. throw e;
  47. }
  48.  
  49. strcpy(label, "");
  50. strcpy(comm1, ""); //!!!20060818 Added protective code for missing nulls
  51. strcpy(comm2, "");
  52. strcpy(dir, "");
  53.  
  54. label[0] = '';
  55.  
  56. strncpy(inq.szComment, "", 1);
  57.  
  58. // This is always good for string operations, but may not be necessary.
  59. strcat(RpRecPrefix, "");
  60. strcat(RpCircPrefix, "");
  61. strcat(RpEventPrefix, "");
  62. strcat(RpFdk, "");
  63. strcat(RpAic, "");
  64. strcat(RpDcl, "");
  65. strcat(RpVis, "");
  66. strcat(RpSnd, "");
  67. strcat(RpL3Fsi, "");
  68. strcat(RpStartState, "");
  69. strcat(RpContRun, "");
  70.  
  71. if ( *pnFrequency == 1 ) {
  72. sprintf(szLogMsg, "Write to disk speed = %d bytes/sec at 1 Hz",
  73. *pliWriteRate);
  74. }
  75. else if ( *pnFrequency == 2 ) {
  76. sprintf(szLogMsg, "Write to disk speed = %d bytes/sec at 2 Hz",
  77. *pliWriteRate);
  78. }
  79. else if ( *pnFrequency == 4 ) {
  80. sprintf(szLogMsg, "Write to disk speed = %d bytes/sec at 4 Hz",
  81. *pliWriteRate);
  82. }
  83. else if ( *pnFrequency == 10 ) {
  84. sprintf(szLogMsg, "Write to disk speed = %d bytes/sec at 10 Hz",
  85. *pliWriteRate);
  86. }
  87. else if ( *pnFrequency == 20 ) {
  88. sprintf(szLogMsg, "Write to disk speed = %d bytes/sec at 20 Hz",
  89. *pliWriteRate);
  90. }
  91. else if ( *pnFrequency == 40 ) {
  92. sprintf(szLogMsg, "Write to disk speed = %d bytes/sec at 40 Hz",
  93. *pliWriteRate);
  94. }
  95. else if ( *pnFrequency == 60 ) {
  96. sprintf(szLogMsg, "Write to disk speed = %d bytes/sec at 60 Hz",
  97. *pliWriteRate);
  98. }
  99. else { // above frequencies used for analysis
  100. sprintf(szLogMsg, "Write to disk speed = %d bytes/sec", *pliWriteRate);
  101. }
  102.  
  103. sprintf(szLogMsg, "Write to disk speed = %d bytes/sec at %d Hz", *pliWriteRate,
  104. *pnFrequency);
  105.  
  106. for each listItem1 in list1
  107. for each listItem2 in list2
  108. if listItem1.value1 = listItem2.value2
  109. listSimilarItems.add(listItem1)
  110. end
  111. end
  112.  
  113. listSimilarItems = (from items in list1 where list1.value1 = list2.value2).tolist
  114.  
  115. Foo x = null;
  116. if(something != null) {
  117. x = something;
  118. } else {
  119. x = default;
  120. }
  121.  
  122. Foo x = something != null ? something : default;
  123.  
  124. Foo x = if(something != null) something else default;
  125.  
  126. List<String> list = new ArrayList<String>();
  127. list.add("Foo");
  128. list.add("Bar");
  129.  
  130. List<String> list = Arrays.asList("Foo", "Bar");
  131.  
  132. public CollectionUtils {
  133. public static List<T> createMutableList(T ... elements) {
  134. List<T> list = new ArrayList<T>();
  135.  
  136. for(T elem : elements) list.add(elem);
  137.  
  138. return list;
  139. }
  140. }
  141.  
  142. import static CollectionUtils.createMutableList;
  143. List<String> list = createMutableList("Foo", "Bar");
  144.  
  145. (bColour)?bColour=false:bColour=true; //could have done (i%2!=0)?bColour=true:bColour=false;
  146.  
  147. bColour = !bColour; //could have done bColour=(i%2!=0);
  148.  
  149. dim str
  150. if(predicate)
  151. str = "a"
  152. else
  153. str = "b"
  154. end
  155.  
  156. String str = iff(predicate, "a", "b")
  157.  
  158. if(foo == bar) {
  159. count++;
  160. }
  161.  
  162. count += (foo == bar);
Add Comment
Please, Sign In to add comment