| 1 | /* | |
| 2 | * Licensed to the Apache Software Foundation (ASF) under one or more | |
| 3 | * contributor license agreements. See the NOTICE file distributed with | |
| 4 | * this work for additional information regarding copyright ownership. | |
| 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 | |
| 6 | * (the "License"); you may not use this file except in compliance with | |
| 7 | * the License. You may obtain a copy of the License at | |
| 8 | * | |
| 9 | * http://www.apache.org/licenses/LICENSE-2.0 | |
| 10 | * | |
| 11 | * Unless required by applicable law or agreed to in writing, software | |
| 12 | * distributed under the License is distributed on an "AS IS" BASIS, | |
| 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| 14 | * See the License for the specific language governing permissions and | |
| 15 | * limitations under the License. | |
| 16 | */ | |
| 17 | package org.apache.commons.imaging; | |
| 18 | ||
| 19 | import java.io.PrintWriter; | |
| 20 | import java.io.StringWriter; | |
| 21 | import java.util.ArrayList; | |
| 22 | import java.util.List; | |
| 23 | ||
| 24 | /** | |
| 25 | * ImageInfo represents a collection of basic properties of an image, such as | |
| 26 | * width, height, format, bit depth, etc. | |
| 27 | */ | |
| 28 | public class ImageInfo { | |
| 29 | private final String formatDetails; // ie version | |
| 30 | ||
| 31 | private final int bitsPerPixel; | |
| 32 | private final List<String> comments; | |
| 33 | ||
| 34 | private final ImageFormat format; | |
| 35 | private final String formatName; | |
| 36 | private final int height; | |
| 37 | private final String mimeType; | |
| 38 | ||
| 39 | private final int numberOfImages; | |
| 40 | private final int physicalHeightDpi; | |
| 41 | private final float physicalHeightInch; | |
| 42 | private final int physicalWidthDpi; | |
| 43 | private final float physicalWidthInch; | |
| 44 | private final int width; | |
| 45 | private final boolean isProgressive; | |
| 46 | private final boolean isTransparent; | |
| 47 | ||
| 48 | private final boolean usesPalette; | |
| 49 | ||
| 50 | public static final int COLOR_TYPE_BW = 0; | |
| 51 | public static final int COLOR_TYPE_GRAYSCALE = 1; | |
| 52 | public static final int COLOR_TYPE_RGB = 2; | |
| 53 | public static final int COLOR_TYPE_CMYK = 3; | |
| 54 | public static final int COLOR_TYPE_YCbCr = 4; | |
| 55 | public static final int COLOR_TYPE_YCCK = 5; | |
| 56 | public static final int COLOR_TYPE_YCC = 6; | |
| 57 | public static final int COLOR_TYPE_OTHER = -1; | |
| 58 | public static final int COLOR_TYPE_UNKNOWN = -2; | |
| 59 | ||
| 60 | private final int colorType; | |
| 61 | ||
| 62 | public static final String COMPRESSION_ALGORITHM_UNKNOWN = "Unknown"; | |
| 63 | public static final String COMPRESSION_ALGORITHM_NONE = "None"; | |
| 64 | public static final String COMPRESSION_ALGORITHM_LZW = "LZW"; | |
| 65 | public static final String COMPRESSION_ALGORITHM_PACKBITS = "PackBits"; | |
| 66 | public static final String COMPRESSION_ALGORITHM_JPEG = "JPEG"; | |
| 67 | public static final String COMPRESSION_ALGORITHM_RLE = "RLE: Run-Length Encoding"; | |
| 68 | public static final String COMPRESSION_ALGORITHM_PSD = "Photoshop"; | |
| 69 | public static final String COMPRESSION_ALGORITHM_PNG_FILTER = "PNG Filter"; | |
| 70 | public static final String COMPRESSION_ALGORITHM_CCITT_GROUP_3 = "CCITT Group 3 1-Dimensional Modified Huffman run-length encoding."; | |
| 71 | public static final String COMPRESSION_ALGORITHM_CCITT_GROUP_4 = "CCITT Group 4"; | |
| 72 | public static final String COMPRESSION_ALGORITHM_CCITT_1D = "CCITT 1D"; | |
| 73 | ||
| 74 | private final String compressionAlgorithm; | |
| 75 | ||
| 76 | public ImageInfo(final String formatDetails, final int bitsPerPixel, | |
| 77 | final List<String> comments, final ImageFormat format, final String formatName, | |
| 78 | final int height, final String mimeType, final int numberOfImages, | |
| 79 | final int physicalHeightDpi, final float physicalHeightInch, | |
| 80 | final int physicalWidthDpi, final float physicalWidthInch, final int width, | |
| 81 | final boolean isProgressive, final boolean isTransparent, final boolean usesPalette, | |
| 82 | final int colorType, final String compressionAlgorithm) { | |
| 83 | this.formatDetails = formatDetails; | |
| 84 | ||
| 85 | this.bitsPerPixel = bitsPerPixel; | |
| 86 | this.comments = comments; | |
| 87 | ||
| 88 | this.format = format; | |
| 89 | this.formatName = formatName; | |
| 90 | this.height = height; | |
| 91 | this.mimeType = mimeType; | |
| 92 | ||
| 93 | this.numberOfImages = numberOfImages; | |
| 94 | this.physicalHeightDpi = physicalHeightDpi; | |
| 95 | this.physicalHeightInch = physicalHeightInch; | |
| 96 | this.physicalWidthDpi = physicalWidthDpi; | |
| 97 | this.physicalWidthInch = physicalWidthInch; | |
| 98 | this.width = width; | |
| 99 | this.isProgressive = isProgressive; | |
| 100 | ||
| 101 | this.isTransparent = isTransparent; | |
| 102 | this.usesPalette = usesPalette; | |
| 103 | ||
| 104 | this.colorType = colorType; | |
| 105 | this.compressionAlgorithm = compressionAlgorithm; | |
| 106 | } | |
| 107 | ||
| 108 | /** | |
| 109 | * Returns the bits per pixel of the image data. | |
| 110 | */ | |
| 111 | public int getBitsPerPixel() { | |
| 112 |
1
1. getBitsPerPixel : replaced return of integer sized value with (x == 0 ? 1 : 0) → KILLED |
return bitsPerPixel; |
| 113 | } | |
| 114 | ||
| 115 | /** | |
| 116 | * Returns a list of comments from the image file. | |
| 117 | * <p/> | |
| 118 | * This is mostly obsolete. | |
| 119 | */ | |
| 120 | public List<String> getComments() { | |
| 121 |
1
1. getComments : mutated return of Object value for org/apache/commons/imaging/ImageInfo::getComments to ( if (x != null) null else throw new RuntimeException ) → KILLED |
return new ArrayList<String>(comments); |
| 122 | } | |
| 123 | ||
| 124 | /** | |
| 125 | * Returns the image file format, ie. ImageFormat.IMAGE_FORMAT_PNG. | |
| 126 | * <p/> | |
| 127 | * Returns ImageFormat.IMAGE_FORMAT_UNKNOWN if format is unknown. | |
| 128 | * | |
| 129 | * @return A constant defined in ImageFormat. | |
| 130 | * @see ImageFormats | |
| 131 | */ | |
| 132 | public ImageFormat getFormat() { | |
| 133 |
1
1. getFormat : mutated return of Object value for org/apache/commons/imaging/ImageInfo::getFormat to ( if (x != null) null else throw new RuntimeException ) → KILLED |
return format; |
| 134 | } | |
| 135 | ||
| 136 | /** | |
| 137 | * Returns a string with the name of the image file format. | |
| 138 | * | |
| 139 | * @see #getFormat() | |
| 140 | */ | |
| 141 | public String getFormatName() { | |
| 142 |
1
1. getFormatName : mutated return of Object value for org/apache/commons/imaging/ImageInfo::getFormatName to ( if (x != null) null else throw new RuntimeException ) → KILLED |
return formatName; |
| 143 | } | |
| 144 | ||
| 145 | /** | |
| 146 | * Returns the height of the image in pixels. | |
| 147 | * | |
| 148 | * @see #getWidth() | |
| 149 | */ | |
| 150 | public int getHeight() { | |
| 151 |
1
1. getHeight : replaced return of integer sized value with (x == 0 ? 1 : 0) → KILLED |
return height; |
| 152 | } | |
| 153 | ||
| 154 | /** | |
| 155 | * Returns the MIME type of the image. | |
| 156 | * | |
| 157 | * @see #getFormat() | |
| 158 | */ | |
| 159 | public String getMimeType() { | |
| 160 |
1
1. getMimeType : mutated return of Object value for org/apache/commons/imaging/ImageInfo::getMimeType to ( if (x != null) null else throw new RuntimeException ) → KILLED |
return mimeType; |
| 161 | } | |
| 162 | ||
| 163 | /** | |
| 164 | * Returns the number of images in the file. | |
| 165 | * <p> | |
| 166 | * Applies mostly to GIF and TIFF; reading PSD/Photoshop layers is not | |
| 167 | * supported, and Jpeg/JFIF EXIF thumbnails are not included in this count. | |
| 168 | */ | |
| 169 | public int getNumberOfImages() { | |
| 170 |
1
1. getNumberOfImages : replaced return of integer sized value with (x == 0 ? 1 : 0) → SURVIVED |
return numberOfImages; |
| 171 | } | |
| 172 | ||
| 173 | /** | |
| 174 | * Returns horizontal dpi of the image, if available. | |
| 175 | * <p> | |
| 176 | * Applies to TIFF (optional), BMP (always), GIF (constant: 72), Jpeg | |
| 177 | * (optional), PNG (optional), PNM (constant: 72), PSD/Photoshop (constant: | |
| 178 | * 72). | |
| 179 | * | |
| 180 | * @return returns -1 if not present. | |
| 181 | */ | |
| 182 | public int getPhysicalHeightDpi() { | |
| 183 |
1
1. getPhysicalHeightDpi : replaced return of integer sized value with (x == 0 ? 1 : 0) → SURVIVED |
return physicalHeightDpi; |
| 184 | } | |
| 185 | ||
| 186 | /** | |
| 187 | * Returns physical height of the image in inches, if available. | |
| 188 | * <p> | |
| 189 | * Applies to TIFF (optional), BMP (always), GIF (constant: 72), Jpeg | |
| 190 | * (optional), PNG (optional), PNM (constant: 72), PSD/Photoshop (constant: | |
| 191 | * 72). | |
| 192 | * | |
| 193 | * @return returns -1 if not present. | |
| 194 | */ | |
| 195 | public float getPhysicalHeightInch() { | |
| 196 |
1
1. getPhysicalHeightInch : replaced return of float value with -(x + 1) for org/apache/commons/imaging/ImageInfo::getPhysicalHeightInch → SURVIVED |
return physicalHeightInch; |
| 197 | } | |
| 198 | ||
| 199 | /** | |
| 200 | * Returns vertical dpi of the image, if available. | |
| 201 | * <p> | |
| 202 | * Applies to TIFF (optional), BMP (always), GIF (constant: 72), Jpeg | |
| 203 | * (optional), PNG (optional), PNM (constant: 72), PSD/Photoshop (constant: | |
| 204 | * 72). | |
| 205 | * | |
| 206 | * @return returns -1 if not present. | |
| 207 | */ | |
| 208 | public int getPhysicalWidthDpi() { | |
| 209 |
1
1. getPhysicalWidthDpi : replaced return of integer sized value with (x == 0 ? 1 : 0) → SURVIVED |
return physicalWidthDpi; |
| 210 | } | |
| 211 | ||
| 212 | /** | |
| 213 | * Returns physical width of the image in inches, if available. | |
| 214 | * <p> | |
| 215 | * Applies to TIFF (optional), BMP (always), GIF (constant: 72), Jpeg | |
| 216 | * (optional), PNG (optional), PNM (constant: 72), PSD/Photoshop (constant: | |
| 217 | * 72). | |
| 218 | * | |
| 219 | * @return returns -1 if not present. | |
| 220 | */ | |
| 221 | public float getPhysicalWidthInch() { | |
| 222 |
1
1. getPhysicalWidthInch : replaced return of float value with -(x + 1) for org/apache/commons/imaging/ImageInfo::getPhysicalWidthInch → SURVIVED |
return physicalWidthInch; |
| 223 | } | |
| 224 | ||
| 225 | /** | |
| 226 | * Returns the width of the image in pixels. | |
| 227 | * | |
| 228 | * @see #getHeight() | |
| 229 | */ | |
| 230 | public int getWidth() { | |
| 231 |
1
1. getWidth : replaced return of integer sized value with (x == 0 ? 1 : 0) → KILLED |
return width; |
| 232 | } | |
| 233 | ||
| 234 | /** | |
| 235 | * Returns true if the image is progressive or interlaced. | |
| 236 | */ | |
| 237 | public boolean isProgressive() { | |
| 238 |
1
1. isProgressive : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE |
return isProgressive; |
| 239 | } | |
| 240 | ||
| 241 | /** | |
| 242 | * Returns the color type of the image, as a constant (ie. | |
| 243 | * ImageFormat.COLOR_TYPE_CMYK). | |
| 244 | * | |
| 245 | * @see #getColorTypeDescription() | |
| 246 | */ | |
| 247 | public int getColorType() { | |
| 248 |
1
1. getColorType : replaced return of integer sized value with (x == 0 ? 1 : 0) → SURVIVED |
return colorType; |
| 249 | } | |
| 250 | ||
| 251 | /** | |
| 252 | * Returns a description of the color type of the image. | |
| 253 | * | |
| 254 | * @see #getColorType() | |
| 255 | */ | |
| 256 | public String getColorTypeDescription() { | |
| 257 | switch (colorType) { | |
| 258 | case COLOR_TYPE_BW: | |
| 259 |
1
1. getColorTypeDescription : mutated return of Object value for org/apache/commons/imaging/ImageInfo::getColorTypeDescription to ( if (x != null) null else throw new RuntimeException ) → KILLED |
return "Black and White"; |
| 260 | case COLOR_TYPE_GRAYSCALE: | |
| 261 |
1
1. getColorTypeDescription : mutated return of Object value for org/apache/commons/imaging/ImageInfo::getColorTypeDescription to ( if (x != null) null else throw new RuntimeException ) → KILLED |
return "Grayscale"; |
| 262 | case COLOR_TYPE_RGB: | |
| 263 |
1
1. getColorTypeDescription : mutated return of Object value for org/apache/commons/imaging/ImageInfo::getColorTypeDescription to ( if (x != null) null else throw new RuntimeException ) → KILLED |
return "RGB"; |
| 264 | case COLOR_TYPE_CMYK: | |
| 265 |
1
1. getColorTypeDescription : mutated return of Object value for org/apache/commons/imaging/ImageInfo::getColorTypeDescription to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return "CMYK"; |
| 266 | case COLOR_TYPE_YCbCr: | |
| 267 |
1
1. getColorTypeDescription : mutated return of Object value for org/apache/commons/imaging/ImageInfo::getColorTypeDescription to ( if (x != null) null else throw new RuntimeException ) → KILLED |
return "YCbCr"; |
| 268 | case COLOR_TYPE_YCCK: | |
| 269 |
1
1. getColorTypeDescription : mutated return of Object value for org/apache/commons/imaging/ImageInfo::getColorTypeDescription to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return "YCCK"; |
| 270 | case COLOR_TYPE_YCC: | |
| 271 |
1
1. getColorTypeDescription : mutated return of Object value for org/apache/commons/imaging/ImageInfo::getColorTypeDescription to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return "YCC"; |
| 272 | case COLOR_TYPE_OTHER: | |
| 273 |
1
1. getColorTypeDescription : mutated return of Object value for org/apache/commons/imaging/ImageInfo::getColorTypeDescription to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return "Other"; |
| 274 | case COLOR_TYPE_UNKNOWN: | |
| 275 |
1
1. getColorTypeDescription : mutated return of Object value for org/apache/commons/imaging/ImageInfo::getColorTypeDescription to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return "Unknown"; |
| 276 | ||
| 277 | default: | |
| 278 |
1
1. getColorTypeDescription : mutated return of Object value for org/apache/commons/imaging/ImageInfo::getColorTypeDescription to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return "Unknown"; |
| 279 | } | |
| 280 | ||
| 281 | } | |
| 282 | ||
| 283 | public void dump() { | |
| 284 |
1
1. dump : removed call to java/io/PrintStream::print → NO_COVERAGE |
System.out.print(toString()); |
| 285 | } | |
| 286 | ||
| 287 | @Override | |
| 288 | public String toString() { | |
| 289 | try { | |
| 290 | final StringWriter sw = new StringWriter(); | |
| 291 | final PrintWriter pw = new PrintWriter(sw); | |
| 292 | ||
| 293 |
1
1. toString : removed call to org/apache/commons/imaging/ImageInfo::toString → NO_COVERAGE |
toString(pw, ""); |
| 294 |
1
1. toString : removed call to java/io/PrintWriter::flush → NO_COVERAGE |
pw.flush(); |
| 295 | ||
| 296 |
1
1. toString : mutated return of Object value for org/apache/commons/imaging/ImageInfo::toString to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return sw.toString(); |
| 297 | } catch (final Exception e) { | |
| 298 |
1
1. toString : mutated return of Object value for org/apache/commons/imaging/ImageInfo::toString to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return "Image Data: Error"; |
| 299 | } | |
| 300 | } | |
| 301 | ||
| 302 | public void toString(final PrintWriter pw, final String prefix) { | |
| 303 |
1
1. toString : removed call to java/io/PrintWriter::println → NO_COVERAGE |
pw.println("Format Details: " + formatDetails); |
| 304 | ||
| 305 |
1
1. toString : removed call to java/io/PrintWriter::println → NO_COVERAGE |
pw.println("Bits Per Pixel: " + bitsPerPixel); |
| 306 |
1
1. toString : removed call to java/io/PrintWriter::println → NO_COVERAGE |
pw.println("Comments: " + comments.size()); |
| 307 |
2
1. toString : changed conditional boundary → NO_COVERAGE 2. toString : negated conditional → NO_COVERAGE |
for (int i = 0; i < comments.size(); i++) { |
| 308 | final String s = comments.get(i); | |
| 309 |
1
1. toString : removed call to java/io/PrintWriter::println → NO_COVERAGE |
pw.println("\t" + i + ": '" + s + "'"); |
| 310 | ||
| 311 | } | |
| 312 |
1
1. toString : removed call to java/io/PrintWriter::println → NO_COVERAGE |
pw.println("Format: " + format.getName()); |
| 313 |
1
1. toString : removed call to java/io/PrintWriter::println → NO_COVERAGE |
pw.println("Format Name: " + formatName); |
| 314 |
1
1. toString : removed call to java/io/PrintWriter::println → NO_COVERAGE |
pw.println("Compression Algorithm: " + compressionAlgorithm); |
| 315 |
1
1. toString : removed call to java/io/PrintWriter::println → NO_COVERAGE |
pw.println("Height: " + height); |
| 316 |
1
1. toString : removed call to java/io/PrintWriter::println → NO_COVERAGE |
pw.println("MimeType: " + mimeType); |
| 317 |
1
1. toString : removed call to java/io/PrintWriter::println → NO_COVERAGE |
pw.println("Number Of Images: " + numberOfImages); |
| 318 |
1
1. toString : removed call to java/io/PrintWriter::println → NO_COVERAGE |
pw.println("Physical Height Dpi: " + physicalHeightDpi); |
| 319 |
1
1. toString : removed call to java/io/PrintWriter::println → NO_COVERAGE |
pw.println("Physical Height Inch: " + physicalHeightInch); |
| 320 |
1
1. toString : removed call to java/io/PrintWriter::println → NO_COVERAGE |
pw.println("Physical Width Dpi: " + physicalWidthDpi); |
| 321 |
1
1. toString : removed call to java/io/PrintWriter::println → NO_COVERAGE |
pw.println("Physical Width Inch: " + physicalWidthInch); |
| 322 |
1
1. toString : removed call to java/io/PrintWriter::println → NO_COVERAGE |
pw.println("Width: " + width); |
| 323 |
1
1. toString : removed call to java/io/PrintWriter::println → NO_COVERAGE |
pw.println("Is Progressive: " + isProgressive); |
| 324 |
1
1. toString : removed call to java/io/PrintWriter::println → NO_COVERAGE |
pw.println("Is Transparent: " + isTransparent); |
| 325 | ||
| 326 |
1
1. toString : removed call to java/io/PrintWriter::println → NO_COVERAGE |
pw.println("Color Type: " + getColorTypeDescription()); |
| 327 |
1
1. toString : removed call to java/io/PrintWriter::println → NO_COVERAGE |
pw.println("Uses Palette: " + usesPalette); |
| 328 | ||
| 329 |
1
1. toString : removed call to java/io/PrintWriter::flush → NO_COVERAGE |
pw.flush(); |
| 330 | ||
| 331 | } | |
| 332 | ||
| 333 | /** | |
| 334 | * Returns a description of the file format, ie. format version. | |
| 335 | */ | |
| 336 | public String getFormatDetails() { | |
| 337 |
1
1. getFormatDetails : mutated return of Object value for org/apache/commons/imaging/ImageInfo::getFormatDetails to ( if (x != null) null else throw new RuntimeException ) → KILLED |
return formatDetails; |
| 338 | } | |
| 339 | ||
| 340 | /** | |
| 341 | * Returns true if the image has transparency. | |
| 342 | */ | |
| 343 | public boolean isTransparent() { | |
| 344 |
1
1. isTransparent : replaced return of integer sized value with (x == 0 ? 1 : 0) → KILLED |
return isTransparent; |
| 345 | } | |
| 346 | ||
| 347 | /** | |
| 348 | * Returns true if the image uses a palette. | |
| 349 | */ | |
| 350 | public boolean usesPalette() { | |
| 351 |
1
1. usesPalette : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE |
return usesPalette; |
| 352 | } | |
| 353 | ||
| 354 | /** | |
| 355 | * Returns a description of the compression algorithm, if any. | |
| 356 | */ | |
| 357 | public String getCompressionAlgorithm() { | |
| 358 |
1
1. getCompressionAlgorithm : mutated return of Object value for org/apache/commons/imaging/ImageInfo::getCompressionAlgorithm to ( if (x != null) null else throw new RuntimeException ) → KILLED |
return compressionAlgorithm; |
| 359 | } | |
| 360 | ||
| 361 | } | |
Mutations | ||
| 112 |
1.1 |
|
| 121 |
1.1 |
|
| 133 |
1.1 |
|
| 142 |
1.1 |
|
| 151 |
1.1 |
|
| 160 |
1.1 |
|
| 170 |
1.1 |
|
| 183 |
1.1 |
|
| 196 |
1.1 |
|
| 209 |
1.1 |
|
| 222 |
1.1 |
|
| 231 |
1.1 |
|
| 238 |
1.1 |
|
| 248 |
1.1 |
|
| 259 |
1.1 |
|
| 261 |
1.1 |
|
| 263 |
1.1 |
|
| 265 |
1.1 |
|
| 267 |
1.1 |
|
| 269 |
1.1 |
|
| 271 |
1.1 |
|
| 273 |
1.1 |
|
| 275 |
1.1 |
|
| 278 |
1.1 |
|
| 284 |
1.1 |
|
| 293 |
1.1 |
|
| 294 |
1.1 |
|
| 296 |
1.1 |
|
| 298 |
1.1 |
|
| 303 |
1.1 |
|
| 305 |
1.1 |
|
| 306 |
1.1 |
|
| 307 |
1.1 2.2 |
|
| 309 |
1.1 |
|
| 312 |
1.1 |
|
| 313 |
1.1 |
|
| 314 |
1.1 |
|
| 315 |
1.1 |
|
| 316 |
1.1 |
|
| 317 |
1.1 |
|
| 318 |
1.1 |
|
| 319 |
1.1 |
|
| 320 |
1.1 |
|
| 321 |
1.1 |
|
| 322 |
1.1 |
|
| 323 |
1.1 |
|
| 324 |
1.1 |
|
| 326 |
1.1 |
|
| 327 |
1.1 |
|
| 329 |
1.1 |
|
| 337 |
1.1 |
|
| 344 |
1.1 |
|
| 351 |
1.1 |
|
| 358 |
1.1 |


