| 1 | /* | |
| 2 | * Copyright 2012 The Closure Compiler Authors. | |
| 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 | ||
| 17 | package com.google.javascript.jscomp; | |
| 18 | ||
| 19 | import java.io.PrintStream; | |
| 20 | import java.lang.management.CompilationMXBean; | |
| 21 | import java.lang.management.GarbageCollectorMXBean; | |
| 22 | import java.lang.management.ManagementFactory; | |
| 23 | import java.lang.management.MemoryMXBean; | |
| 24 | import java.lang.management.MemoryPoolMXBean; | |
| 25 | import java.lang.management.MemoryUsage; | |
| 26 | import java.util.List; | |
| 27 | import java.util.StringTokenizer; | |
| 28 | ||
| 29 | /** | |
| 30 | * A class to report jvm/jmx statistics. | |
| 31 | * Borrowed from: | |
| 32 | * http://code.google.com/p/dart/source/browse/trunk/dart/compiler/java/com/google/dart/compiler/metrics/JvmMetrics.java | |
| 33 | */ | |
| 34 | class JvmMetrics { | |
| 35 | ||
| 36 | private static int TABULAR_COLON_POS = 40; | |
| 37 | private static long ONE_KILO_BYTE = 1L << 10L; | |
| 38 | private static long ONE_MEGA_BYTE = 1L << 20L; | |
| 39 | private static long ONE_GIGA_BYTE = 1L << 30L; | |
| 40 | ||
| 41 | public static void maybeWriteJvmMetrics(PrintStream out, String options) { | |
| 42 |
1
1. maybeWriteJvmMetrics : negated conditional → NO_COVERAGE |
if (options == null) { |
| 43 | return; | |
| 44 | } | |
| 45 | ||
| 46 | boolean verboseMode = false; | |
| 47 | boolean prettyMode = false; | |
| 48 | StringTokenizer st = new StringTokenizer(options, ":"); | |
| 49 | // options are grouped in order 'detail:format:types' | |
| 50 |
1
1. maybeWriteJvmMetrics : negated conditional → NO_COVERAGE |
if (st.hasMoreTokens()) { |
| 51 | String mode = st.nextToken(); | |
| 52 |
1
1. maybeWriteJvmMetrics : negated conditional → NO_COVERAGE |
if (mode.equalsIgnoreCase("verbose")) { |
| 53 | verboseMode = true; | |
| 54 | } | |
| 55 | } | |
| 56 | ||
| 57 |
1
1. maybeWriteJvmMetrics : negated conditional → NO_COVERAGE |
if (st.hasMoreTokens()) { |
| 58 | String mode = st.nextToken(); | |
| 59 |
1
1. maybeWriteJvmMetrics : negated conditional → NO_COVERAGE |
if (mode.equalsIgnoreCase("pretty")) { |
| 60 | prettyMode = true; | |
| 61 | } | |
| 62 | } | |
| 63 | ||
| 64 |
1
1. maybeWriteJvmMetrics : negated conditional → NO_COVERAGE |
if (st.hasMoreTokens()) { |
| 65 |
1
1. maybeWriteJvmMetrics : negated conditional → NO_COVERAGE |
while (st.hasMoreTokens()) { |
| 66 | String types = st.nextToken(); | |
| 67 | StringTokenizer typeSt = new StringTokenizer(types, ","); | |
| 68 |
1
1. maybeWriteJvmMetrics : negated conditional → NO_COVERAGE |
while (typeSt.hasMoreElements()) { |
| 69 | String type = typeSt.nextToken(); | |
| 70 |
1
1. maybeWriteJvmMetrics : removed call to com/google/javascript/jscomp/JvmMetrics::writeMetrics → NO_COVERAGE |
writeMetrics(out, type, verboseMode, prettyMode); |
| 71 | } | |
| 72 | } | |
| 73 | } else { | |
| 74 | // the default | |
| 75 |
1
1. maybeWriteJvmMetrics : removed call to com/google/javascript/jscomp/JvmMetrics::writeMetrics → NO_COVERAGE |
writeMetrics(out, "all", verboseMode, prettyMode); |
| 76 | } | |
| 77 | } | |
| 78 | ||
| 79 | private static void writeMetrics( | |
| 80 | PrintStream out, String type, boolean verbose, boolean pretty) { | |
| 81 | ||
| 82 |
2
1. writeMetrics : negated conditional → NO_COVERAGE 2. writeMetrics : negated conditional → NO_COVERAGE |
if (type.equals("gc") || type.equalsIgnoreCase("all")) { |
| 83 |
1
1. writeMetrics : removed call to com/google/javascript/jscomp/JvmMetrics::writeGarbageCollectionStats → NO_COVERAGE |
writeGarbageCollectionStats(out, verbose, pretty); |
| 84 | } | |
| 85 |
2
1. writeMetrics : negated conditional → NO_COVERAGE 2. writeMetrics : negated conditional → NO_COVERAGE |
if (type.equals("mem") || type.equalsIgnoreCase("all")) { |
| 86 |
1
1. writeMetrics : removed call to com/google/javascript/jscomp/JvmMetrics::writeMemoryMetrics → NO_COVERAGE |
writeMemoryMetrics(out, verbose, pretty); |
| 87 | } | |
| 88 |
2
1. writeMetrics : negated conditional → NO_COVERAGE 2. writeMetrics : negated conditional → NO_COVERAGE |
if (type.equals("jit") || type.equalsIgnoreCase("all")) { |
| 89 |
1
1. writeMetrics : removed call to com/google/javascript/jscomp/JvmMetrics::writeJitMetrics → NO_COVERAGE |
writeJitMetrics(out, verbose, pretty); |
| 90 | } | |
| 91 | } | |
| 92 | ||
| 93 | private static void writeJitMetrics( | |
| 94 | PrintStream out, boolean verbose, boolean pretty) { | |
| 95 | ||
| 96 | CompilationMXBean cBean = ManagementFactory.getCompilationMXBean(); | |
| 97 | ||
| 98 | String name; | |
| 99 |
1
1. writeJitMetrics : negated conditional → NO_COVERAGE |
if (verbose) { |
| 100 | name = cBean.getName(); | |
| 101 | } else { | |
| 102 | name = "total"; | |
| 103 | } | |
| 104 | ||
| 105 |
1
1. writeJitMetrics : negated conditional → NO_COVERAGE |
if (pretty) { |
| 106 |
1
1. writeJitMetrics : removed call to java/io/PrintStream::println → NO_COVERAGE |
out.println("\nJIT Stats"); |
| 107 |
1
1. writeJitMetrics : removed call to java/io/PrintStream::println → NO_COVERAGE |
out.println(String.format( |
| 108 | "\t%s jit time: %d ms", name, cBean.getTotalCompilationTime())); | |
| 109 | } else { | |
| 110 |
1
1. writeJitMetrics : removed call to java/io/PrintStream::println → NO_COVERAGE |
out.println(normalizeTabularColonPos(String.format("%s-jit-time-ms : %d", |
| 111 | normalizeName(name), cBean.getTotalCompilationTime()))); | |
| 112 | } | |
| 113 | } | |
| 114 | ||
| 115 | private static void writeOverallMemoryUsage( | |
| 116 | PrintStream out, MemoryUsage usage, String prefix, boolean pretty) { | |
| 117 |
1
1. writeOverallMemoryUsage : negated conditional → NO_COVERAGE |
if (pretty) { |
| 118 | out.format("\t%s\n", prefix); | |
| 119 | out.format("\t\tavailable : %s\n", formatBytes(usage.getMax())); | |
| 120 | out.format("\t\tcurrent : %s\n", formatBytes(usage.getUsed())); | |
| 121 | } else { | |
| 122 | prefix = normalizeName(prefix); | |
| 123 |
1
1. writeOverallMemoryUsage : removed call to java/io/PrintStream::println → NO_COVERAGE |
out.println(normalizeTabularColonPos( |
| 124 | String.format(prefix + "-available-bytes : %d", usage.getMax()))); | |
| 125 |
1
1. writeOverallMemoryUsage : removed call to java/io/PrintStream::println → NO_COVERAGE |
out.println(normalizeTabularColonPos( |
| 126 | String.format(prefix + "-current-bytes : %d", usage.getUsed()))); | |
| 127 | } | |
| 128 | } | |
| 129 | ||
| 130 | private static void writePoolMemoryUsage(PrintStream out, MemoryUsage usage, | |
| 131 | MemoryUsage peakUsage, String prefix, boolean pretty) { | |
| 132 |
1
1. writePoolMemoryUsage : negated conditional → NO_COVERAGE |
if (pretty) { |
| 133 | out.format("\t\tavailable : %s\n", | |
| 134 | formatBytes(usage.getMax())); | |
| 135 | out.format("\t\tpeak : %s\n", | |
| 136 | formatBytes(peakUsage.getUsed())); | |
| 137 | out.format("\t\tcurrent : %s\n", | |
| 138 | formatBytes(usage.getUsed())); | |
| 139 | } else { | |
| 140 |
1
1. writePoolMemoryUsage : removed call to java/io/PrintStream::println → NO_COVERAGE |
out.println(normalizeTabularColonPos( |
| 141 | String.format(prefix + "-available-bytes : %d", usage.getMax()))); | |
| 142 |
1
1. writePoolMemoryUsage : removed call to java/io/PrintStream::println → NO_COVERAGE |
out.println(normalizeTabularColonPos( |
| 143 | String.format(prefix + "-peak-bytes : %d", peakUsage.getUsed()))); | |
| 144 |
1
1. writePoolMemoryUsage : removed call to java/io/PrintStream::println → NO_COVERAGE |
out.println(normalizeTabularColonPos( |
| 145 | String.format(prefix + "-current-bytes : %d", usage.getUsed()))); | |
| 146 | } | |
| 147 | } | |
| 148 | ||
| 149 | private static void writeMemoryMetrics( | |
| 150 | PrintStream out, boolean verbose, boolean pretty) { | |
| 151 |
1
1. writeMemoryMetrics : negated conditional → NO_COVERAGE |
if (pretty) { |
| 152 |
1
1. writeMemoryMetrics : removed call to java/io/PrintStream::println → NO_COVERAGE |
out.println("\nMemory usage"); |
| 153 | } | |
| 154 | ||
| 155 | // only show overall stats in verbose mode | |
| 156 |
1
1. writeMemoryMetrics : negated conditional → NO_COVERAGE |
if (verbose) { |
| 157 | MemoryMXBean overallMemBean = ManagementFactory.getMemoryMXBean(); | |
| 158 | MemoryUsage usage = overallMemBean.getHeapMemoryUsage(); | |
| 159 |
1
1. writeMemoryMetrics : removed call to com/google/javascript/jscomp/JvmMetrics::writeOverallMemoryUsage → NO_COVERAGE |
writeOverallMemoryUsage(out, usage, "Heap", pretty); |
| 160 | ||
| 161 | usage = overallMemBean.getNonHeapMemoryUsage(); | |
| 162 |
1
1. writeMemoryMetrics : removed call to com/google/javascript/jscomp/JvmMetrics::writeOverallMemoryUsage → NO_COVERAGE |
writeOverallMemoryUsage(out, usage, "Non-heap", pretty); |
| 163 | } | |
| 164 | ||
| 165 |
1
1. writeMemoryMetrics : negated conditional → NO_COVERAGE |
if (verbose) { |
| 166 | List<MemoryPoolMXBean> mpBeans = ManagementFactory.getMemoryPoolMXBeans(); | |
| 167 | for (MemoryPoolMXBean mpBean : mpBeans) { | |
| 168 | MemoryUsage currentUsage = mpBean.getUsage(); | |
| 169 | MemoryUsage peakUsage = mpBean.getPeakUsage(); | |
| 170 |
1
1. writeMemoryMetrics : negated conditional → NO_COVERAGE |
if (pretty) { |
| 171 |
1
1. writeMemoryMetrics : removed call to java/io/PrintStream::println → NO_COVERAGE |
out.println("\tPool " + mpBean.getName()); |
| 172 |
1
1. writeMemoryMetrics : removed call to com/google/javascript/jscomp/JvmMetrics::writePoolMemoryUsage → NO_COVERAGE |
writePoolMemoryUsage(out, currentUsage, peakUsage, null, true); |
| 173 | } else { | |
| 174 |
1
1. writeMemoryMetrics : removed call to com/google/javascript/jscomp/JvmMetrics::writePoolMemoryUsage → NO_COVERAGE |
writePoolMemoryUsage(out, currentUsage, peakUsage, |
| 175 | "mem-pool-" + normalizeName(mpBean.getName()), false); | |
| 176 | } | |
| 177 | } | |
| 178 | } else { | |
| 179 | long available = 0; | |
| 180 | long current = 0; | |
| 181 | long peak = 0; | |
| 182 | List<MemoryPoolMXBean> mpBeans = ManagementFactory.getMemoryPoolMXBeans(); | |
| 183 | for (MemoryPoolMXBean mpBean : mpBeans) { | |
| 184 | MemoryUsage currentUsage = mpBean.getUsage(); | |
| 185 |
1
1. writeMemoryMetrics : Replaced long addition with subtraction → NO_COVERAGE |
available += currentUsage.getMax(); |
| 186 |
1
1. writeMemoryMetrics : Replaced long addition with subtraction → NO_COVERAGE |
current += currentUsage.getUsed(); |
| 187 | MemoryUsage peakUsage = mpBean.getPeakUsage(); | |
| 188 |
1
1. writeMemoryMetrics : Replaced long addition with subtraction → NO_COVERAGE |
peak += peakUsage.getUsed(); |
| 189 | } | |
| 190 | MemoryUsage summaryUsage = new MemoryUsage( | |
| 191 | 0, current, current, available); | |
| 192 | MemoryUsage summaryPeakUsage = new MemoryUsage(0, peak, peak, peak); | |
| 193 |
1
1. writeMemoryMetrics : negated conditional → NO_COVERAGE |
if (pretty) { |
| 194 | out.format("\tAggregate of %d memory pools\n", mpBeans.size()); | |
| 195 |
1
1. writeMemoryMetrics : removed call to com/google/javascript/jscomp/JvmMetrics::writePoolMemoryUsage → NO_COVERAGE |
writePoolMemoryUsage(out, summaryUsage, summaryPeakUsage, null, true); |
| 196 | } else { | |
| 197 |
1
1. writeMemoryMetrics : removed call to com/google/javascript/jscomp/JvmMetrics::writePoolMemoryUsage → NO_COVERAGE |
writePoolMemoryUsage(out, summaryUsage, summaryPeakUsage, "mem", false); |
| 198 | } | |
| 199 | } | |
| 200 | } | |
| 201 | ||
| 202 | private static void writeGarbageCollectionStats( | |
| 203 | PrintStream out, boolean verbose, boolean pretty) { | |
| 204 | List<GarbageCollectorMXBean> gcBeans = | |
| 205 | ManagementFactory.getGarbageCollectorMXBeans(); | |
| 206 | ||
| 207 |
1
1. writeGarbageCollectionStats : negated conditional → NO_COVERAGE |
if (verbose) { |
| 208 |
1
1. writeGarbageCollectionStats : negated conditional → NO_COVERAGE |
if (pretty) { |
| 209 |
1
1. writeGarbageCollectionStats : removed call to java/io/PrintStream::println → NO_COVERAGE |
out.println("\nGarbage collection stats"); |
| 210 | for (GarbageCollectorMXBean gcBean : gcBeans) { | |
| 211 |
1
1. writeGarbageCollectionStats : removed call to java/io/PrintStream::println → NO_COVERAGE |
out.println("\tCollector " + gcBean.getName()); |
| 212 | out.format( | |
| 213 | "\t\tcollection count : %d\n", gcBean.getCollectionCount()); | |
| 214 | out.format( | |
| 215 | "\t\tcollection time : %d ms\n", gcBean.getCollectionTime()); | |
| 216 | } | |
| 217 | } else { | |
| 218 | for (GarbageCollectorMXBean gcBean : gcBeans) { | |
| 219 | String name = normalizeName(gcBean.getName()); | |
| 220 |
1
1. writeGarbageCollectionStats : removed call to java/io/PrintStream::println → NO_COVERAGE |
out.println(normalizeTabularColonPos(String.format("gc-" + name |
| 221 | + "-collection-count : %d", gcBean.getCollectionCount()))); | |
| 222 |
1
1. writeGarbageCollectionStats : removed call to java/io/PrintStream::println → NO_COVERAGE |
out.println(normalizeTabularColonPos(String.format("gc-" + name |
| 223 | + "-collection-time-ms : %d", gcBean.getCollectionTime()))); | |
| 224 | } | |
| 225 | } | |
| 226 | } else { | |
| 227 | long collectionCount = 0; | |
| 228 | long collectionTime = 0; | |
| 229 | int collectorCount = gcBeans.size(); | |
| 230 | for (GarbageCollectorMXBean gcBean : gcBeans) { | |
| 231 |
1
1. writeGarbageCollectionStats : Replaced long addition with subtraction → NO_COVERAGE |
collectionCount += gcBean.getCollectionCount(); |
| 232 |
1
1. writeGarbageCollectionStats : Replaced long addition with subtraction → NO_COVERAGE |
collectionTime += gcBean.getCollectionTime(); |
| 233 | } | |
| 234 |
1
1. writeGarbageCollectionStats : negated conditional → NO_COVERAGE |
if (pretty) { |
| 235 |
1
1. writeGarbageCollectionStats : removed call to java/io/PrintStream::println → NO_COVERAGE |
out.println("\nGarbage collection stats"); |
| 236 | out.format("\tAggregate of %d collectors\n", collectorCount); | |
| 237 | out.format("\t\tcollection count : %d\n", collectionCount); | |
| 238 | out.format("\t\tcollection time : %d ms\n", collectionTime); | |
| 239 | } else { | |
| 240 | String name = normalizeName("aggregate"); | |
| 241 |
1
1. writeGarbageCollectionStats : removed call to java/io/PrintStream::println → NO_COVERAGE |
out.println(normalizeTabularColonPos( |
| 242 | String.format("gc-" + name + "-collection-count : %d", | |
| 243 | collectionCount))); | |
| 244 |
1
1. writeGarbageCollectionStats : removed call to java/io/PrintStream::println → NO_COVERAGE |
out.println(normalizeTabularColonPos( |
| 245 | String.format("gc-" + name + "-collection-time-ms : %d", | |
| 246 | collectionTime))); | |
| 247 | } | |
| 248 | } | |
| 249 | } | |
| 250 | ||
| 251 | private static String normalizeName(String name) { | |
| 252 |
1
1. normalizeName : mutated return of Object value for com/google/javascript/jscomp/JvmMetrics::normalizeName to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return name.replace(" ", "_").toLowerCase(); |
| 253 | } | |
| 254 | ||
| 255 | private static String normalizeTabularColonPos(String string) { | |
| 256 | StringBuilder sb = new StringBuilder(string); | |
| 257 | int index = sb.indexOf(":"); | |
| 258 |
3
1. normalizeTabularColonPos : changed conditional boundary → NO_COVERAGE 2. normalizeTabularColonPos : Changed increment from 1 to -1 → NO_COVERAGE 3. normalizeTabularColonPos : negated conditional → NO_COVERAGE |
for (; index < TABULAR_COLON_POS; ++index) { |
| 259 | sb.insert(index, ' '); | |
| 260 | } | |
| 261 |
1
1. normalizeTabularColonPos : mutated return of Object value for com/google/javascript/jscomp/JvmMetrics::normalizeTabularColonPos to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return sb.toString(); |
| 262 | } | |
| 263 | ||
| 264 | private static String formatBytes(long numBytes) { | |
| 265 |
2
1. formatBytes : changed conditional boundary → NO_COVERAGE 2. formatBytes : negated conditional → NO_COVERAGE |
if (numBytes < ONE_KILO_BYTE) { |
| 266 |
1
1. formatBytes : mutated return of Object value for com/google/javascript/jscomp/JvmMetrics::formatBytes to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return String.format("%d B", numBytes); |
| 267 |
2
1. formatBytes : changed conditional boundary → NO_COVERAGE 2. formatBytes : negated conditional → NO_COVERAGE |
} else if (numBytes < ONE_MEGA_BYTE) { |
| 268 |
2
1. formatBytes : Replaced long division with multiplication → NO_COVERAGE 2. formatBytes : mutated return of Object value for com/google/javascript/jscomp/JvmMetrics::formatBytes to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return String.format("%d KB", numBytes / ONE_KILO_BYTE); |
| 269 |
2
1. formatBytes : changed conditional boundary → NO_COVERAGE 2. formatBytes : negated conditional → NO_COVERAGE |
} else if (numBytes < ONE_GIGA_BYTE) { |
| 270 |
2
1. formatBytes : Replaced long division with multiplication → NO_COVERAGE 2. formatBytes : mutated return of Object value for com/google/javascript/jscomp/JvmMetrics::formatBytes to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return String.format("%d MB", numBytes / ONE_MEGA_BYTE); |
| 271 | } else { | |
| 272 |
2
1. formatBytes : Replaced long division with multiplication → NO_COVERAGE 2. formatBytes : mutated return of Object value for com/google/javascript/jscomp/JvmMetrics::formatBytes to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return String.format("%d GB", numBytes / ONE_GIGA_BYTE); |
| 273 | } | |
| 274 | } | |
| 275 | } | |
Mutations | ||
| 42 |
1.1 |
|
| 50 |
1.1 |
|
| 52 |
1.1 |
|
| 57 |
1.1 |
|
| 59 |
1.1 |
|
| 64 |
1.1 |
|
| 65 |
1.1 |
|
| 68 |
1.1 |
|
| 70 |
1.1 |
|
| 75 |
1.1 |
|
| 82 |
1.1 2.2 |
|
| 83 |
1.1 |
|
| 85 |
1.1 2.2 |
|
| 86 |
1.1 |
|
| 88 |
1.1 2.2 |
|
| 89 |
1.1 |
|
| 99 |
1.1 |
|
| 105 |
1.1 |
|
| 106 |
1.1 |
|
| 107 |
1.1 |
|
| 110 |
1.1 |
|
| 117 |
1.1 |
|
| 123 |
1.1 |
|
| 125 |
1.1 |
|
| 132 |
1.1 |
|
| 140 |
1.1 |
|
| 142 |
1.1 |
|
| 144 |
1.1 |
|
| 151 |
1.1 |
|
| 152 |
1.1 |
|
| 156 |
1.1 |
|
| 159 |
1.1 |
|
| 162 |
1.1 |
|
| 165 |
1.1 |
|
| 170 |
1.1 |
|
| 171 |
1.1 |
|
| 172 |
1.1 |
|
| 174 |
1.1 |
|
| 185 |
1.1 |
|
| 186 |
1.1 |
|
| 188 |
1.1 |
|
| 193 |
1.1 |
|
| 195 |
1.1 |
|
| 197 |
1.1 |
|
| 207 |
1.1 |
|
| 208 |
1.1 |
|
| 209 |
1.1 |
|
| 211 |
1.1 |
|
| 220 |
1.1 |
|
| 222 |
1.1 |
|
| 231 |
1.1 |
|
| 232 |
1.1 |
|
| 234 |
1.1 |
|
| 235 |
1.1 |
|
| 241 |
1.1 |
|
| 244 |
1.1 |
|
| 252 |
1.1 |
|
| 258 |
1.1 2.2 3.3 |
|
| 261 |
1.1 |
|
| 265 |
1.1 2.2 |
|
| 266 |
1.1 |
|
| 267 |
1.1 2.2 |
|
| 268 |
1.1 2.2 |
|
| 269 |
1.1 2.2 |
|
| 270 |
1.1 2.2 |
|
| 272 |
1.1 2.2 |