--- layout: page title: Lean Prover Zulip Chat Archive permalink: archive/113488general/93477computablefunctionType2Type1.html ---
is there any computable non-constant function Type 2 -> Type 1?
def f : Type 2 → Type := λ α , plift (nonempty α)
nice
Type
!= Type 1
. You need one more plift
.


Reekado Banks Releases Colorful Video For New Single “Put In Pressure”
by Violet JohnsonNigerian music star, Ayoleyi Hanniel Solomon popularly known as Reekado Banks has released the official video to his latest single, Put In Pressure.
The song which is an automatic invite to a dance party taps the catchy up-tempo rhythm dominant on the streets of Lagos. It is a follow-up to his hit single Rora and the second single from his upcoming sophomore album.
Since everyone is now looking towards “Detty December” which is almost upon us, this track appears to be the ultimate soundtrack.
Put In Pressure was produced by Kel P, while the colourful visual was created by Clarence Peters.
Press play!


Week 14 college football betting lookahead: Can Michigan hang with Ohio State?
by Will HarrisCollege football lookahead is the essential grab bag of numbers, trends, reads and concepts each Monday throughout the season.
In Week 14, we continue the discussion of the November phenomenon of "scoreboard watching" as it relates to the unresolved conference title races and preview both Thanksgiving night's Egg Bowl and a Saturday Lone Star showdown with circumstances that favor the home team.
All lines and totals from Circa Sportsbook as of Sunday.
Openers
First impressions from the schedule and opening lines.
Ohio State Buckeyes (-9.5, 54) at Michigan Wolverines
Noon ET, Saturday (FOX)
Rich Rodriguez went 0-3 straight up and ATS versus Ohio State as Michigan head coach, disappointing Wolverines backers while taking 20.5, 10 and 17 points from the Buckeyes. Apart from RichRod's tenure, however, teams getting a touchdown or more in this series have covered nine of the past 10 meetings.


{% extends 'marketaccess/report_barrier_form/base.html' %} {% load static from staticfiles %} {% block extra_contents %}
Report a trade barrier
Step {{ wizard.steps.step1 }} of {{ wizard.steps.count }}
By submitting this form you agree to our privacy policy.
{% endblock %} {% block submit_button_label %}Send report{% endblock %}


We are a team of creatively diverse, driven, innovative individuals working in various locations from the world.


Video not supported
Ohh Snap! 404
Looks like the page you are looking for does not exist.
No worries. You can either head back to your
dashboard
or watch this beautiful time lapse video.


Brian Truong Nguyen is a 4th year UCSD student working on a B.S. Computer Science. He is set to graduate in June 2017. He has had experience working with web, mobile and desktop applications. Brian has the most experience in working with the server side aspects of applications, utilizing tools such as Java Web Service to create a live storage of data for an application.


Currently I am working at the fantastic financial technology startup, FundThrough as the partnerships manager. We help small businesses access the funds in their outstanding invoices, allowing them to solve their cash flow problems.
For more information visit my About Me page.


⚠ Oops! This page doesn't appear to define a
type
called
_
.
Show navigation
Search
Home
Page Contents
Package modules
SqlComposer
SqlComposer_component
SqlComposer_conversion
SqlComposer_delete
SqlComposer_select
SqlComposer_update


| promise {promises} | R Documentation |
promise()
creates a new promise. A promise is a placeholder object for the
eventual result (or error) of an asynchronous operation. This function is not
generally needed to carry out asynchronous programming tasks; instead, it is
intended to be used mostly by package authors who want to write asynchronous
functions that return promises.
promise(action)
action |
A function with signature |
The action
function should be a piece of code that returns quickly, but
initiates a potentially long-running, asynchronous task. If/when the task
successfully completes, call resolve(value)
where value
is the result of
the computation (like the return value). If the task fails, call
reject(reason)
, where reason
is either an error object, or a character
string.
It's important that asynchronous tasks kicked off from action
be coded very
carefully–in particular, all errors must be caught and passed to reject()
.
Failure to do so will cause those errors to be lost, at best; and the caller
of the asynchronous task will never receive a response (the asynchronous
equivalent of a function call that never returns, i.e. hangs).
The return value of action
will be ignored.
A promise object (see then
).
# Create a promise that resolves to a random value after 2 secs p1 <- promise(function(resolve, reject) { later::later(~resolve(runif(1)), delay = 2) }) p1 %...>% print() # Create a promise that errors immediately p2 <- promise(~{ reject("An error has occurred") }) then(p2, onFulfilled = ~message("Success"), onRejected = ~message("Failure") )