You may create new post
Posted by {{post.fullname}} | {{ post.created_at | timestampToRelativeDate }}


THE VIRGIN SUICIDES (Paramount Classics) Starring: Kirsten Dunst, James Woods, Kathleen Turner, Josh Hartnett, Hanna Hall, A. J. Cook, Chelse Swain, Leslie Hayman. Screenplay: Sofia Coppola, based on the novel by Jeffrey Eugenides. Producers: Francis Ford Coppola, Julie Costanzo, Dan Halsted and Chris Hanley. Director: Sofia Coppola.  Reviewed by Scott Renshaw.
All right, admit it: The credits "Written and directed by Sofia Coppola" don't exactly set the heart racing in anticipation of artistic triumph. Your defining image of Sofia Coppola probably involves her single-handedly making THE GODFATHER PART III painful to watch. Or maybe you go back farther, to her script credit on the lifeless "Life With Zoe" segment of NEW YORK STORIES. If so, then consider this (perhaps faint) praise for THE VIRGIN SUICIDES: Sofia shows more visual flair in her directorial debut than Papa Francis has managed to show in the last 20 years or so.
If only she had managed a bit more story sense. Based on Jeffrey Eugenides' novel, THE VIRGIN SUICIDES is the story of the five Lisbon sisters -- Bonnie (Chelsea Swain), Lux (Kirsten Dunst), Mary (A. J. Cook), Therese (Leslie Hayman) and Cecilia (Hanna R. Hall) -- children of strictly religious parents (Kathleen Turner and James Woods) in mid-1970s Michigan. The girls inspire fascination in their male peers, but the fascination grows even more intense when the youngest girl, 13-year-old Cecilia, throws herself from a second floor window onto an iron fence spike. The family retreats even more after the incident, but that doesn't stop the flirtatious Lux from trying to find some semblance of a normal adolescence -- including deceiving her parents.
Stylistically, Coppola does plenty to keep the film interesting. There are few gimmicks she's unwilling to employ: slow-motion, split screens, odd angles. She also crafts one extremely effective sequence at a homecoming dance that captures every nuance of adolescent romantic fumbling. Her approach shows Coppola understands that THE VIRGIN SUICIDES is not a simple narrative, but a flashback remembrance of pubescent fantasy. The girls are representations of idealized visions by the story's collective male narrator (given voice by Giovanni Ribisi), not fully-realized characters -- and that's fine. THE VIRGIN SUICIDES is effective at creating a coming-of-age dreamscape where the tranquility of suburbia collides with the inherent turbulence of youth.
Sounds good on paper, doesn't it? It's true that Coppola gives THE VIRGIN SUICIDES just the right atmosphere, but she never manages to latch onto anything that would give the story focus or momentum. Her biggest mistake is making arbitrary use of the novel's structure as a remembrance told from a distance of many years, much of it through imperfectly recalled interviews with key players. In one scene she shows an adult Trip Fontaine (Michael Par) describing his fling as a teenager (Josh Hartnett) with Lux. It's a great scene -- effectively demonstrating the lasting effect the Lisbon girls had on those around them -- but it also serves to show how much better the film would have been with more moments like it. The tale's young male observers also disappear for long stretches, allowing the film to drift into trite suburban family drama. On the page, THE VIRGIN SUICIDES was hypnotic and mysterious; on the screen, it's a collection of eye-catching individual moments that too rarely coalesce into something more profound.
In a cinematic climate where films about adolescents usually bear little resemblance to reality, it's refreshing to find a film-maker interested in capturing the tangled emotions of that time. Sofia Coppola is working from a fundamentally strong source, and she has put together a cast and crew that make THE VIRGIN SUICIDES worth watching (and worth listening to, with its sublimely kitschy soundtrack of period tunes by ELO, Styx and Heart). When it latches on to those moments of wonder at the emerging adulthood of the opposite sex -- one boy's wide-eyed discovery of feminine hygiene products in the Lisbon bathroom, for instance -- it's dead on target. Unfortunately, there's also too much of the mundane in Coppola's adaptation. If she develops as much instinct for storytelling as she does for directing, Sofia Coppola could be a film-maker to watch for. And there's a prospect I'll bet you never expected.
On the Renshaw scale of 0 to 10 Sofia's choices: 6.
Visit Scott Renshaw's Screening Room http://www.inconnect.com/~renshaw/ *** Subscribe to receive new reviews directly by email! See the Screening Room for details, or reply to this message with subject "Subscribe".
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