Now what happens if the transformation from ED50 to ED87 is applied with the correct input values, derived from the ED50 coordinates of the point, but with the signs of the coefficients reversed? The result would be a correction of the same magnitude, but with changed sign.
The final step is to evaluate what would happen if the polynomial transformation were applied with reversed sign coefficients and with the ED87 coordinates of the point as input. The result would be a correction vector with reversed sign, but which would be wrong by a factor of 10-6 or 1 micron which is not significant.
The last described scenario is the reverse coordinate transformation, from ED87 to ED50.
The error made by the polynomial approximation formulas in calculating the reverse correction is of the same order of magnitude as the ratio of output versus input:
output error output value
Ύ Ύ Ύ Ύ Ύ » Ύ Ύ Ύ Ύ Ύ (» 10-6)
input error input value
As long as the input values (the coordinate offsets from the evaluation point) are orders of magnitude larger than the output (the corrections), and provided the coefficients are used with changed signs, the polynomial transformation may be considered to be reversible.
EPSG recognises two classes of general polynomial functions, distinguished by whether or not the coefficients may be used in both forward and reverse transformations, i.e. are reversible. Note that in the reversible polynomial class, the signs of the coefficients but not of the evaluation point coordinates are reversed.
Because the coordinate differences are small and the coordinates in the source and target systems are very similar in magnitude, in reversible polynomial transformations it is possible to adopt the same coordinate values for the evaluation point in both source and target systems. As the evaluation point coordinates are the same in source and target coordinate reference systems, the points are at two physically different locations. The difference in position between these is accounted for within the zero order coefficient values of the polynomial.
Then
U = XS X0 in defined units (which may not be those of the coordinate reference system),
V = YS Y0
and
XT = XS + dX
YT = YS + dY
where dX and dY are derived from the polynomial expressions for the general polynomial.
Example: 4th order reversible polynomial
For geodetic coordinate transformation ED50 to ED87 (1)
Offset unit: degree
Ordinate 1 of evaluation point X0 = 55° 00' 00.000"N = +55 degrees
Ordinate 2 of evaluation point Y0 = 0° 00' 00.000"E = +0 degrees
Parameters:
A0 = 5.56098E-06 A1 = 1.55391E-06 ... A14 = 4.01383E-09
B0 = +1.48944E-05 B2 = +2.68191E-05 ... B14 = +7.62236E-09
Forward calculation for:
Latitude j ED50 = Xs = 52° 30' 30" N = +52.508333333 degrees
Longitude l ED50 = Ys = 2° E = +2.0 degrees
U = XS X0 = j ED50 X0 = 52.508333333 55.0 = -2.491666667 degrees
V = YS Y0 = l ED50 Y0 = 2.0 0.0 = 2.0 degrees
dX = A0 + A1.U + ... + A14.V4
= 5.56098E-06 + ( 1.55391E-06 * 2.491666667) + ... + ( 4.01383E-09 * 2.0^4)
= 3.12958E-06 degrees
dY = B0 + B1.U + ... + B14.V4
= +1.48944E-05 + (2.68191E-05 * 2.491666667) + ... + (7.62236E-09 * 2.0^4)
= +9.80126E-06 degrees
Then Latitude j ED87 = XT = XS + dX
= 52.508333333 - 3.12958E-06 degrees
= 52° 30' 29.9887" N
Longitude l ED87 = YT = YS + dY
= 2° 00' 00.0353" E
Reverse calculation for coordinate transformation ED50 to ED87 (1).
The transformation method for the ED50 to ED87 (1) coordinate transformation, 4th-order reversible polynomial, is reversible. The same formulas may be applied for the reverse calculation, but coefficients A0 through A14 and B0 through B14 are applied with reversal of their signs. Sign reversal is not applied to the coordinates of the evaluation point. Thus:
Ordinate 1 of evaluation point X0 = 55° 00' 00.000"N = +55 degrees
Ordinate 2 of evaluation point Y0 = 0° 00' 00.000"E = +0 degrees
A0 = +5.56098E-06 A1 = +1.55391E-06 ... A14 = +4.01383E-09
B0 = 1.48944E-05 B1 = 2.68191E-05 ... B14 = 7.62236E-09
Reverse calculation for:
Latitude j ED87 = XS = 52° 30' 29.9887"N = +52.5083301944 degrees
Longitude l ED87 = YS = 2° 00' 00.0353" E = +2.0000098055 degrees
U = 52.5083301944 55.0 = 2.4916698056 degrees
V = 2.0000098055 0.0 = 2.0000098055 degrees
dX = A0 + A1.U + ... + A14.V4
= +5.56098E-06 + (1.55391E-06 * -2.491666667) + ...
... + (4.01383E-09 * 2.0000098055^4)
= +3.12957E-06 degrees
dY = B0 + B1.U + ... + B14.V4
= 1.48944E-05 + ( 2.68191E-05 * 2.491666667) + ...
... + ( 7.62236E-09 * 2.0000098055^4)
= 9.80124E-06 degrees
Then Latitude j ED50 = XT = XS + dX
= 52.5083301944 + 3.12957E-06 degrees
= 52° 30' 30.000" N
Longitude l ED50 = YT = YS + dY
= 2° 00' 00.000" E
<IP_ADDRESS> Polynomial transformation with complex numbers
The relationship between two projected coordinate reference systems may be approximated more elegantly by a single polynomial regression formula written in terms of complex numbers. The advantage is that the dependence between the A and B coefficients (for U and V) is taken into account in the formula, resulting in fewer coefficients for the same order polynomial. A third-order polynomial in complex numbers is used in Belgium. A fourth-order polynomial in complex numbers is used in The Netherlands for transforming coordinates referenced to the Amersfoort / RD system to and from ED50 / UTM.
(dX + i. dY) = (A1 + i. A2).(U + i.V) + (A3 + i. A4).(U + i.V)2 (to 2nd order)
+ (A5 + i. A6).(U + i.V)3 (additional 3rd order terms)
+ (A7 + i.A8).(U + i.V)4 (additional 4th order terms)
where U = (XS XS0).10-5
and V = (YS YS0).10-5
The fourth order polynomial (EPSG coordinate operation method code 9632) can alternatively be expressed in matrix form as
|
ζ |
U |
φ |
|||||||||||||||
|
η |
V |
χ |
|||||||||||||||
|
ζ |
dC |
φ |
ζ |
+A1 |
A2 |
+A3 |
A4 |
+A5 |
A6 |
+A7 |
A8 |
φ |
η |
U2V2 |
χ |
||
|
η |
χ |
= |
η |
χ |
* |
η |
2UV |
χ |
|||||||||
|
θ |
dU |
ψ |
θ |
+A2 |
+A1 |
+A4 |
+A3 |
+A6 |
+A5 |
+A8 |
+A7 |
ψ |
η |
U33UV2 |
χ |
||
|
η |
3U2VV3 |
χ |
|||||||||||||||
|
η |
U46U2V2 + V4 |
χ |
|||||||||||||||
|
θ |
4U3V4UV3 |
ψ |
Then as for the general polynomial case in section 3.1 above
XT = XS XS0 + XT0 + dX
YT = YS YS0 + YT0 + dY
and where, as above,
XT , YT are coordinates in the target coordinate system,
XS , YS are coordinates in the source coordinate system,
XS0 , YS0 are coordinates of the evaluation point in the source coordinate reference system,
XT0 , YT0 are coordinates of the evaluation point in the target coordinate reference system.
Note that the zero order coefficients of the general polynomial, A0 and B0, have apparently disappeared. In reality they are absorbed by the different coordinates of the source and of the target evaluation point, which in this case, are numerically very different because of the use of two different projected coordinate reference systems for source and target.
The transformation parameter values (the coefficients) are not reversible. For the reverse transformation a different set of parameter values are required, used within the same formulas as the forward direction.
Example:
Coordinate transformation: Amersfoort / RD New to ED50 / UTM zone 31N (1):
Formula Parameter
EPSG coordinate transformation parameter name symbol value Unit
------------------------------------------------------------------- ----------- ----------------- --------
ordinate 1 of the evaluation point in the source CRS XS0 155,000.000 metre
ordinate 2 of the evaluation point in the source CRS YS0 463,000.000 metre
ordinate 1 of the evaluation point in the target CRS XT0 663,395.607 metre
ordinate 2 of the evaluation point in the target CRS YT0 5,781,194.380 metre
A1 A1 51.681 coefficient
A2 A2 +3,290.525 coefficient
A3 A3 +20.172 coefficient
A4 A4 +1.133 coefficient
A5 A5 +2.075 coefficient
A6 A6 +0.251 coefficient
A7 A7 +0.075 coefficient
A8 A8 0.012 coefficient
For input point:
Easting, XAMERSFOORT/RD = XS = 200,000.00 metres
Northing, YAMERSFOORT/RD = YS = 500,000.00 metres
U = (XS XS0) .105 = (200,000 155,000) .10-5 = 0.45
V = (YS YS0) .105 = (500,000 463,000) .10-5 = 0.37
dX = 1,240.050
dY = 1,468.748
Then
Easting, EED50/UTM31N = XT = XS XS0 + XT0 + dX
= 200,000 155,000 + 663,395.607 + ( 1,240.050)
= 707,155.557 metres
Northing, NED50/UTM31N = YT = YS YS0 + YT0 + dY
= 500,000 463,000 + 5,781,194.380 + 1,468.748
= 5,819,663.128 metres
<IP_ADDRESS> Polynomial transformation for Spain (EPSG coordinate operation method code 9617)
The original geographic coordinate reference system for the Spanish mainland was based on Madrid 1870 datum, Struve 1860 ellipsoid, with longitudes related to the Madrid meridian. Three second-order polynomial expressions have been empirically derived by El Servicio Geogrαfico del Ejιrcito to transform geographical coordinates based on this system to equivalent values based on the European Datum of 1950 (ED50). The polynomial coefficients derived can be used to transform coordinates from the Madrid 1870 (Madrid) geographic coordinate reference system to the ED50 system. Three pairs of expressions have been derived: each pair is used to calculate the shift in latitude and longitude respectively for (i) a mean for all Spain, (ii) a better fit for the north of Spain, (iii) a better fit for the south of Spain.
The polynomial expressions are:
dj (arc sec) = A0 + (A1*j s) + (A2*l s) + (A3*Hs)
dl (arc sec) = B00 + B0 + (B1*j s) + (B2*l s) + (B3*Hs)
where latitude j s and longitude l s are in decimal degrees referred to the Madrid 1870 (Madrid) geographic coordinate reference system and Hs is gravity-related height in metres. B00 is the longitude (in seconds) of the Madrid meridian measured from the Greenwich meridian; it is the value to be applied to a longitude relative to the Madrid meridian to transform it to a longitude relative to the Greenwich meridian.
The results of these expressions are applied through the formulas:
j ED50 = j M1870(M) + dj
and l ED50 = l M1870(M) + dl .
Example:
Input point coordinate reference system: Madrid 1870 (Madrid) (geographic 2D)
Latitude j s = 42° 38' 52.77" N
= +42.647992 degrees
Longitude l s = 3° 39' 34.57" E of Madrid
= +3.659603 degrees from the Madrid meridian.
Gravity-related height Hs = 0 m
For the north zone transformation:
A0 = 11.328779 B00 = -13276.58
A1 = -0.1674 B0 = 2.5079425
A2 = -0.03852 B1 = 0.8352
A3 = 0.0000379 B2 = -0.00864
B3 = -0.0000038
dj = +4.05 seconds
Then latitude j ED50 = 42° 38' 52.77" N + 4.05"
= 42° 38' 56.82" N
dl = -13270.54 seconds = -3° deg 41' min 10.54" sec
Then longitude l ED50 = 3° 39' 34.57" E - 3° 41' 10.54"
= 0° 01' 35.97" W of Greenwich.
2.4.2 Miscellaneous Linear Coordinate Operations
An affine 2D transformation is used for converting or transforming a coordinate reference system possibly with non-orthogonal axes and possibly different units along the two axes to an isometric coordinate reference system (i.e. a system of which the axes are orthogonal and have equal scale units). The transformation therefore involves a change of origin, differential change of axis orientation and a differential scale change. EPSG distinguishes four methods to implement this class of coordinate operation:
2) the geometric representation, which is described in
<IP_ADDRESS> The Affine Parametric Transformation (EPSG coordinate operation method code 9624)
Mathematical and survey literature usually provides the parametric representation of the affine transformation. The parametric algorithm is commonly used for rectification of digitised maps. It is often embedded in CAD software and Geographical Information Systems where it is frequently referred to as "rubber sheeting". Although the application of this algorithm falls outside the scope of the EPSG geodesy data set it is presented here for reasons of clarity.
The formula in matrix form is as follows:
|
ζ |
XT |
φ |
ζ |
A0 |
φ |
ζ |
A1 |
A2 |
φ |
ζ |
XS |
φ |
|||
|
η |
χ |
= |
η |
χ |
+ |
η |
χ |
* |
η |
χ |
|||||
|
θ |
YT |
ψ |
θ |
B0 |
ψ |
θ |
B1 |
B2 |
ψ |
θ |
YS |
ψ |
or using algebraic coefficients:
XT = A0 + A1. XS + A2.YS
YT = B0 + B1. XS + B2.YS
where
XT , YT are the coordinates of a point P in the target coordinate reference system;
XS , YS are the coordinates of P in the source coordinate reference system.
This form of describing an affine transformation is analogous to the general polynomial transformation formulas (section 3.1 above). Although it is somewhat artificial, an affine transformation could be considered to be a first order general polynomial transformation but without the reduction to source and target evaluation points.
Reversibility
The parameter values for an affine transformation cannot be used for the reverse operation. However, the reverse operation is another affine transformation using the same formulas but with different parameter values. The reverse parameter values, indicated by a prime ('), can be calculated from those of the forward operation as follows:
D = A1 . B2 A2 . B1
A0' = (A2 . B0 B2 . A0) / D
B0' = (B1 . A0 A1 . B0) / D
A1' = +B2 / D
A2' = A2 / D
B1' = B1 / D
B2' = +A1 / D
<IP_ADDRESS> The Affine General Geometric Transformation
(EPSG coordinate operation method code 9623)
Figure 8 Geometric representation of the affine transformation
(Please note that to prevent cluttering of the figure the scale parameters of the Xs and Ys axes have been omitted).
From the diagram above it can be seen that:
XTP = XT0 + YSP . sin qY + XSP . cos qX
YTP = YT0 + YSP . cos qY XSP . sin qX
Scale of the two coordinate reference systems
The scaling of both source and target coordinate reference systems adds some complexity to this formula.
The operation will often be applied to transform an engineering coordinate reference system to a projected coordinate reference system. The engineering coordinate reference system, e.g. a seismic bin grid, may have different units of measure on its two axes. These have scale ratios of dSX and dSY respective to the axes of the projected coordinate reference system.
The projected coordinate reference system is nominally defined to be in well-known units, e.g. metres. However, the distortion characteristics of the map projection only preserve true scale along certain defined lines or curves, hence the projected coordinate reference systems unit of measure is strictly speaking only valid along those lines or curves. Everywhere else its scale is distorted by the map projection. For conformal map projections the distortion at any point can be expressed by the point scale factor k for that point. Please note that this point scale factor k should NOT be confused with the scale factor at the natural origin of the projection, denominated by k0. For non-conformal map projections the scale distortion at a point is bearing-dependent and will not be described in this document.
It has developed as working practice to choose the origin of the source (engineering) coordinate reference system as the point in which to calculate this point scale factor k, although for engineering coordinate reference systems with a large coverage area a point in the middle of the coverage area may be a better choice.
Adding the scaling between each pair of axes and dropping the suffix for point P, after rearranging the terms we have the geometric representation of the general affine transformation:
XT = XT0 + XS . k.dSX . cos qX + YS . k.dSY . sin qY
YT = YT0 XS . k.dSX . sin qX + YS . k.dSY . cos qY
or, in matrix form:
|
ζ |
XT |
φ |
ζ |
XT0 |
φ |
ζ |
cos qX |
sin qY |
φ |
ζ |
k.dSX |
0 |
φ |
ζ |
XS |
φ |
||||
|
η |
χ |
= |
η |
χ |
+ |
η |
χ |
* |
η |
χ |
* |
η |
χ |
|||||||
|
θ |
YT |
ψ |
θ |
YT0 |
ψ |
θ |
sin qX |
cos qY |
ψ |
θ |
0 |
k.dSY |
ψ |
θ |
YS |
ψ |
where:
XT0 ,YT0 = the coordinates of the origin point of the source coordinate reference system, expressed in the target coordinate reference system;
dSX , dSY = the length of one unit of the source axis, expressed in units of the target axis, for the first and second source and target axis pairs respectively;
k = point scale factor of the target coordinate reference system at a chosen reference point;
qX , qY = the angles about which the source coordinate reference system axes XS and YS must be rotated to coincide with the target coordinate reference system axes XT and YT respectively (counter-clockwise being positive).
Comparing the algebraic representation with the parameters of the parameteric form in section <IP_ADDRESS> above it can be seen that the parametric and geometric forms of the affine coordinate transformation are related as follows:
A0 = XT0
A1 = k.dSX * cos qX
A2 = k.dSY * sin qY
B0 = YT0
B1 = k.dSX * sin qX
B2 = k.dSY * cos qY
Reversibility
The parameters for an affine transformation cannot be used for the reverse transformation. However, the reverse coordinate operation is another affine transformation using the same formulas but with different parameters. The reverse parameter values can be calculated from the formulas provided above and applying those to the same algorithm. Alternatively the reverse operation can be described by a different formula, as shown below, using the same parameters as the forward transformation.
|
ζ |
XS |
φ |
1 |
ζ |
1/dSX |
0 |
φ |
ζ |
cos qY |
sin qY |
φ |
ζ |
XT XT0 |
φ |
|||
|
η |
χ |
= |
* |
η |
χ |
* |
η |
χ |
* |
η |
χ |
||||||
|
θ |
YS |
ψ |
k.D |
θ |
0 |
1/dSY |
ψ |
θ |
sin qX |
cos qX |
ψ |
θ |
YT YT0 |
ψ |
where D = cos (qX qY);
or algebraically:
XS = [( XT XT0) . cos qY (YT YT0) . sin qY ] / [k.dSX . cos (qX qY)]
YS = [(XT XT0) . sin qX + (YT YT0) . cos qX ] / [k.dSY . cos (qX qY)]
<IP_ADDRESS> The Affine Orthogonal Geometric Transformation
(EPSG coordinate operation method code 9622)
If the source coordinate reference system happens to have orthogonal axes, that is both axes are rotated through the same angle to bring them into the direction of the orthogonal target coordinate reference system axes, i.e. qX = qY = q, then the Affine General Geometric Transformation can be simplified to the Affine Orthogonal Geometric Transformation. In matrix form this is:
|
ζ |
XT |
φ |
ζ |
XT0 |
φ |
ζ |
cos q |
sin q |
φ |
ζ |
k.dSX |
0 |
φ |
ζ |
XS |
φ |
||||
|
η |
χ |
= |
η |
χ |
+ |
η |
χ |
* |
η |
χ |
* |
η |
χ |
|||||||
|
θ |
YT |
ψ |
θ |
YT0 |
ψ |
θ |
sin q |
cos q |
ψ |
θ |
0 |
k.dSY |
ψ |
θ |
YS |
ψ |
or algebraically:
XT = XT0 + XS . k . dSX . cos q + YS . k . dSY . sin q
YT = YT0 XS . k . dSX . sin q + YS . k . dSY . cos q
where:
XT0 ,YT0 = the coordinates of the origin point of the source coordinate reference system, expressed in the target coordinate reference system;
dSX , dSY = the length of one unit of the source axis, expressed in units of the target axis, for the X axes and the Y axes respectively;
k = point scale factor of the target coordinate reference system at a chosen reference point;
q = the angle through which the source coordinate reference system axes must be rotated to coincide with the target coordinate reference system axes (counter-clockwise is positive). Alternatively, the bearing (clockwise positive) of the source coordinate reference system YS-axis measured relative to target coordinate reference system north.
For the reverse case the Affine General Geometric Transformation formulas given above can be similarly simplified by replacing qX and qY with q.
See below for example.
<IP_ADDRESS> The Similarity Transformation (EPSG coordinate operation method code 9621)
If the source coordinate reference system happens to have axes of the same scale, that is both axes are scaled by the same factor to bring them into the scale of the target coordinate reference system axes (i.e. dSX = dSY = dS) then the Affine Orthogonal Geometric Transformation can be simplified further to a Similarity Transformation.
Figure 9 Similarity transformation
From the above diagram the Similarity Transformation in algebraic form is:
XTP = XT0 + YSP. dS . sin q + XSP. dS. cos q
YTP = YT0 + YSP. dS . cos q XSP. dS. sin q
Dropping the suffix for point P and rearranging the terms
XT = XT0 + XS. dS. cos q + YS. dS . sin q
YT = YT0 XS. dS. sin q + YS. dS . cos q
or in matrix form:
|
ζ |
XT |
φ |
ζ |
XT0 |
φ |
ζ |
cos q |
sin q |
φ |
ζ |
XS |
φ |
|||
|
η |
χ |
= |
η |
χ |
+ ( 1 + dS ) * |
η |
χ |
* |
η |
χ |
|||||
|
θ |
YT |
ψ |
θ |
YT0 |
ψ |
θ |
sin q |
cos q |
ψ |
θ |
YS |
ψ |
where:
XT0 , YT0 = the coordinates of the origin point of the source coordinate reference system expressed in the target coordinate reference system;
1+dS = the length of one unit in the source coordinate reference system expressed in units of the target coordinate reference system;
q = the angle about which the axes of the source coordinate reference system need to be rotated to coincide with the axes of the target coordinate reference system, counter-clockwise being positive. Alternatively, the bearing of the source coordinate reference system YS-axis measured relative to target coordinate reference system north.
The Similarity Transformation can also be described as a special case of the Affine Parametric Transformation where coefficients A1 = B2 and A2 = B1.
Reversibility
In contrast with an Affine Transformation, the Similarity Transformation parameters are reversible, but only on the condition that the scale difference between the two coordinate reference systems is small (order of several parts per million). Then dS is the deviation from unity of the ratio of the units of measure of the two coordinate reference systems. In these cases the reverse operation would require a scale correction of 1/(1+dS) » (1 dS). This enables usage of the same scale and rotation parameters, but with reversed sign, for the reverse conversions. (The rotation angle of +q becomes q, which is valid for all q). However for the reverse transformation the translation parameters, XT0 and YT0, take entirely different values. Thus for all practical purposes the similarity conversion is not reversible.
When to use the Similarity Transformation
Similarity Transformations can be used when source and target coordinate reference systems
and
for example between engineering plant grids and projected coordinate reference systems.
A coordinate conversion between two systems that:
but:
should be defined as an Affine Orthogonal Transformation and not as a Similarity Transformation. This may be the case with seismic bin grids with square bins.
Coordinate Operations between two coordinate reference systems where in either system either the scale along axes differ or the axes are not orthogonal should be defined as an Affine General Transformation in either the parametric or geometric form.
Examples
Similarity Transformation method
Source coordinate reference system: Astra Minas Grid (an engineering coordinate reference system)
Target coordinate reference system: Campo Inchauspe / Argentina 2 (a projected CRS)
Note that for the Astra Minas Grid the coordinate axes are:
X (positive axis oriented north)
Y (positive axis oriented west)
and coordinates are quoted in that order.
whereas for Campo Inchauspe / Argentina 2 the axes are:
X (positive axis oriented north)
Y (positive axis oriented east)
and coordinates are quoted in that order.
Thus the Astra Minas grid X and Y axes map to the Campo Inchauspe / Argentina 2 Y and X-axes respectively. With respect to the symbols in the formulas,
XS = Astra Minas X
YS = Astra Minas Y
XT = Campo Inchauspe / Argentina 2 Y
YT = Campo Inchauspe / Argentina 2 X
Parameters of the Similarity Transformation:
XT0 = 2610200.48 metre
YT0 = 4905282.73 metre
q = 271o 05 30" =<PHONE_NUMBER> degrees
k = 0 whence (1+k)=1.0
Forward calculation for Astra Minas point : X (north) =10000 m, Y (west) =50000 m.
XS = Astra Minas X = 10000
YS = Astra Minas Y = 50000
Gauss-Kruger zone 2 Easting (Y) = XT = XT0 + XS. dS. cos q + YS. dS . sin q
= 2610200.48 + (50000 * 1.0 * cos(271.0916667deg))
+ (10000 * 1.0 * sin(271.0916667deg))
= 2601154.90 m.
Gauss-Kruger zone 2 Northing (X) =YT = YT0 XS. dS. sin q + YS. dS . cos q
= 4905282.73 - (50000*1.0* sin(271.0916667deg)) + (10000 * 1.0 * cos(271.0916667deg)) = 4955464.17 m.
Affine Orthogonal Geometric Transformation method
Source coordinate reference system: imaginary 3D seismic acquisition bin grid. The two axes are orthogonal, but the unit on the I-axis is 25 metres, whilst the unit on the J-axis is 12.5 metres.
The target projected coordinate reference system is WGS 84 / UTM Zone 31N and the origin of the bin grid (centre of bin 0,0) is defined at E = 456781.0, N = 5836723.0. The projected coordinate reference system point scale factor at the bin grid origin is 0.99984.
The map grid bearing of the I and J axes are 110° and 20° respectively. Thus the angle through which both the positive I and J axes need to be rotated to coincide with the positive Easting axis and Northing axis respectively is +20 degrees.
Hence:
XT0 , = 456 781.0 m
YT0 = 5 836 723.0 m
dSX = 25
dSY = 12.5
k = 0.99984
q = +20 degrees
Forward calculation for centre of bin with coordinates: I = 300, J = 247:
XT = Easting = XT0 + XS . k . dSX . cos q + YS . k . dSY . sin q = 464 855.62 m.
YT = Northing = YT0 XS . k . dSX . sin q + YS . k . dSY . cos q = 5 837 055.90 m
Reverse calculation for this point:
XS = [( XT XT0) . cos qY (YT YT0) . sin qY ] / [k . dSX . cos (qX qY)] = 230 bins
YS = [(XT XT0) . sin qX + (YT YT0) . cos qX ] / [k . dSY . cos (qX qY)] = 162 bins
γ EPSG, 1995-2002.


C@N[1][4]
HEY ACM!
Code@Night on Friday! (Yes during Reading Period.) Sponsored by TokBox.
You wonder: what's a TokBox? Welll...
----
The OpenTok API, created by TokBox, makes it dead simple to add face-to-face communication into a site or app experience. Check out the OpenTok Gallery to see partner apps ranging from collaboration tools to gaming.
Interested in developing your own OpenTok powered app? IncuBox is a student developer competition that will award one team the chance to incubate out of TokBox’s San Francisco HQ for 8 weeks during the summer of 2012. Apply now!
----
A real coder from TokBox will be there Friday at 10pm to give a talk and throughout the night to hang out with us! Sweet!
You further wonder: why should I attend this Code@Night? Welll...
* CODE around others!
* STRESS about Dean's Date around others!
* You could learn how to add video chat to your COS 318 file system
* You could add a video chat command to your COS 217 ish shell
* You could start a new COS 429 final project with video chat images
* You could query and parse results from video chatting to add to your COS 402 machine learning algs
* Drink --free-- sodas / energy drinks / water / random other beverages that we feel like buying
* Eat --free-- pizza / snacks / fruit / green beans
* POWER SO MUCH POWER ZOMG
* Sit in comfy chairs
* Learn about TokBox
So...You should come to Code@Night. QED, yo.
FRIDAY 1/13 9PM
SHERRERD HALL, 3rd FLOOR
SPONSORED BY TOKBOX, WHO WILL TALK AT 10
IT'S FUNNNNN
C@N[1][3]
It's been a while since the last Code@Night (but there have been
other awesome things like Startup Weekend or Random Hacks of
Kindness).
But Code@Night is back!
FRIDAY.
THIS FRIDAY.
DECEMBER ELEVENTH.
ON FRIDAY:
9pm: Arrive
10pm: Key signing party!
-> learn more about public key infrastructure from a talk by
Mike Franklin
12am: Facebook APIs!
-> learn how to use Facebook's wealth of data in your
application
morning: Go to sleep! [at your home]
Come to code! Come to learn! Come to talk to others that like
coding too! All night long! Food, energy, soda, power, fruit, and
snacks are provided!
TL;DR:
C@N[1][3]
Friday Dec 11, 9pm - morning
Sherrerd Hall, 3rd floor (CITP space)
https://www.facebook.com/events/150091385095606/
C@N[9]
fedora:~$ ptyhon acm.py ./sched.txt -debug
ptyhon: command not found
fedora:~$ python acm.py ./sched.txt -debug
IN MAKE_CANS
reading fiel: ./sched.txt
HERE
HERE
HERE
entering for loop
here 6 March 25
THEME: HackRU
6 good!!
here 7 April 15
THEME: Network Security
7 good!!
here 8 April 29
THEME: Using Eclipse
8 good!!
here 9 May 6
THEME: Combinatorial Game Theory
Traceback (most recent call last):
File "test.py", line 539202, in <module>
make_cans(filename)
File "test.py", line 496023, in make_cans
codeAtNights[last] = ('9pm Fri', 'May 6', '1pm Sat', 'May 7', '3rd Floor Sherrerd', 'Combinatorial Game Theory')
IndexError: list assignment index out of range
THE LAST CODE@NIGHT OF THE SEMESTER
--> so awesome that it breaks code!
9pm Fri 6 May - 10am Sat 7 May
3rd Floor Sherrerd Hall (CITP lounge)
Theme: Combinatorial Game Theory - Jarett Schwartz '11 will be giving a talk at 11pm. Be there!
TL;DR: http://www.facebook.com/event.php?eid=219153108096379
Movie@Night!
Hey all,
Princeton ACM wants to hold a movie night for you at 10pm on Wednesday, 05/04/2011, in the CS104 (Computer Science Building).
But, what movie are these handsome ACM people showing us? Whatever movie you want to see! (Well...almost...try to keep it vaguely related to CS, Programming, or Engineering.)
VOTE HERE: http://goo.gl/Fxr5D
Enjoy!
C@N[8]
this friday 9PM - saturday 1PM
3rd floor sherrerd hall (citp lounge)
we'll be briefly discussing eclipse & helping you set it up / stop using
drjava
come to code and learn about eclipse ALL NIGHT in the presence of pizza,
snacks, caffeine, power, mystery, and other human beings


;
It's been three weeks since we open sourced React Native and there's been some insane amount of activity already:
over 12.5k stars, 1000 commits, 500 issues, 380 pull requests, and 100 contributors, plus 35 plugins and 1 app in the app store! We were
expecting some buzz around the project but this is way beyond anything we imagined. Thank you!
I'd especially like to thank community members Brent Vatne and James Ide who have both already contributed
meaningfully to the project and have been extremely helpful on IRC and with issues and pull requests
Changelog
The main focus of the past few weeks has been to make React Native the best possible experience for people outside of
Facebook. Here's a high level summary of what's happened since we open sourced:
- Error messages and documentation: We want React Native to be the absolute best developer experience
for building mobile apps. We've added a lot of warnings, improved the documentation, and fixed many bugs. If you
encounter anything, and I really mean anything, that is not expected or clear, please create an issue - we want to
hear about it and fix it.
- NPM modules compatibility: There are a lot of libraries on NPM that do not depend on node/browser
internals that would be really useful in React Native, such as superagent, underscore, parse, and many others. The
packager is now a lot more faithful to node/browserify/webpack dependency resolution. If your favorite library
doesn't work out of the box, please open up an issue.
- Infrastructure: We are refactoring the internals of React Native to make it easier to plug in to existing iOS codebases, as well as improve performance by removing redundant views and shadow views, supporting multiple root views and manually registering classes to reduce startup time.
- Components: The API for a lot of UI components and APIs, especially the ones we're not using
heavily inside of Facebook, has dramatically improved thanks to many of your pull requests.
- Tests: We ported JavaScript tests, iOS Snapshot tests, and End to End tests to Travis CI. We have
broken GitHub master a couple of times (whoops!) when syncing and we hope that with this growing suite of tests it's
going to become harder and harder to do so.
- Patent Grant: Many of you had concerns and questions around the PATENTS file. We pushed a new version of the grant.
- Per commit history: In order to synchronize from Facebook to GitHub, we used to do one giant commit every few days. We improved our tooling and now have per commit history that maintains author information (both internal and external from pull requests), and we retroactively applied this to historical diffs to provide proper attribution.
Where are we going?
In addition to supporting pull requests, issues, and general improvements, we're also working hard on our internal
React Native integrations and on React Native for Android.