Sign In
Don't have an account?
Sign up
.


You’ll make a total of 12 hiring decisions. For each hiring decision, you are going to guess which worker performed best in the 2nd round among {{num_worker}} candidates, and you are required to:
Below is the example of one hiring trial:
|
|
1
. Which round of workers’’ performance you are going to guess?2
. How many hiring choices you are going to make?


Jean Grinols GPS Division Administrator California Institute of Technology<PHONE_NUMBER> ::
Veronica Fern McElarney SFUSD Clearinghouse Director San Francisco Unified School District<PHONE_NUMBER> ::
Lori Cameron English Professor Devry College<PHONE_NUMBER> ::


Welcome visitors to celebrate the year 2020 which is chosen as national tourism year of Nepal after the year 2011 which was
the primary authority tourism year of new Federal Democratic Republic of Nepal.
The government and tourism department of Nepal authoritatively reported that Nepal will take year 2020 as "Visit Nepal 2020",
a year committed to tourism industry of Nepal with vision of making a reasonable brand picture of Nepal as travel and
vacationer destination, backing up the tourism foundations of Nepal, enhance the growth of tourism industry, and enhance
locale tourism as supportable industry. The legislature has wanted to accommodate more than one million visitors amid the
year of “Visit Nepal 2020”.
Nepal is fifth among the Top 10 countries to visit in the world and number one in Best Valued Destination in the World. Why wouldn’t they be, Nepal boasts pristine natural beauty, sky-high Himalayas Range and endless culture and traditions spread out all over the country.
The earthquake of April 25, 2015, killed 8686 people leaving thousands injured and many more homeless. The rural parts of Nepal are still recovering from the damage caused by the incident. The resulting year saw tourists number all-time low in preceding six years. The Visit Nepal 2020 campaign can be the backbone to support the fragile economic conditions of numerous families in the rural areas. Some media outlets reports of Nepal in the state of complete devastation and buried under heaps of pile is wrong. The earthquake mostly downed old buildings made of mud and some temples around the affected districts. The majority of Kathmandu remains intact which was not shown in the media, all a scheme to generate more TRP. Nepal was affected majorly in about 5 districts and minorly in 7 other districts. All other destinations are entirely untouched. The repair and reconstruction of temples and heritage sites are underway and will finish come 2020. Nepal, It’s People, Culture and the Beautiful Paradise Still Lives.
Champadevi is a magnificent hill located at an altitude of 2285 m south – west of Kathmandu which is one of the most
popular pilgrimage sites in the Hindu and Buddhist religions.
It is one of the best, easy, short enjoyable one day hiking trips in the southern hill of Kathmandu valley ideal for
all people who would strive to take the stirring hiking adventure while enjoying the natural sceneries on the way to
Dakshinkali temple (a temple of goddess Kali).
Walking through the lush pine forest on well develop trail is really wonderful experience. The trail goes gradually
uphill towards the north ridge and then ascends further through the beautiful forest to Champadevi. Most of the walk
is along the ridge and offers a spectacular view of the Kathmandu valley, mountains, central and western Himalayan
range including Langtang, Gauri Shanker, Jugal, Dorge Lakpa and many others.
The ice lake is at 4,600m above sea level. The ice lake is true to its name. Totally frozen and almost invisible. But the scenery around the lake is superb. These are 5,000m peaks and are little more than hills. It is eerily quiet around the lake, like a place frozen in time. Everything is covered in snow and frozen. Nothing lived or moved and there is no noise which makes this palce very peaceful and satisfying.


DevOps
Will Howard
What is this?
High level overview
Present problem and ideas
Start the discussion
What is the problem?
Development gets paid for change
Operations gets paid for stability
Different mindsets
Different tools
Shared business objectives
Deployments(Releases)
Development tosses release over the wall to Operations
Different environments
The Need for DevOps
The Need for DevOps
What is DevOps?
The handshake between Development and
IT
Operations
Goal is to create fast and stable flow of planned work
The Three Ways
Systems Thinking
Holistic approach
Amplify Feedback Loops
Fast response to changing needs
Culture of Continual Experimentation and Learning
Take Risks
Repetition is path to mastery
How does it help?
Aids in release management
Standardizes development/deployment environments
Automation
Communication
Shorten Feedback Loop
Technology and Culture
Unified Tools
Unified Processes
Automation
Cooperation
Technology
Deeply Modeled Systems
Track all dependencies and systems
Version Control System
Consistent Deployment/Development versions
Automation frameworks
Chef
Puppet
Culture
How do you facilitate cooperation in your org?
How do you measure performance?
Measurement influences behavior
Eliminate the silos!
Agile and DevOps
Complimentary
Agile is the bridge between business and development
DevOps is the bridge between development and operations
Together they form the entire business lifecycle
Transparency/Visibility
Transparency facilitates communication
More Transparency = Better Status
Like deeply modeled systems
Visibility is vital to project success!
If you don’t know what resources are available, how do you know how much work you can do?
How do you monitor resources?
Why do we care?
Proactive vs Reactive
Proactive is understanding the work that needs to be done
Reactive is fighting fires which leads to unplanned work
Without visibility into resources AND work, it’s impossible to be proactive
Unplanned Work
Technical Debt
Steals resources from planned work
Resource sink
Getting Started
Integrate deployment environments into development cycles
Automating test tools
Make Developers responsible for deploys
Standardization!
Make deployment User Stories
Starting the Conversation
There is a need to unify process and tools across development and operations
Organizations need a better way to measure resources, velocity and success
DevOps is about cooperation and coordination
We’re all on the same team
DevOps isn’t just for huge teams, it’s about planning
Questions?
References/Resources
http://dev2ops.org/2010/02/what-is-devops/
http://itrevolution.com/pdf/Top11ThingsToKnowAbout DevOps.pdf
http://venturebeat.com/2013/09/30/an-idiots-guide-to- devops/
http://www.jedi.be/blog/2010/02/12/what-is-this- devops-thing-anyway/
Thanks!
/
Go to slide:


Preparation time
overnight
Cooking time
10 to 30 mins
Serves
Serves 3-6
This warming spicy stew is ready in 30 minutes - great for family dinners and feeding friends. Replace the bulgur wheat with couscous if you don’t have time to soak it overnight.
For the chicken tagine, heat a large heavy-bottomed saucepan until hot. Add a little olive oil and the chicken thighs, skin-side down, and fry until golden-brown, then flip over and brown on the other side before transferring to a plate.
Add the onion, garlic and ginger to the pan and gently fry for 2-3 minutes.
Add all the spices and cook for a minute, then return the chicken to the pan and stir well to coat.
Add the stock, chilli, tomatoes and honey and bring to the boil.
Reduce the heat to a simmer, cover and cook for 20 minutes, or until the chicken is cooked through.
Add the mint and coriander, then stir in the butter. Season, to taste, with salt and pepper.
For the pomegranate tabbouleh, drain the bulgur wheat well, pressing down lightly to ensure all the water is removed, then place into a large bowl.
Add all the other ingredients and mix well, then check the seasoning, adding salt and pepper to taste.
To serve, pile the tabbouleh onto plates and spoon a chicken thigh and some sauce alongside.