|
Solar
|
Allow to merge local map or floating map in the global map. UUID: eb9b9921-b063-42a8-8282-9ed53ee21d96
More...
#include <IMapFusion.h>
Public Member Functions | |
| IMapFusion ()=default | |
| IMapFusion default constructor. | |
| virtual | ~IMapFusion ()=default |
| IMapFusion default destructor. | |
| virtual FrameworkReturnCode | merge (SRef< SolAR::datastructure::Map > map, SRef< SolAR::datastructure::Map > globalMap, SolAR::datastructure::Transform3Df &transform, uint32_t &nbMatches, float &error)=0 |
| Merge a map in the global map. The map can be a local map (know transformation to the global map) or a floating map. More... | |
| virtual FrameworkReturnCode | merge (SRef< SolAR::datastructure::Map > map, SRef< SolAR::datastructure::Map > globalMap, SolAR::datastructure::Transform3Df &transform, const std::vector< std::pair< uint32_t, uint32_t > > &cpOverlapIndices, bool isRefineTransform=false)=0 |
| Merge a map in the global map. The map can be a local map (know transformation to the global map) or a floating map. More... | |
Allow to merge local map or floating map in the global map. UUID: eb9b9921-b063-42a8-8282-9ed53ee21d96
|
pure virtual |
Merge a map in the global map. The map can be a local map (know transformation to the global map) or a floating map.
| [in,out] | map | local map or floating map to merge |
| [in,out] | globalMap | the global map |
| [in,out] | transform | the transformation to the global map (null for floating map). It can be refined by fusion process. |
| [in] | cpOverlapIndices | pairs of detected overlap cloud points indices of floating map and global map. |
| [in] | isRefineTransform | refine the 3D transformation if it's true. |
|
pure virtual |
Merge a map in the global map. The map can be a local map (know transformation to the global map) or a floating map.
| [in,out] | map | local map or floating map to merge |
| [in,out] | globalMap | the global map |
| [in,out] | transform | the transformation to the global map (null for floating map). It can be refined by fusion process. |
| [out] | nbMatches | the number of matched cloud points. |
| [out] | error | the error of fusion process that is the mean of error distances of the matched cloud points. |


I'm A Celebrity 2019 line-up - confirmed cast as stars lands in Australia
I'm A Celebrity... Get Me Out Of Here! kicks off tomorrow night - and here's a rundown of the contestants joining the jungle line-up this year
by Emmeline SaundersWe're now just a single day away from this year's series of I'm A Celebrity... Get Me Out Of Here! and ITV bosses have been hard at work behind the scenes roping in the biggest and best stars.
And with the phenomenal success of last year's show - hosted temporarily by Holly Willoughby (who was standing in for Ant McPartlin) and Dec Donnelly - the 2019 series is set to be better than ever with the jungle reunion of Ant and Dec.
From the looks of things, the line-up will be a cracker.
The stars have all landed in Australia, having jetted in from all over the world.
This year's line-up is even rumoured to include the highest-paid star ever, with them said to be commanding a fee of £500,000.
Here's a look at the full line-up ahead of Sunday's launch.
I'm A Celebrity 2019: Confirmed contestants
Ian Wright
Ian was the first star to jet into Australia for this year's show.
The former footballer star turned pundit is already the bookies' favourite to win, with Ladbrokes offering odds of 5-2 that he'll be crowned King of the Jungle.
And he's laughed off reigning King Harry Redknapp's comments that his temper could get him in trouble.
Told of Harry’s comments after touching down in Brisbane, he said: "Was Harry doing one of those tours where he’s talking? He’s got to fill it up hasn’t he?
"The thing is, we play golf but I didn’t lose my rag.
"What’s he on about talking about losing my rag? I don’t lose my rag anymore.
"I’m much older and wiser.  I’ve been looking forward to this for so long."
Caitlyn Jenner
Caitlyn Jenner has touched down in Australia, amid reports she's commanding the biggest fee in the show's history - a whopping £500,000.
The Keeping Up With The Kardashian star, 70, was the second contestant to land in Brisbane Airport for this year's jungle show.
Asked if she was excited to be taking part in the show, Caitlyn said: “Yeah.”
But she declined to answer further questions about whether any members of her family would be joining her or if she wanted to win and then got into a waiting car.
Last Sunday, reports said Caitlyn won't be talking about anything her gender reassignment in camp.
Caitlyn - formerly Olympic gold medallist Bruce Jenner - had gender reassignment surgery in 2017, two years after announcing she was transgender.
But she says: "It is not something I talk about. Yes, I had gender confirmation and that for me was important.
"For many trans people it is not important to them. But for me it was.
 That is the issue.
"It is not what is between your legs. So yes, I had it done. But that is all out of respect to me, my privacy but also respect to the community. It is really not something you talk about."
Andrew Maxwell
The third celebrity who landed in Australia for the new series of I'm A Celebrity is stand up comedian Andrew Maxwell.
The 44-year-old touched down at Brisbane Airport in the early hours of Monday morning local time having flown in from the UK via Dubai.
As well as doing stand up, the 44-year-old is best known for being the narrator of Ex-On The Beach.
After landing he told photographers he wouldn’t take his sunglasses off as “no one will know who I am anyway”.
Asked about what he was scared of he said: “Snakes but I am going to fight them.
"We don’t have snakes in Ireland and you should never trust an animal without shoulders who can’t shrug.”
Jacqueline Jossa
Jacqueline was the fourth star to arrive in Oz, although she pretended she wasn't there for I'm A Celeb.
The 27-year-old star touched down at Brisbane Airport on Monday having flown in from the UK via Abu Dhabi.
Asked about I'm A Celebrity, Jacqueline was coy and said: "I'm here on holiday, a girls' trip.
"I have heard you get snakes in the toilet over here. Would they be bad, you tell me?"
Former EastEnders star Jacqueline shares two children, Ella, four, and Mia, one, with husband Dan Osborne .
James Haskell
James Haskell is the fifth star to fly in Down Under for I'm A Celebrity... Get Me Out Of Here!
The former rugby union player and husband of Richard and Judy's daughter Chloe Madeley was spotted landing at Brisbane Airport this morning.
James, 34, will join Ian Wright, Caitlyn Jenner, Jacqueline Jossa and Andrew Maxwell in the jungle.
But when asked by the Mirror if he was looking forward to the show, he pretended he was simply on holiday.
He played down being on the show, saying: "I don't know what you are talking about, me and my mate here are just going to the gym."
Told he might be entering an extreme situation in the jungle he added: "I am a professional rugby player for 16 years so you don't get more extreme than that do you?"
Asked about the small rations in camp compared to what he normally eats as a fitness ambassador, he said: "I will cross that bridge when I come to it."
Haskell was also asked if he had taken any advice from his famous family.
He said: "Yeah my wife said make sure I sleep on the plane and stay hydrated and I wil' be alright."
Adele Roberts
Radio 1's Adele Roberts has jetted into Brisbane airport ahead of I'm A Celebrity.
The smiling star was spotted making her way through arrivals where she was met by ITV production crew.
Speaking to the Mirror, Adele said she was feeling 'good and energised' and excited for the challenges ahead.
"I am excited to come to Australia and experience everything here. There are some things I would be scared of – I am terrified of spiders. I don't know what I am going to do about it, but I thought I can't go on like this.”
Myles Stephenson
Myles landed in Australia last night ahead of his I'm A Celeb stint.
But despite it being well-documented that he was heading into the jungle, the Rak-Su singer pretended he was in Oz to record music when quizzed about the show.
Myles, 28, says he's planning to embrace single life following his split from Love Island's Gabby Allen.
He said: "I am single. I have just got out of a relationship but I think I want to be single for a bit and embrace single life!"
In August, Gabby confirmed hr split from Myles after reports she'd caught him sexting other women.
The reality star was said to have dumped the singer after finding out he'd been exchanging flirty messages with other girls on Instagram .
Kate Garraway
Kate was the eight celeb to land in Australia.
The Good Morning Britain presenter, 52, is terrified of spiders, heights, being in a box covered with snakes - so basically everything she'll encounter Down Under.
She said: "I am terrified of all of the things in the Jungle, especially heights – it is the crazy heights on thin bits suspended on bits of metal or wood. Or if you are in a little box with creepy crawlies or snakes in it!
"But I am excited about doing the show because as you get older, you realise you don’t get many chances for pure adventure in life. I am going to give it a good shot and everyone can have a laugh and I hope it takes their mind off Brexit!"
Nadine Coyle
Girls Aloud star Nadine Coyle was the ninth star to arrive Down Under.
Nadine told the Mirror: "I am so really looking forward to this huge challenge."
Asked about her dramatic ITV promo video for the show where she had said she feared she could die on I'm A Celebrity, Nadine said: "That is absolutely the truth, it happens all the time, not in jungles but it is dangerous.
"I am not a huge fan of rats and things like that."
Ahead of the launch, she said: "I really want to try something completely new. I am scared of so many things. I used to be brave. In the past, I've opened a restaurant, had a record label, had my daughter and it was go, go, go with all of these.
"Now I have got so fearful even being in the car, flying or general things. I think it is since I became a parent that I am much more afraid."
Roman Kemp
Capital FM DJ Roman is yet to land in Australia, but he's already tried on his jungle gear.
He said: "I am not scared of the eating trials because I grew up with Dad’s cooking! I think the eating ones I will hate but I will do them. The show is iconic and you want to do everything."
His Dad is, of course, Martin Kemp. Roman’s mum is Shirlie Kemp. So what do they think of their son taking part in I’m a Celebrity?
"My Dad loves it," replies Roman. "He is ready to find the worst freeze frame possible of my face and put it out on social media! Mum will say she hates it up until the day I get in there. Once she sees the show, understands it and grasps I am in there, I think she will be alright. She is really nervous though!"
The other rumoured star...
Andrew Whyment
Every year, bosses throw in a late arrival to shake things up - and rumours claim Andrew is 2019's bombshell star.
The 38 year-old actor is a Corrie veteran, having starred as Kirk Sutherland for nearly 20 years.
According to reports, he's the most recent jungle signing and the 11th celeb from the Cobbles to join, following in the footsteps of the likes of Helen Flanagan, Nigel Havers and Sair Khan.
A source told The Sun that producers "were chuffed to get Andrew as viewers have watched him on Coronation Street for the best part of two decades, yet know nothing about him away from Kirk".
It's not his first taste of reality telly - he donned his skates in 2012's Dancing On Ice.
I'm A Celebrity 2019 kicks off at 9pm on Sunday on ITV


Davide Nunes
Defining meaning
Symbol grounding through representation learning
Techniques from computational semantics
Deep learning and neural networks
Generative probabilistic models
Hiperdimensional computing and random projections
To enable machines to understand the world.
Formal definition of names, classes, properties, and relationships between entities in a given domain.
No motivation nor reward to adopt them
They require ontology engineering skills
Merging ontologies requires consensus
They describe very little about the world
Grounded on humans, not on actual data
"Speech has both an individual and a social side, and we cannot conceive of one without the other" — Ferdinand De Saussure
The meaning of a sign is its instantiation in terms of neural activity patterns in response to the stimuli that constitutes this sign, along with the state of the world that makes up its context.
$$ similarity(x,y) = cos(\theta) = \frac{x \cdot y}{\lVert x \rVert \lVert y \rVert} $$
Assumption that latent structure in text can be captured by linear convex combinations of linearly independent vectors
Difficult to integrate new data (no on-line learning)
No extrapolation for missing data (no smoothing)
$$ \forall i,j \\ (1-\varepsilon) \| x_i - x_j \|^2 \le \\ \| f(x_i)-f(x_j)\|^2 \\ \le (1+\varepsilon)\|x_i - x_j\|^2 $$