Rounded
These .radius
, .rounded
, .bordered
& .shadow
classes can be used independently or together to style the component by rounding its corners, giving light borders, and creating shadow to it respectively. Mostly used in buttons, cards, tables, images and many more.
Buttons
Cards
Styled Card
This is a card.
It has an easy to override visual style, and is appropriately subdued.
Tables
| Table Header | Table Header | Table Header | Table Header |
|---|---|---|---|
| Content Goes Here | This is longer content Donec id elit non mi porta gravida at eget metus. | Content Goes Here | Content Goes Here |
| Content Goes Here | This is longer Content Goes Here Donec id elit non mi porta gravida at eget metus. | Content Goes Here | Content Goes Here |
| Content Goes Here | This is longer content Donec id elit non mi porta gravida at eget metus. | Content Goes Here | Content Goes Here |
| Content Goes Here | This is longer Content Goes Here Donec id elit non mi porta gravida at eget metus. | Content Goes Here | Content Goes Here |


Pricing
Our
Pricing
Espresso
Americano
$3.00
Another
$2.50
Another One
$5.00
Pepperoni
Chicken
$3.00
Mixed
$2.50
Special
$15.00
Tea
Green Tea
$3.00
saffron Tea
$2.50
Cold Tea
$5.00


Home
Rides
Sign Out
Mombasa
Ride date: 22-05-2018
Start time:05:00:Am
Distance (in Km):950
Price:5000
Driver Name: Ali Manzu
Car License number:KCD 824F
Arrival time:12:00:AM
Reserve ride


--- layout: post title: 10/29 school date: '2013-10-29T21:29:00.005-06:00' author: Jacob . tags: - homeschool-journal modified_time: '2013-10-29T21:29:49.076-06:00' blogger_id: tag:blogger.com,1999:blog-6400085873105072120.post-1303919304386850386 blogger_orig_url: http://www.svlark.com/2013/10/1029-school.html --- Audrey


High Prefect Garvarentz:
I am High Prefect Garvarentz, and I teach high level Orc warriors and magicians by the will of Pa'agrio, the father of eternal fire. Why have you come to see me?
Listen to information about second class transfer.
Sub Class.
Clan.
Alliance.
Quest.


| VIM-package | Visualization and Imputation of Missing Values |
| aggr | Aggregations for missing/imputed values |
| alphablend | Alphablending for colors |
| barMiss | Barplot with information about missing/imputed values |
| bgmap | Backgound map |
| bubbleMiss | Growing dot map with information about missing/imputed values |
| chorizonDL | C-horizon of the Kola data with missing values |
| colormapMiss | Colored map with information about missing/imputed values |
| colormapMissLegend | Colored map with information about missing/imputed values |
| colSequence | HCL and RGB color sequences |
| colSequenceHCL | HCL and RGB color sequences |
| colSequenceRGB | HCL and RGB color sequences |
| countInf | Count number of infinite or missing values |
| countNA | Count number of infinite or missing values |
| existsVm | Environment for the GUI for Visualization and Imputation of Missing Values |
| getVm | Environment for the GUI for Visualization and Imputation of Missing Values |
| gowerD | k-Nearest Neighbour Imputation |
| growdotMiss | Growing dot map with information about missing/imputed values |
| histMiss | Histogram with information about missing/imputed values |
| hotdeck | Hot-Deck Imputation |
| iimagMiss | Matrix plot |
| initialise | Initialization of missing values |
| irmi | Iterative robust model-based imputation (IRMI) |
| kNN | k-Nearest Neighbour Imputation |
| kola.background | Background map for the Kola project data |
| mapMiss | Map with information about missing/imputed values |
| marginmatrix | Marginplot Matrix |
| marginplot | Scatterplot with additional information in the margins |
| matrixplot | Matrix plot |
| maxCat | k-Nearest Neighbour Imputation |
| mosaicMiss | Mosaic plot with information about missing/imputed values |
| pairsVIM | Scatterplot Matrices |
| parcoordMiss | Parallel coordinate plot with information about missing/imputed values |
| pbox | Parallel boxplots with information about missing/imputed values |
| plot.aggr | Aggregations for missing/imputed values |
| prepare | Transformation and standardization |
| print.aggr | Aggregations for missing/imputed values |
| print.summary.aggr | Print method for objects of class summary.aggr |
| putVm | Environment for the GUI for Visualization and Imputation of Missing Values |
| regressionImp | Regression Imputation |
| rmVm | Environment for the GUI for Visualization and Imputation of Missing Values |
| rugNA | Rug representation of missing/imputed values |
| sampleCat | k-Nearest Neighbour Imputation |
| SBS5242 | Synthetic subset of the Austrian structural business statistics data |
| scattJitt | Bivariate jitter plot |
| scattmatrixMiss | Scatterplot matrix with information about missing/imputed values |
| scattMiss | Scatterplot with information about missing/imputed values |
| sleep | Mammal sleep data |
| spineMiss | Spineplot with information about missing/imputed values |
| summary.aggr | Aggregations for missing/imputed values |
| tao | Tropical Atmosphere Ocean (TAO) project data |
| testdata | Simulated data set for testing purpose |
| TKRmatrixplot | Matrix plot |
| VIM | Visualization and Imputation of Missing Values |
| vmGUIenvir | Environment for the GUI for Visualization and Imputation of Missing Values |
| which.minN | k-Nearest Neighbour Imputation |


Selecting this checkbox creates a new sandbox if a sandbox name is provided and a matching sandbox is not found on the Veracode Platform.
If the checkbox is not selected, a sandbox name is provided, and a matching sandbox is not found on the Veracode Platform, the Jenkins build will fail.


TOTAL WALKABILITY SCORE
This is a default featherlight lightbox. It's flexible in height and width. Everything that is used to display and style the box can be found in the featherlight.css file which is pretty simple.


If you click the "Submit" button, the form-data will be sent to a page called "/action_page.php".
Notice that the value of the "First name" field will not be submitted, because the input element does not have a name attribute.


A couple of days ago I learned about the pg_service.conf file in Postgres, and posted about it to my teammates in Slack. It lets you store connection parameters under single service names, using square-bracked "INI file" format. This makes connecting to frequently-used hosts and databases much easier. For example, with a pg_service.conf
like...
1 2 3 4 5 | [mydb]
host=somehost
port=5433
user=someuser
dbname=mydatabase
|
...then you can go PGSERVICE=mydb psql
at the command line, and Bob's your uncle. (This is extra handy if you have the PGPASSWORD
envar set to the password for someuser
.) Instead of always setting the PGSERVICE variable, I also export that to my most-often-used service (the warehouse instance, in my case) in my .bashrc
. Another way I made this easier on myself is with by adding a simple alias-like function (I used a function because aliases can't take arguments):
1 2 3 | pg() { PGSERVICE=$1 psql
}
|
The other noteworthy thing here, is that the defined services work at the libpq level, which means that any native postgresql driver (for instance psycopg2 😉) can use them as well.
1 2 3 | import psycopg2
conn = psycopg2.connect(service='mydb', password='secret') # or set PGPASSWORD
|
I made a more complete example in this gist. I suggest we should use this manner of provisioning database connections as a matter of policy:
ADD
a pg_service.conf file to your Docker image (likely better: provide for one to be mounted in at run time).- Use Kubernetes secret to set
PGPASSWORD
in the environment - Pass the service name to the psycopg2 (or whichever driver) connection method
It just makes sense.


%CV Ground Station Thermal Analysis %Reference: "Fundamentals of Heat and Mass Transfer, 7th edition by % Bergman, Lavine, Incropera, and Dewitt clear clc %Air properties. For rayleigh number, these properties should be evaluated %at film temp(pg 605, first paragraph) v = 16.2*10^-6; alpha=22.9*10^-6; Beta=0.0033; Pr=0.71 ;%Prandtl Number g=9.81; %gravity kPlastic = 0.2;% Pelican cases are a polypropylene polymer. Conduction coeff of 0.17 to 0.22 https://www.ineos.com/globalassets/ineos-group/businesses/ineos-olefins-and-polymers-usa/products/technical-information--patents/ineos-engineering-properties-of-pp.pdf kAir = 33.8*10^-3; %Air at 400k, Table A1 %Goal #1 - Determine if a fan is needed by analyzing a closed box %Box: https://www.alliedelec.com/product/serpac/se430-bk/70369062/ %Size is 13.6*10.7*6.3 in box.width = inchesToMeters(13.6); box.length = inchesToMeters(10.7); box.height = inchesToMeters(6.3); %Environmental Conditions = A hot day with no wind. Start out modeling the % box in the shade (no solar loading). Neglect radiation and conduction. % Assume the bottom of the box to be insulated, such as the box sitting on % a table or the ground. % temp_ambient = farenToCelc(100); %Assume a pretty hot day out of 100F. Temp_Surface_Range = linspace(temp_ambient+5,60,25); idx = 1; for Ts=Temp_Surface_Range(1:end) %Toasty exterior of 60C %Perform a basic control volume analysis of the box using free/natural %convection on the top surface and the four sides of the box. Using example %9.3 on pg 611 %Top of the box: Analysis for upper surface of flat hot plate in cool air. Area = box.width * box.length; %top area Perim=box.width * 2+box.length * 2; %top perim L=Area/Perim; %Characteristic length for flat plate Ral_top = g * Beta * (Ts-temp_ambient) * L^3 / (v * alpha); %Rayleigh Number h_top = (kAir/L) * 0.15 * Ral_top^(1/3);% Convection coeffient for top surface, equation 9.31 q_top = h_top * Area * (Ts-temp_ambient); %watts dissipated from the top %Sides of the box: Analysis for vertical hot plate in cool air Area=box.height * Perim; L=box.height; %characeristic length for the sides of the box Ral_sides = g*Beta*(Ts-temp_ambient)*L^3 / (v*alpha); %Rayleigh Number, is less than 10^9, so use laminar relations Nul = 0.68 + 0.670*Ral_sides^(1/4) / (1 + (0.492/Pr)^(9/16))^(4/9);% Equation 9.27, more accurate nussult number h_sides = Nul*kAir/L; q_sides = h_sides*Area*(Ts-temp_ambient) qTotal(idx) = q_top+q_sides; idx=idx+1; end plot(Temp_Surface_Range,qTotal); xlabel('Box Surface Temperature (C)'); ylabel('Heat Loss (W)'); title('Box Heat Loss vs. Box Surface Temperature'); grid on; function c = farenToCelc(f) c = (f-32)*5/9; end function m = inchesToMeters(in) m = in/39.37; end


Author: This chapter originated as part of Enhancement of the ANSI SQL Implementation of PostgreSQL, Stefan Simkovics' Master's Thesis prepared at Vienna University of Technology under the direction of O.Univ.Prof.Dr. Georg Gottlob and Univ.Ass. Mag. Katrin Seyr.
This chapter gives an overview of the internal structure of the backend of PostgreSQL. After having read the following sections you should have an idea of how a query is processed. This chapter does not aim to provide a detailed description of the internal operation of PostgreSQL, as such a document would be very extensive. Rather, this chapter is intended to help the reader understand the general sequence of operations that occur within the backend from the point at which a query is received, to the point at which the results are returned to the client.


‘Anything can happen’ to sterling on UK vote
The outcome of Britain’s December election poses a binary choice for sterling and “anything can happen” according to the largest UK bank.
A result paving the way to a Brexit deal with the EU could send the pound up about 12% to $1.45 by the end of next year, said David Bloom, global head of foreign- exchange strategy at HSBC Holdings.
Or a no-deal Brexit could see it tumble some 15% to $1.10.
“Nothing is priced in,” Mr Bloom said. “The political outcome will determine the future of the currency.”
His comments contrast with traders’ confidence in sterling, fuelled by polls suggesting the Conservatives will defeat the Labour Party on December 12 and secure a Brexit deal that could help end the political paralysis.
The pound is hovering near a six-month high against the euro, while traders are confident prime minister Boris Johnson will maintain his lead, a gauge of expected large moves in the currency suggests.
Any resolution is good, Mr Bloom said, either it be another referendum or a Brexit deal. Political wrangling will start to ebb away, the economy could get a fiscal boost, and the Bank of England could start considering rate increases. The reverse could see recession fears flare.
Bloomberg


Visual Studio Code
I recently use this code editor and I'm completely in love! See the next resource for my setup.
Development Tools
HTML5 Resources
CSS Resources
Javascript Resources
Fonts and Typography Tools
Great Colors and Tools
Images and Videos
Best Icons and Tools
Find Design Inspiration
Popular Blogs and Community
Planning, Testing, Optimization and Deployment


PoliciesMultiPlayers.DepRound module¶
DepRound()
: implementation of the dependent rounding procedure, from [[Dependent rounding and its applications to approximation algorithms, by R Gandhi, S Khuller, S Parthasarathy, Journal of the ACM, 2006](http://dl.acm.org/citation.cfm?id=1147956)].
It solves the problem of efficiently selecting a set of \(k\) distinct actions from \(\{1,\dots,K\}\), while satisfying the condition that each action \(i\) is selected with probability \(p_i\) exactly.
The distribution \((p_1, \dots, p_K)\) on \(\{1,\dots,K\}\) is assumed to be given.
Dependent rounding developed by [Gandhi et al.] is a kind of technique that randomly selects a set of edges from a bipartite graph under some cardinality constraints.
It runs in \(\mathcal{O}(K)\) space complexity, and at most \(\mathcal{O}(K^2)\) time complexity (note that the article [Uchiya et al., 2010] wrongly claim it is in \(\mathcal{O}(K)\)).
References: see also https://www.cs.umd.edu/~samir/grant/jacm06.pdf
-
PoliciesMultiPlayers.DepRound.
random
() → x in the interval [0, 1).¶
-
PoliciesMultiPlayers.DepRound.
DepRound
(weights_p, k=1)[source]¶ [[Algorithms for adversarial bandit problems with multiple plays, by T.Uchiya, A.Nakamura and M.Kudo, 2010](http://hdl.handle.net/2115/47057)] Figure 5 (page 15) is a very clean presentation of the algorithm.
Inputs: \(k < K\) and weights_p \(= (p_1, \dots, p_K)\) such that \(\sum_{i=1}^{K} p_i = k\) (or \(= 1\)).
Output: A subset of \(\{1,\dots,K\}\) with exactly \(k\) elements. Each action \(i\) is selected with probability exactly \(p_i\).
Example:
>>> import numpy as np; import random >>> np.random.seed(0); random.seed(0) # for reproductibility! >>> K = 5 >>> k = 2
>>> weights_p = [ 2, 2, 2, 2, 2 ] # all equal weights >>> DepRound(weights_p, k) [3, 4] >>> DepRound(weights_p, k) [3, 4] >>> DepRound(weights_p, k) [0, 1]
>>> weights_p = [ 10, 8, 6, 4, 2 ] # decreasing weights >>> DepRound(weights_p, k) [0, 4] >>> DepRound(weights_p, k) [1, 2] >>> DepRound(weights_p, k) [3, 4]
>>> weights_p = [ 3, 3, 0, 0, 3 ] # decreasing weights >>> DepRound(weights_p, k) [0, 4] >>> DepRound(weights_p, k) [0, 4] >>> DepRound(weights_p, k) [0, 4] >>> DepRound(weights_p, k) [0, 1]
See [[Gandhi et al, 2006](http://dl.acm.org/citation.cfm?id=1147956)] for the details.


|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object se.sics.prologbeans.PrologSession
public class PrologSession
PrologSession
handles the connection with the Prolog
Server. Currently only synchronous connections with the server are
supported.
| Constructor Summary | |
|---|---|
PrologSession()
Creates a new PrologSession instance with default
Prolog server settings. |
| Method Summary | |
|---|---|
void |
connect()
Connects to the Prolog server. |
void |
disconnect()
Closes the connection with the Prolog server. |
QueryAnswer |
executeQuery(java.lang.String query)
Sends a query to the Prolog server and waits for the answer before returning the QueryAnswer . |
QueryAnswer |
executeQuery(java.lang.String query,
Bindings bindings)
Sends a query to the Prolog server and waits for the answer before returning the QueryAnswer . |
QueryAnswer |
executeQuery(java.lang.String query,
Bindings bindings,
java.lang.String sessionID)
Sends a query to the Prolog server and waits for the answer before returning the QueryAnswer . |
java.lang.String |
getHost()
Returns the host of the Prolog server (exactly as registered in setHost ). |
int |
getPort()
Returns the port of the Prolog server. |
static PrologSession |
getPrologSession(java.lang.String name)
Returns the PrologSession registered in JNDI with
the given name. |
static PrologSession |
getPrologSession(java.lang.String name,
javax.servlet.http.HttpSession httpSession)
Returns the PrologSession registered in JNDI with
the given name. |
int |
getTimeout()
Returns the timeout in milliseconds before the connection to the Prolog server is reset (when a query is not answered). |
boolean |
isAlwaysClosing()
|
boolean |
isAutoConnecting()
Returns the state of the auto connect mode. |
boolean |
isConnected()
Returns true if a connection with the Prolog server
is open and false otherwise. |
void |
setAlwaysClose(boolean close)
|
void |
setAutoConnect(boolean autoConnect)
Sets the connection mode of this PrologSession . |
void |
setHost(java.lang.String prologServerHost)
Sets the host of the Prolog server (default is localhost ). |
void |
setPort(int prologServerPort)
Sets the port of the Prolog server (default 8066 ). |
void |
setTimeout(int timeout)
Sets the timeout in milliseconds before the connection to the Prolog server is reset (when a query is not answered). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PrologSession()
PrologSession
instance with default
Prolog server settings.
| Method Detail |
|---|
public int getTimeout()
public void setTimeout(int timeout)
0
will disable timeouts for this
prolog session. Default is 2000 milliseconds.
timeout
- int
timeout in milliseconds or
0
to disable timeoutspublic static PrologSession getPrologSession(java.lang.String name)
PrologSession
registered in JNDI with
the given name.Use this method in application servers where
services are registered using JNDI. Please note: the application
server must be configured to register the
PrologSession
with the given name for this method to
work.
name
- the name of the prolog session
null
if no such
session could be foundpublic static PrologSession getPrologSession(java.lang.String name, javax.servlet.http.HttpSession httpSession)
PrologSession
registered in JNDI with
the given name.The PrologSession
will make use of
sessions and the session id will be the same as in the
HTTPSession
. Use this method in web application
servers with support for servlets and HTTPSession
(and when support for sessions is desired).
Note: This will cause the PrologSession
to include
the session id in its queries.
name
- the name of the prolog sessionhttpSession
- the http session
public int getPort()
public void setPort(int prologServerPort)
8066
).
prologServerPort
- the port of the Prolog serverpublic java.lang.String getHost()
setHost
).
public void setHost(java.lang.String prologServerHost)
localhost
). The host can be specified as either
IP-address or host name.
prologServerHost
- the host as an IP-address or host namepublic boolean isAlwaysClosing()
public void setAlwaysClose(boolean close)
public void setAutoConnect(boolean autoConnect)
PrologSession
. If
set to true
it will ensure that it is connected to
the Prolog server as soon as a call to executeQuery
or anything else causing a need for communication happens. This
is by default set to true
.
public boolean isAutoConnecting()
setAutoConnect(boolean)
public QueryAnswer executeQuery(java.lang.String query) throws java.io.IOException, IllegalCharacterSetException
QueryAnswer
. Anonymous
variables (underscore, _
), will be ignored, and thus
not accessible in the QueryAnswer
.
executeQuery
throws IOException
if
communication problems with the server occurs. Please note:
executeQuery
will only return one answer.
query
- the query to send to the prolog server.
The characters in the query are restricted to ISO-8859-1.
java.io.IOException
- if an error occurs. A possible cause is a timeout.
IllegalCharacterSetException
setTimeout(int)
public QueryAnswer executeQuery(java.lang.String query, Bindings bindings) throws java.io.IOException, IllegalCharacterSetException
QueryAnswer
. Bindings
are variable
bindings for the given query and will ensure that the values are
stuffed correctly.
An example:QueryAnswer answer = executeQuery("evaluate(In,Out)",
new Bindings().bind("In","4*9."));
query
- the query to send to the prolog server
The characters in the query are restricted to ISO-8859-1.bindings
- the variable bindings to use in the query
java.io.IOException
- if an error occurs. A possible cause is a timeout.
IllegalCharacterSetException
setTimeout(int)
public QueryAnswer executeQuery(java.lang.String query, Bindings bindings, java.lang.String sessionID) throws java.io.IOException, IllegalCharacterSetException
QueryAnswer
. Bindings
are variable
bindings for the given query and will ensure that the values are
stuffed correctly.
query
- the query to send to the prolog server
The characters in the query are restricted to ISO-8859-1.bindings
- the variable bindings to use in the querysessionID
- the session id to give to the prolog server
java.io.IOException
- if an error occurs. A possible cause is a timeout.
IllegalCharacterSetException
setTimeout(int)
public void connect() throws java.io.IOException
executeQuery
will automatically connect to the
server when called.
java.io.IOException
public boolean isConnected()
true
if a connection with the Prolog server
is open and false
otherwise.
public void disconnect()
connect
.
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |


Team Member 1 (M) @ Item
Ability: Levitate
Level: 50
EVs: 4 HP / 4 Atk / 4 Def / 4 SpA / 4 SpD / 4 Spe
Some Nature
IVs: 0 Atk / 0 Spe
- Move 1
- Move 2
- Move 3
- Move 4
... and continue with the rest of the team.Teamsheet generator by Jake White. Regex/styling guide taken from Tapin.
Last updated: 5/6/2019. Up to date with game type and team name requirements! Thanks to @JeanMarcVGC for updating things :)
For the full changelog, click here!
Raw Teamsheet DownloadPaste your team here:
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
Notes:
Please fill out this Team List using the language to which the player's game is set.
All Pokémon must be listed exactly as the appear in the Battle Team, at the level they are in the game. If they are not, penalties may be incurred.
If your Pokémon is of a particular Forme (e.g. Rotom-Wash), or a Regional Variant (e.g. Galarian Rapidash) include this in the "Pokémon" field
Check the box under "Gigantamax" if your Pokémon has the Gigantamax factor.


EdLab Seminar: What They Don’t Teach You in Statistics Classes
Jun 29, 2010 1:14 PM
Speaker: Kaiser Fung
When Nobel winner Daniel Kahneman was not busy creating the foundations of behavioral economics, he determined that statistical thinking is an unnatural activity; even experts sometimes fail at it. Yet, from stock charts to test scores, from theme parks to traffic jams, from credit cards to medical tests, statistics influence all aspects of our lives. Using examples from statistical practice, Mr. Fung will discuss some key statistical ideas–things they surprisingly don’t teach you in statistics classes. In addition, popular accounts of scientific innovations typically leave out the convoluted, imperfect process by which they enter everyday life. The adoption of statistical science provides a fertile backdrop for investigating this process.
Bio:
Kaiser Fung is a statistician at Sirius XM Radio, with over a decade of experience in business statistics and analytics, in the media, Internet and financial services industries. He teaches practical statistics at New York University (adjunct). He has engineering and statistics degrees from Princeton and Cambridge Universities, and also holds an MBA from Harvard Business School. His book on statistical thinking, "Numbers Rule Your World: The Hidden Influence of Probabilities and Statistics on Everything You Do." , was published by McGraw-Hill in February 2010. Since 2005, his blog, Junk Charts , has pioneered the critical examination of graphics and data presented by the media.
Speaker: Kaiser Fung
When Nobel winner Daniel Kahneman was not busy creating the foundations of behavioral economics, he determined that statistical thinking is an unnatural activity; even experts sometimes fail at it. Yet, from stock charts to test scores, from theme parks to traffic jams, from credit cards to medical tests, statistics influence all aspects of our lives. Using examples from statistical practice, Mr. Fung will discuss some key statistical ideas–things they surprisingly don't teach you in statistics classes. In addition, popular accounts of scientific innovations typically leave out the convoluted, imperfect process by which they enter everyday life. The adoption of statistical science provides a fertile backdrop for investigating this process.
Bio:
Kaiser Fung is a statistician at Sirius XM Radio, with over a decade of experience in business statistics and analytics, in the media, Internet and financial services industries. He teaches practical statistics at New York University (adjunct). He has engineering and statistics degrees from Princeton and Cambridge Universities, and also holds an MBA from Harvard Business School. His book on statistical thinking, "Numbers Rule Your World: The Hidden Influence of Probabilities and Statistics on Everything You Do." , was published by McGraw-Hill in February 2010. Since 2005, his blog, Junk Charts , has pioneered the critical examination of graphics and data presented by the media.
Open to all members of the university community.
If you are coming from outside the EdLab, please RSVP by August 9th to<EMAIL_ADDRESS>so we order enough lunch!


before I start…
I want to highlight the two biggest personal lessons I learnt at Metis were learnt during this project.
procrastination will kill you.
I did not know what to do. And I did not stick to any idea that I had. Initially we started in groups with vague aims of classifying a genre into a subgenre. We went to the spotify music hackathon, bright-eyed and bushy-tailed and ready for adventure. Though the hackathon itself was fab and the speakers were inspiring - we didn’t figure out our subgenre problem. The million song dataset wouldn’t fit on my AWS, and the spotify API didn’t return the things that we were interested in. The fields of interest were empty. Additionally, the awesome python libraries that we could use to analyse audio files was not cooperating with my python3
. All of these barriers would have been circumventable if only I had believed in the cause. I said yes to this because I was excited to work with music but classifying genres into subgenres was not something I felt I could put my heart into. And so all of these hiccups felt all the more monumental.
With retrospect I could have done some pretty neat classification problems surrounding music. and I will probably explore these now I have some ‘free’ time (ahum. job-hunting.) but at the time these did not come to me.
I looked up datasets and debated playing with calcium signalling data (is a neuron of interest or not?), or are mushrooms edible or not, or even does this person have Parkinson’s or not? Some SUPER interesting things kicking about there but procrastination killed them all. And 36 hours before presentation time, I decided to classify leaf images to corresponding tree species. This was fine, but given the time strain I had very little opportunity to dig deeper and do some interesting analysis or to seriously consider the problem or uses of this classifier.
Moral of the story: Find a project and stick to it. You can make something interesting out of everything.
don’t try and change the world with every project.
You will always be disappointed. Always. One of my main issues is having to make everything I do ‘important’ to justify putting time into it. But ultimately this course is about learning the ropes. Taking on seemingly less serious topics will allow faster blooming of my technical capabilities. I have always appreciated the little things and I get excited by small logic problems and even things like data cleaning but if I have to present a project I have had a tendency to overthink and search for the much much bigger picture. This has made it difficult to get excited about things that just have a simple bigger picture. Or projects that are only focused on ‘increasing revenue’. But I have realised how detrimental this is. For the leaf project I went to lengths to make up a story about the APOCALYPSE! Are you ready?
…it is 50 years in the future, and infrastructure has collapsed. It is more and more difficult to find reliable, safe and affordable medicine and so the people are turning back to nature for their remedies. For this reason they need a classifier to tell them, based on an image of the leaf, what the tree species is and whether that plant is medicinally useful to you…
Yes. Our fantastic teacher Vinny pointed out that actually we don’t need an apocalyptic future to justify a leaf classifier and it can be useful for education, park rangers and many other entirely relevant things.
the project
I got this dataset from UCI along with a paper by Pedro explaining his logic and process. I used openCV to extract some of the features he mentioned in his thesis (all of which were present in the dataset itself) to get a feel for the openCV package and learn a bit about image processing.
cleaning up the data
This data was pretty clean already so it was just a case of organising and understanding it. I replaced string nans with float(nan)
so that pandas
would recognise them as non-values.
I grouped my data by species to have a look at the summary of differed variables per species. To see whether something was largely nans
and just to understand the metrics a little better because they consisted of things like ‘Eccentricity’, ‘Solidity’ and ‘Isoperimetric Factor’… (see end for explanation of these terms).
I created a reduced dataset that didn’t have things in it I wasn’t planning on using in my analysis and I pickled
that so that I could just load it up again if I quit the programme.
The test-train split. I had 30 species and only 8-15 specimens per species so it was important to do a stratified split so that all the species were present in both the training and the test set.
I used seaborn
and matplotlib
to plot some of the features(variables) in the training set.
I used feature importance analysis to pull out the most important features as lots of variables means lots of dimensions which makes it harder to glean relevant insights.
It couldn’t hurt to prune some out.
I tried running my classifier models with the top 9 (and then 10, and then 11) features but my accuracy score for each model dropped a lot, some by 20 points. So I stuck with all 16.
A little sidenote - I plotted a scatter matrix for my features which is just a matrix of scatter plots that shows you how each pair of variables are related. Down the diagonal (where the one variable would be compared with itself) is a KDE plot for that particular variable. That just shows the distribution within the variable. This is a great and reasonable quick way to visually understand your data and the relaitonships within it - that is, if you don’t have more than 10 or 15 variables..
A little summary of the classifiers
LOGISTIC REGRESSION
Logistic regression is regression where the dependent variable (the thing you are predicting) is categorical (splits into categories). This is most effectively used, or designed for, binary models. Usually in cases of multiple unordered categories, the regression model to use is Multinomial Linear Regression which doesn’t have a handy function in scikit learn. When applied to a problem with multiple categories, like the leaf dataset, a logistic regression analysis will assess the probability that something is in one category compared to all other categories.
Logistic regression assumes a clear cut off. The green line in the example below is the probability of a data point being ‘a case’ given 1 feature. The blue dots are cases and the red ones are not. A classic example the probability of a student passing a test given the number of hours they spend studying for that test. Blue is pass, red is fail, and the numbers on the x axis are the number of hours spent studying. It seems logical that the probability of passing increases with study hours.
SVM
SVM stands for Support Vector Machine. It’s basic idea is that you define a decision boundary using the ‘widest street’ approach. This means that you want to draw a line that has on either side of it, the biggest margin possible between the two categories. Wihout a kernel, SVMs are only really useful for data that is linearly divided. It looks a little like this:
Using a kernel means drawing the line in a higher dimensional space and then reducing the dimensionality so that the line no longer looks straight. Simple, right? When you use kernels correctly SVMs can be super useful for all kinds of classification problems. But as always you need to be careful of overfitting.
I find that this MIT lecture is really helpful. Chalkboards are the best.
DECISION TREES and RANDOM FORESTS
Decision trees and random forests are probably my favourite type of classification algorithm because they are really intuitive but also really effective in lots of situations. You run the risk of overfitting, but random forests help there.
Decision trees use if-then statements to define patterns in the data. A decision tree consists of a starting point, where you have ALL your training data, and then you split that data by asking a simple yes/no question and splitting the data accordingly. For example, is your leaf longer than 10cm? Yes: contains all leaves longer than 10cm, and No: contains all leaves shorter than 10cm. You set how many questions you want to ask, or in the correct lingo, how many levels you want the tree to contain and Voilá! You end up with categories into which new leaves will be classified. With labeled data, the accuracy score is the probability that a leaf is correctly classified.
Random Forests just do the same process multiple times (lots of decision trees) and then take the mode or mean prediction of the sum of the trees. The good thing about Random Forests is that they can reduce the risk of overfitting that can happen with Decision Trees.
LOW AND BEHOLD, for my leaf dataset the Random Forest classifier was the most accurate. Which was just perfect. Because leaves. And trees. And forests. Geddit?
Here’s the breakdown, where the y axis shows the accuracy score:


Iterator over the elements of the identity matrix. More...
#include <IdentityMatrix.h>
Public Types | |
| using | Element = ValueIndexPair< Type > |
| Element type of the identity matrix. | |
| using | IteratorCategory = std::forward_iterator_tag |
| The iterator category. | |
| using | ValueType = Element |
| Type of the underlying pointers. | |
| using | PointerType = ValueType * |
| Pointer return type. | |
| using | ReferenceType = ValueType & |
| Reference return type. | |
| using | DifferenceType = ptrdiff_t |
| Difference between two iterators. | |
| using | iterator_category = IteratorCategory |
| The iterator category. | |
| using | value_type = ValueType |
| Type of the underlying pointers. | |
| using | pointer = PointerType |
| Pointer return type. | |
| using | reference = ReferenceType |
| Reference return type. | |
| using | difference_type = DifferenceType |
| Difference between two iterators. | |
Public Member Functions | |
| ConstIterator () | |
| Default constructor for the ConstIterator class. | |
| ConstIterator (size_t index) | |
| Constructor for the ConstIterator class. More... | |
| ConstIterator & | operator++ () |
| Pre-increment operator. More... | |
| ConstIterator | operator++ (int) |
| Post-increment operator. More... | |
| const Element | operator* () const |
| Direct access to the sparse matrix element at the current iterator position. More... | |
| const ConstIterator * | operator-> () const |
| Direct access to the sparse matrix element at the current iterator position. More... | |
| Type | value () const |
| Access to the current value of the sparse element. More... | |
| size_t | index () const |
| Access to the current index of the sparse element. More... | |
| bool | operator== (const ConstIterator &rhs) const |
| Equality comparison between two ConstIterator objects. More... | |
| bool | operator!= (const ConstIterator &rhs) const |
| Inequality comparison between two ConstIterator objects. More... | |
| DifferenceType | operator- (const ConstIterator &rhs) const |
| Calculating the number of elements between two ConstIterator objects. More... | |
Private Attributes | |
| size_t | index_ |
| Index to the current identity matrix element. | |
Iterator over the elements of the identity matrix.
|
inline |
Constructor for the ConstIterator class.
| index | Index to the initial matrix element. |
|
inline |
Access to the current index of the sparse element.
|
inline |
Inequality comparison between two ConstIterator objects.
| rhs | The right-hand side ConstIterator object. |
|
inline |
Direct access to the sparse matrix element at the current iterator position.
|
inline |
Pre-increment operator.
|
inline |
Post-increment operator.
|
inline |
Calculating the number of elements between two ConstIterator objects.
| rhs | The right-hand side ConstIterator object. |
|
inline |
Direct access to the sparse matrix element at the current iterator position.
|
inline |
Equality comparison between two ConstIterator objects.
| rhs | The right-hand side ConstIterator object. |
|
inline |
Access to the current value of the sparse element.


Are you sure you want to hide this post?
Are you sure you want to unhide this post?
Are you sure you want to permanently delete this post?


RIVERWEST PUB CRAWL 2017
April 1st Noon - 8PM, No fooling
Literally dozens of Bars!
$20 Early, $25 Day of
Day of Registration at Tracks, 12 - 2PM
Tickets available early at Art Bar and The Gig
Day of Registration at Tracks, 12 - 2PM
Tickets available early at Art Bar and The Gig
April 1st, Noon - 8:00PM
20$ Early, $25 Day of
Over 20 Bars!!
Day of Registration at Tracks!, 12 - 2PM
All money goes to Kiwanis Milwaukee to benefit local community.
Great fun!