|
U.S. cites buildup of Chinaís missiles |
China is acquiring short-range missiles and is aiming the weapons at Taiwan and possibly at U.S. forces to block their use on the islandís behalf in any future conflict, according to a Pentagon report.
|
|
Wearily, Angolans take back their country |
Angola's civil war has been over for more than a year. But relief officials warn that some of the country's biggest challenges may still lie ahead.
Lydia Polgreen/NYT
|
|
Bush warns of threat of new terror attack |
President Bush warned Wednesday that there was a "real threat" of a new terror attack, possibly with hijacked airliners, but said he felt confident that any attempted attacks would be thwarted.
Brian Knowlton/IHT
|
|
The summer of Blair's discontent |
The political fallout over Britain's participation in the war in Iraq has presented the government with the greatest crisis in its six years in office, and the speculation these days centers on whether Blair will leave office prematurely.
Warren Hoge/NYT
|
|
Why Liberians expect U.S. help |
Many people in the world look for an outside hand to come to fix their problems. But there are few, in the minds of Liberians, to whom the idea of America is so mythic and the case for U.S. help more compelling.

Seth Mydans/NYT
|


For quite a while now I have been considering source-based Linux distributions. I believe they pose the highest level of difficulty in terms of installation and maintenance. Since I strive to understand Linux fully, they were the logical next step on my path. I had already tried Gentoo and Sabayon some months ago, albeit without much success. However, with newly gained knowledge I felt much more confident and skilled. I knew that this time I would succeed!
The source-based model is not so popular anymore, because it entails time-consuming compilation of most or all software packages, followed by extensive manual configuration. Currently, there is Gentoo, Sabayon, Lunar Linux, Calculate Linux and some other less known distros. Since I read complaints regarding the installation process of Lunar Linux, I decided to give Gentoo a second (or maybe third?) go. This time around I decided to follow the official Gentoo Handbook to the letter, though with some improvements on my part. The default method is to use one of the many Gentoo’s live images and start from there. Alas, the interface offered is entirely console-based and some things are rather inconvenient (copy-pasting, Web browsing, etc.). Hence, I decided to start from an ArchBang live iamge (sorry, Archie!). The installation procedure was essentially the same (mounting hard drive partitions to local directories on the live image medium, downloading and unpacking the Gentoo environment, etc.). The only point when it differed was when I had to configure Portage mirrors manually, because ArchBang’s liveCD lacked the required software. To be fair though, there was an actual obstacle during installation – setting up GRUB2 on an EFI partition. For reasons unknown to me, this was improperly documented in the Handbook. Two vastly different procedures were suggested and the Handbook itself promoted setting up GRUB2 on the Master Boot Record (MBR) of the drive. Unfortunately, UEFI in its default mode forces the user to rely on an EFI partition for bootloader installation, though using MBR is possible.
Compiling the kernel was a particularly interesting experience. I had to (chose to?) spend roughly 3-4 hours going through all of the options to understand what Linux does and doesn’t support. Though time-consuming and mundane, I prefer building my own kernels with selective hardware support, rather than using a possibly bloated distribution kernel. This is especially convenient for laptops, which can hardly be customized. Surprisingly, it was not the most time-consuming step during Gentoo maintenance. Software installation was.
Looking at times across packages, I immediately noticed that the numbers are quite discouraging. For instance, Firefox, being one of the major offenders, takes approximately 1-2 hours to compile. On my laptop (core i3, 4GB RAM, regular HDD) it took 4 hours, even though I disabled many options (USE flags) prior to compilation. The KDE desktop environment or Libre Office are even more problematic. Many Gentoo users leave such updates to run overnight.
Then it struck me. In its stable repositories, Gentoo does not offer packages as bleeding-edge as in Arch Linux. The software versions available were exactly the same as in Debian Sid. Perhaps the kernel, among few others, was more recent. Furthermore, as many users before me observed, the boost in speed and responsiveness was marginal. Thence, I found it amusing that each of us Gentoo users would have to pay with their time and their computers’ processing power to reach the same result as Debian developers, when building software packages for the Linux populace.
All in all, I believe it was worth it, however. Gentoo Linux is like a bootcamp for aspiring Linux developers. It teaches Linux, but teaches hard. The lessons I learned from setting it up will become useful in the future, no doubt. However, since the dawn of amd64 computers, compiling software locally for better performance is no longer advantageous. Rather, it presents an alternative to those paranoid about unnecessary features in an operating system, such as me.
Next destination – Debian!


fun underVal(opcode: Int): Int
Gets the value of the underscore variable. (iload_0 = 0, iload_1 = 1, etc.)
opcode - The opcode to get the underscore value from.
opcode
Return The value of the underscore variable. (iload_0 = 0, iload_1 = 1, etc.)


The faster way to get the results you want, displayed in an easy-to-read manner.
View results grouped by category. Click on apps, or drill into hundreds of category charts.
Search for your favorite apps, then browse their categories for similar apps.


Music_Together allows people to easily collaborate and make music together! Finally, users can now use the power of numbers to write scores never imagined!
Music Together's mission to help your creativity flourish. Users will be able to set musical scores, curate their own tempos, and share their collective masterpieces. Let your imagination run wild with Music Together!
Music Together is all about putting the best of people's musical talent together to create a masterpiece. Work with others, share and benefit from the knowledge of others. Music Together allows large groups to create single pieces of music.


--- Day 4: The Ideal Stocking Stuffer ---
Santa needs help mining some AdventCoins (very similar to bitcoins) to use as gifts for all the economically forward-thinking little girls and boys.
To do this, he needs to find MD5 hashes which, in hexadecimal, start with at least five zeroes. The input to the MD5 hash is some secret key (your puzzle input, given below) followed by a number in decimal. To mine AdventCoins, you must find Santa the lowest positive number (no leading zeroes: 1
, 2
, 3
, ...) that produces such a hash.
For example:
- If your secret key is
abcdef
, the answer is609043
, because the MD5 hash ofabcdef609043
starts with five zeroes (000001dbbfa...
), and it is the lowest such number to do so. - If your secret key is
pqrstuv
, the lowest number it combines with to make an MD5 hash starting with five zeroes is1048970
; that is, the MD5 hash ofpqrstuv1048970
looks like000006136ef...
.


Menu
Home
Our Projects
Events
Members
Showcase
Resources
Open Source Club
At the University of Florida
Here are resources the club has put together for various projects. Check out our tutorial repository
here
.


The null check is broken since it will throw a Nullpointer itself. The reason is that a method is called on the object when it is null. It is likely that you used || instead of && or vice versa.
This rule is deprecated, use {rule:squid:S1697} instead.


This generates an expanded private key that derives a public key with a prefix of your chosing.
However, most wallets do not support expanded private keys.
Right now, the only wallet to do so is my fork of Nano Vault. Hopefully,
my pull request will be merged soon,
and this feature will be available in mainline NanoVault.
Until then, you can find an instance of my NanoVault fork here:
https://plasmapower.github.io/nanovault/
The source code to this website is available here,
and the source code to the miner server is availabe here.
Here's a sample expanded private key to test with.
Of course, don't put any significant funds in here, because the private key is public:
Expanded private key: 164C03C1F7632426DDF2D32FF1CA8199FC99D748E8DAF30E0C44C26DD2CD0150
Account: nano_1tests99rkn3caj4qbwe9o8co4i56bg7t8ehk14af51mww1gfajfq7d9hfu1
Stage 1: Generating Your Base Key
Your base key is the base of the vanity key. The miner will get the base public key,
but not the base private key, which means they cannot find the private key of your vanity key.
This tool will save your base key in your browser (specifically localStorage), but
you should save this private key anyway. With it, you will likely be able to
continue where you left off.
Stage 2: Selecting a Miner
Don't know any Nano distributed vanity address miners?
Try joining the Nano Discord server.
If you're just testing this out for Nano Jam, here's a weak miner for that:
https://cors-anywhere.herokuapp.com/<IP_ADDRESS>:2001
Failed to contact miner. Check that the URL is correct and the miner is online. Error:
Miner Name: Miner Maximum Characters:
This is a public miner, so anyone with the URL can use it.
Stage 3: Select prefix
Note: The first character of an address (after the nano_) must be either 1
or 3. If you don't care which your address is, you can use * as the first character
which will be twice as fast by ignoring the result of the first character.
The first character of your Nano address must be either 1, 3,
or either via *. Please see the note above.
is not a valid character in a Nano address.
Nano addresses can be composed of the numbers and lowercase, except0, 2, l, and v.
Your prefix is too large. Try reducing its length, or substituting characters with a wildcard (*).
Stage 4: Waiting For Miner
Loading...
The miner is mining the vanity address.
Failed to check mining status. Check that your internet is working and the miner is online. Error:
Miner generated partial key:
Final expanded private key: Final account:
Here's my NanoVault fork where you can use this key:
https://plasmapower.github.io/nanovault/
Like any other (expanded) private key, be sure to make a backup of the "Final expanded private key".


my story
Hey, I’m Nick. It’s been a while since I’ve create my first website. Must’ve been around the year 2009. Since then I’ve been making steady progress.
Three years ago I decided to pursue this passion for web development and started studying New Media and Communication Technology at Howest Kortrijk. Of course this had to be with an emphasis on programming, web development and design.
Lately I’ve been exceptionally interested in experimental web technologies and the latest web development trends.
Projects & participation
-
- Multidisciplinary project: Co-constructing healthy experiences & smart objects, spaces and places (3 credits)
- Participation: Windows 10 developer day
-
- Participation: apps for Ghent
- Project: LoRa geolocation dashboard for Proximus
- Participation: BUMP Festival
- Participation: Windows 10 developer day
-
- Participation: apps for Ghent
- Participation: BUMP Festival
- Internship: Working with Angular & Node.js @De Lijn
-
- Participation: apps for Ghent (creativity price)


|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.gwoptics.mathutils.Complex
public class Complex
Complex is a class that provides complex numbers and a number of mathematical functions (dynamic and static) such as sqrt() and exp() for complex numbers.
| Constructor Summary | |
|---|---|
Complex(double re)
Additional constructor that returns a purely real complex number |
|
Complex(double re,
double im)
Additional constructor that return the user defined complex number |
| Method Summary | |
|---|---|
double |
abs()
This function computes the absolute of a complex number as |z|=sqrt(x^2+y^2). |
static double |
abs(Complex c)
This function computes the absolute of a complex number as |c|=sqrt(x^2+y^2). |
double |
absSquared()
This function returns the absolute square of a complex number as |z|^2=x^2+y^2. |
static double |
absSquared(Complex c)
This function computes the absolute square of a complex numbers as |c|^2=x^2+y^2. |
void |
add(Complex c)
This function add a complex number to a complex number as z=z+c. |
static Complex |
add(Complex a,
Complex b)
This function adds two complex numbers as z=a+b. |
void |
conj()
This function computes the complex conjugate of a complex number. |
static Complex |
conj(Complex z)
This function computes the complex conjugate of a complex number |
void |
divide(Complex b)
This function divides the complex number by a complex number. |
static Complex |
divide(Complex a,
Complex b)
This function computes the division of two complex numbers |
static Complex |
exp(Complex z)
This function computes the exponential of a complex number exp(z). |
static Complex |
expi(java.lang.Double phi)
This function computes the number exp( i phi ) |
double |
imag()
This function returns the imaginary part of the complex number. |
static double |
imag(Complex c)
This function returns the imaginary part of a complex number. |
void |
inv()
This function computes the inverse of the complex number |
static Complex |
inv(Complex z)
This function returns the inverse of a complex number |
boolean |
isEqual(Complex c)
This functions tests whether the Complex number is equal to another. |
static boolean |
isEqual(Complex a,
Complex b)
This function tests whether two Complex numbers are equal. |
boolean |
isNaN()
This funtions tests whether the complex number is `not a number' NaN. |
static boolean |
isNaN(Complex c)
This function tests whether a complex number is `not a number' NaN. |
static Complex |
log(Complex z)
This function computes the logarithm of a complex number |
java.lang.Double |
modulus()
This function computes the modulus of the complex number |
static java.lang.Double |
modulus(Complex z)
This function returns the modulus of a complex number |
void |
multiply(Complex b)
This function multiplies the complex number by a complex number. |
static Complex |
multiply(Complex a,
Complex b)
This function multiplies two complex numbers a*b. |
static Complex |
newAbsPhi(double amp,
double phi)
This function returns a new complex number set via amplitude and phase as amp*exp(i phi). |
static Complex |
pow(Complex z,
int nom,
int denom)
This function computes a rational power of a complex number z^(nom/denom). |
double |
real()
This function returns the real part of the complex number. |
static double |
real(Complex c)
This function returns the real part of a complex number. |
void |
scale(java.lang.Double x)
This function multiplies the complex number by a real number |
static Complex |
scale(java.lang.Double x,
Complex z)
This function multiplies a complex number by a real number |
void |
scaleAndDelay(double amp,
double phi)
This function multiplies the complex number by a real number and adds a phase delay as z=z*x*exp(i phi). |
static Complex |
scaleAndDelay(double amp,
double phi,
Complex z)
This function multiplies a complex number by another given by amplitude and phase as return = z * abs * exp (i phi). |
void |
set(double re,
double im)
This functions sets the real and imaginary part of the complex number. |
void |
setAbsPhi(double amp,
double phi)
This function sets the complex number via an amplitude and phase as amp*exp(i phi). |
void |
setImag(double im)
This function sets the imaginary part of the complex number. |
void |
setReal(double re)
This functions sets the real part of the complex number |
Complex |
sqrt()
This function computes the square root of the complex number |
static Complex |
sqrt(Complex z)
This function returns the sqaure root of a complex number. |
void |
squared()
This function computes the square of the complex number as (x + i y)*(x + i y) |
static Complex |
squared(Complex c)
This function computes the square of a complex number as (x + i y) * (x + i y) |
java.lang.String |
toString()
This function converts a complex number into a String "x + y i" with x being the real and y the imaginary part. |
static java.lang.String |
toString(Complex z)
This function converts a complex number into a String "x + y i" with x being the real and y the imaginary part. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Complex(double re, double im)
re
- real partim
- imaginary partpublic Complex(double re)
re
- real part| Method Detail |
|---|
public void set(double re, double im)
re
- real partim
- imaginary partpublic void setReal(double re)
re
- real partpublic void setImag(double im)
im
- imaginary partpublic void setAbsPhi(double amp, double phi)
amp
- amplitudephi
- phasepublic static Complex newAbsPhi(double amp, double phi)
amp
- amplitudephi
- phase
public void add(Complex c)
c
- complex numberpublic static Complex add(Complex a, Complex b)
a
- complex numberb
- complex number
public void squared()
public static Complex squared(Complex c)
c
- complex number
public double absSquared()
public static double absSquared(Complex c)
c
- complex number
public double abs()
public static double abs(Complex c)
c
- complex number
public double real()
public static double real(Complex c)
c
- complex number
public double imag()
public static double imag(Complex c)
c
- complex number
public Complex sqrt()
public static Complex sqrt(Complex z)
z
- complex number
public void inv()
public static Complex inv(Complex z)
z
- complex number
public java.lang.Double modulus()
public static java.lang.Double modulus(Complex z)
z
- complex number
public void multiply(Complex b)
b
- complex numberpublic static Complex multiply(Complex a, Complex b)
a
- complex numberb
- complex number
public void divide(Complex b)
b
- complex numberpublic static Complex divide(Complex a, Complex b)
a
- complex numberb
- complex number
public void conj()
public static Complex conj(Complex z)
z
- complex number
public void scale(java.lang.Double x)
x
- multiplier (real number)public static Complex scale(java.lang.Double x, Complex z)
x
- multiplier (real number)z
- complex number
public void scaleAndDelay(double amp, double phi)
amp
- multiplier (real number)phi
- phase [rad]public static Complex scaleAndDelay(double amp, double phi, Complex z)
amp
- phi
- z
-
public static Complex pow(Complex z, int nom, int denom)
z
- complex numbernom
- nomiator of exponentdenom
- denominator of exponent
public static Complex log(Complex z)
z
- complex number
public static Complex exp(Complex z)
z
- complex number
public static Complex expi(java.lang.Double phi)
phi
- phase
public boolean isNaN()
public static boolean isNaN(Complex c)
c
- complex number
public boolean isEqual(Complex c)
c
- complex number
public static boolean isEqual(Complex a, Complex b)
a
- complex numberb
- complex number
public java.lang.String toString()
toString
in class java.lang.Object
public static java.lang.String toString(Complex z)
z
- complex number
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |


About
Octopus Deploy is an automated software deployment and release management server. It is designed to simplify deployment of ASP.NET applications, Windows Services and databases. Octopus Deploy is used to deploy applications securely to servers that are on-premises or in the cloud. It has a web-based interface, which can be used to modify and execute deployments, and a dashboard that teams can use to view the status of deployments.
In a typical installation, a team would commit code to their existing source control system.[5] A continuous integration server would then compile the code and run unit tests. The last step of the build process would be to bundle the binaries, content files and configuration files into a package that is ready to be deployed. Octopus is then designed to deploy this package, and promote it between environments. For packaging applications, Octopus Deploy uses the NuGet package file format from Microsoft.
Objectives
Octopus is a friendly deployment automation tool for .NET developers. Octopus works with your build server to enable reliable, secure, automated releases of ASP.NET applications and Windows Services into test, staging and production environments, whether they are in the cloud or on-premises.
Pre-requisites
- ➤ Basic understanding of Windows system concepts
- ➤ Familiarity with Command Line Interface (CLI)
- ➤ Familiarity with a Text Editor
- ➤ Experience with managing
- ➤ Systems/applications/infrastructure or with build/deployments/automation
- ➤ Familiarity with developing and building software
- ➤ Familiarity with Visual Studio 2005, 2008, or 2010
- ➤ Familiarity with their organizaiton's development process
- ➤ Be able to read and understand C# and C++ code (all source code will be provided)
Features
✔ 30 Hours instructor led online class
✔ Hands on Approach - We emphasize on learning by doing.
✔ Life time free re-enrollment to future DevOps courses
✔ Life time free access to all learning materials including
✔ Class recordings
✔ Presentations
✔ Sample Code
✔ Projects
✔ Total Lab Infrasture in cloud and 24x7 available
✔ 70% of the class is consist of Lab
✔ Each week assignments(total 4) with personal assistance
✔ Two real time senario based projects with standard evaluation
✔ 24x7 online support to queries during and after the course completion
✔ 1 dedicated class for Interview preparations
The basic course program is outlined here:
Getting started
✔ Octopus in your delivery process
✔ Install the Octopus server
✔ Create environments
✔ Add machines to your environments
✔ Package your applications for deployment
✔ Create a project
✔ Define your deployment process
✔ Create a release and deploy it
✔ Next steps
Installation
✔ Installing Octopus
✔ Installing Tentacles
Key Concepts
✔ Environments
✔ Projects
✔ Project Groups
✔ Lifecycles
✔ Machine Roles
✔ Channels
✔ Tenants
Packaging applications
✔ Package repositories
✔ Supported Packages
✔ NuGet packages
Deployment targets
✔ Azure Cloud Service Target
✔ Azure Web Apps
✔ Cloud Regions
✔ Offline Package Drop
✔ SSH Targets
Deploying applications
✔ Deploying packages
✔ Configuration files
✔ Custom Installation Directory
✔ IIS Websites and Application Pools
✔ Windows Services
✔ Custom scripts
✔ Delta compression for package transfers
✔ Email notifications
✔ Step Templates
✔ SQL Server databases
✔ Guided failures
✔ Manual intervention and approvals
✔ Scheduled Deployments
✔ Automatic Release Creation
✔ Run steps in parallel
✔ Artifacts
✔ Variables
✔ Deploying to Azure
✔ Substitute Variables in Files
API and Integration
✔ TeamCity
✔ Visual Studio Team Services (VSTS)
✔ Team Foundation Server (TFS)
✔ Bamboo
✔ Continua CI
✔ Jenkins
✔ Octo.exe Command Line
✔ Octopus.Client
✔ Octopus REST API
✔ Calamari
Patterns
✔ Canary deployments
✔ Blue-green deployments
✔ Multi-tenant deployment pattern
✔ Isolated Octopus Deploy servers
✔ Branching
✔ Rolling deployments
Administration
✔ Auditing
✔ Backup and restore
✔ Managing multiple instances
✔ Managing users and teams
✔ Octopus database
✔ Retention Policies
✔ Script Console
✔ Script Modules
✔ Upgrading
✔ Data migration
✔ Reporting
✔ Server configuration and File storage
✔ High Availability
How to
✔ Get the raw output from a task
✔ Debug problems with Octopus variables
✔ Manually fail a running or cancelling task
✔ Move the Octopus Home folder and the Tentacle Home and Application folders
✔ Troubleshoot Listening Tentacles
✔ Expose the Octopus web portal over HTTPS
✔ How to create an API key
✔ Export and import Tentacle certificates without a profile
✔ Run Tentacle under a specific user for use in PowerShell
✔ Report on deployments using Excel
✔ Specifying a custom container to use for AD Authentication
✔ Capture a crash dump
✔ Run multiple processes on a Tentacle Simultaneously
✔ Stage package uploads
✔ Enable web request logging
✔ Configure Environment-specific configuration transforms while keeping sensitive values in Octopus
✔ Push a NuGet package that already exists
✔ How to use custom certificates with Octopus Server and Tentacle
✔ Reference files within a package
✔ How to run steps on the Octopus Server
✔ Sensitive Properties API Changes in Release 3.3
✔ Deploy to a Specific Subset of Targets
✔ Migrate Azure Targets into Azure Steps


You need to build and train the model before you test its performance. If you have trained the model, test it on the out-of-sample data. Follow these steps to test the model:
equity = [1] last_action = 0 trading_cost = 0.01
for i in range(5, X_test.shape[0]): action, _ = model.predict(X_test[i-5:i], deterministic=True) if action == 0: new = equity[-1] * (1 - (trading_cost if last_action != action else 0)) elif action == 1: new = equity[-1] * (1 + y_test[i] - (trading_cost if last_action != action else 0)) elif action == 2: new = equity[-1] * (1 + -1 * y_test[i] - (trading_cost if last_action != action else 0)) equity.append(new) last_action = action
plt.figure(figsize=(15, 10)) plt.title("Equity Curve") plt.xlabel("timestep") plt.ylabel("equity") plt.plot(equity) plt.show()


--- layout: default ---
I’m a language-agnostic full stack developer who’s great at building beautiful products from the ground up. I have a massive passion for hackathons which has given me ability to rapidly prototype new technology very quickly and I have recently left my start-up Price Trakker to take on new challenges. I also am a data junkie and love finding interesting insights from large data sets and visualising them.
Cloud Architecture
Extensive experience in building highly scalable products in the cloud.
Full Stack
Designing and building high quality products from the ground up.
Hacking
Prototyping cutting-edge technology in very short turnaround times.
Working knowledge
C (for Arduino)
JavaScript
Python
Advanced knowledge
HTML / CSS
JavaScript (jQuery)
.NET
Plan to learn
Advanced Python
Node.js
D3 charts
Apps
Chrome Extensions
Android
Firefox OS
Windows Phone
Hardware
Arduino
Raspberry Pi
Oculus Rift
Kinect
Cloud
Microsoft Azure
Google App Engine
Student Partner - Microsoft
2012 - 2014As part of my voluntary role at Microsoft I evangelised Microsoft’s technology, gave presentations and helped run events for developers. Helping to run large events, I eventually became their go-to-guy for all questions relating to using the Microsoft Azure Cloud Platform.
Co-Founder, CTO - Price Trakker
2011 - 2015I started Price Trakker and took it from just myself sitting in a bedroom writing code and to a company worth £1.05M with a team of six in four short years. Working with the largest UK retailers such as Samsung, LG, Maplin, Sainsbury's, Tesco, Asda, Wiggle, a very high level SLA had to be maintained. I have now left Price Trakker to expand on my skillset and learn new things.
Backend Python Developer - Network Locum
July 2015 - PresentJoined the company at the 4th developer as we went from start-up to scale-up. We're now a team of 45 with ~10 developers and are currently working on a huge project to move our backend away from a monolith and to containerized applications on Docker. We rebuilt the platform in about 6 weeks and we should finish off the implementation phase by September.
Hackathons
Apps
Work