I would like to add the new Google phones to the Emulated Devices in Chrome's dev tools.
Does anyone know the correct custom device settings for the Pixel 3 and Pixel 3 XL?
You must enter the viewport size on the google dev center, not screen resolution. So the viewports for pixel 3 and pixel 3 xl are as below.
Pixel 3: 412 x 824 aspect ratio: 16:9 ~ Device pixel ratio: 1.7
Pixel 3 xl: 412 x 847 aspect ratio: 16:9 ~ Device pixel ratio: 1.7
you can use something like this to know you device details :
<!DOCTYPE html>
<html>
<body>
<button onclick="OutputDeviceInfo()">Click me</button>
<p id="width"></p>
<p id="height"></p>
<p id="ratio"></p>
<script>
function OutputDeviceInfo() {
let deviceWidth = window.screen.width;
let deviceHeight = window.screen.height;
let devicePixelAspectRation = window.devicePixelRatio;
document.getElementById("width").innerHTML = deviceWidth;
document.getElementById("height").innerHTML = deviceHeight;
document.getElementById("ratio").innerHTML = devicePixelAspectRation;
console.log('Width: ' + deviceWidth);
console.log('Height: ' + deviceHeight);
console.log('Pixel Ratio: ' + devicePixelAspectRation);
}
</script>
</body>
</html>
Press F12 on Chrome Browser >> Click on toggle device tool bar (on left side small mobile icon) >> click on drop-down option where you can see spme list of devices are there, you can see last option "Edit"- click on that Edit option>> click on "Add custom device" button enter the details for your targets device
Related
I want to use the leaflet.tilelayer.glcolorscale plugin. I have a float32 geotiff raster with values ranging from 0 to ~ 66. Reading the documentation on github, it appears that they are tiling using non-standard method. I'm familiar with taking a RGBA raster and using gdal2tile.py to create a png tileset.
How do I tile this float32 geotiff for use with this plugin?
I've provided the gdalinfo on my source geotiff below. I tried using gdal2tile.py to tile, with poor results. Thanks.
>gdalinfo spat_model.tif
Driver: GTiff/GeoTIFF
Files: spat_model.tif
Size is 8618, 6783
Coordinate System is:
PROJCS["WGS 84 / Pseudo-Mercator",
GEOGCS["WGS 84",
DATUM["WGS_1984",
SPHEROID["WGS 84",6378137,298.257223563,
AUTHORITY["EPSG","7030"]],
AUTHORITY["EPSG","6326"]],
PRIMEM["Greenwich",0,
AUTHORITY["EPSG","8901"]],
UNIT["degree",0.0174532925199433,
AUTHORITY["EPSG","9122"]],
AUTHORITY["EPSG","4326"]],
PROJECTION["Mercator_1SP"],
PARAMETER["central_meridian",0],
PARAMETER["scale_factor",1],
PARAMETER["false_easting",0],
PARAMETER["false_northing",0],
UNIT["metre",1,
AUTHORITY["EPSG","9001"]],
AXIS["X",EAST],
AXIS["Y",NORTH],
EXTENSION["PROJ4","+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=#null +wktext +no_defs"],
AUTHORITY["EPSG","3857"]]
Origin = (-12148437.776279186829925,6306111.101677093654871)
Pixel Size = (44.801481702694637,-44.801481702694637)
Metadata:
AREA_OR_POINT=Area
DataType=Generic
Image Structure Metadata:
INTERLEAVE=BAND
Corner Coordinates:
Upper Left (-12148437.776, 6306111.102) (109d 7'52.58"W, 49d11' 1.78"N)
Lower Left (-12148437.776, 6002222.651) (109d 7'52.58"W, 47d22' 2.03"N)
Upper Right (-11762338.607, 6306111.102) (105d39'46.39"W, 49d11' 1.78"N)
Lower Right (-11762338.607, 6002222.651) (105d39'46.39"W, 47d22' 2.03"N)
Center (-11955388.192, 6154166.876) (107d23'49.49"W, 48d17' 0.98"N)
Band 1 Block=8618x1 Type=Float32, ColorInterp=Gray
NoData Value=-1
Metadata:
RepresentationType=ATHEMATIC
For some reason, my R notebook is producing a blank HTML document. When I'm ready to knit the document to an html notebook, my browser opens up the file and it is a blank document. I'm pressing the "knit" button, then "html" from R Studio.
Here is my code:
---
title: "Rate Hole Model"
output: html_document
---
```{r}
library(tidyverse)
library(plotly)
library(rmarkdown)
library(knitr)
```
```{r}
veh_age <- mc2 %>%
filter(cummulative < 51)
plot_ly(veh_age, x = ~unit_age, y = ~loss_ratio, color = ~rating_class_name) %>%
add_markers(text = ~paste(rating_class_name, "<br />", 'unit age: ',
unit_age, "<br />", 'loss ratio: ', loss_ratio), hoverinfo =
'text') %>%
layout(title = 'Comp Loss Ratio by Unit Age/Rating Class')
```
I'm not sure what happened. I'm on R version 3.5.1Has anyone ran into this problem?
My Libraries were installed to my Home directory : \Home\firstname.lastname\documents. This directory is a network located resource. When the last step of the process ran, the proper permission was not available to the called application (Pandoc). I am running 64 bit Win 10 with 64 bit RStudio version 1.1.456 and the 3.5 version of R. When I moved (reinstalled) the packages/libraries to a local folder : c:\Program Files\RStudio\Packages the HTML rendered in the browser.
I'm trying to get a 5" LCD working with my raspberry pi 3 and Android Things Developer Preview 4.1.
I've added this to my config.txt:
max_usb_current=1
hdmi_group=2
hdmi_mode=1
hdmi_mode=87
hdmi_cvt 800 480 60 6 0 0 0
All I get is a white screen with some artifacts:
It's not a cable issue, I can use the screen with my Windows PC just fine.
I've found some maybe relevant lines in logcat:
01-01 00:00:19.529 412-412/? I/SystemServiceManager: Starting com.android.server.display.DisplayManagerService
01-01 00:00:19.568 412-434/? I/DisplayManagerService: Display device added: DisplayDeviceInfo{"Built-in Screen": uniqueId="local:0", 800 x 480, modeId 1, defaultModeId 1, supportedModes [{id=1, width=800, height=480, fps=60.000004}], colorTransformId 1, defaultColorTransformId 1, supportedColorTransforms [{id=1, colorTransform=0}], HdrCapabilities android.view.Display$HdrCapabilities#192777c, density 160, 160.0 x 160.42105 dpi, appVsyncOff 0, presDeadline 17666666, touch INTERNAL, rotation 0, type BUILT_IN, state UNKNOWN, FLAG_DEFAULT_DISPLAY, FLAG_ROTATES_WITH_CONTENT, FLAG_SECURE, FLAG_SUPPORTS_PROTECTED_BUFFERS}
01-01 00:00:19.571 412-434/? I/DisplayManagerService: Display device changed state: "Built-in Screen", ON
01-01 00:00:23.990 412-434/? I/WindowManager: No existing display settings /data/system/display_settings.xml; starting empty
I've bought the screen from an ebay seller. It came with a dvd, and had a sample config.txt file, it suggests the same settings.
What am I doing wrong?
Is it possible to have an image be 100% of the window width and keep it's aspect ratio while resizing an AutoHotKey GUI?
I have a simple GUI as follows:
Gui +Resize
Gui, Add, Picture, w440 h-1 vProductImage, default.png
Gui, Show, , MyApp
The closest thing I have been able to come to is Anchor.ahk http://www.autohotkey.com/board/topic/4105-control-anchoring-v4-for-resizing-windows/
Using it, I can have the image resized when the window is resized but it doesn't keep it's aspect ratio and gets deformed
Does anyone know how I can do this?
Closest thing I could come up with:
Assuming the picture is 440x350, is 85 pixels from the top of the app window (left:0)
GuiSize:
if(A_GuiWidth < A_GuiHeight)
{
GuiControl, MoveDraw, ProductImage, % "w" . (A_GuiWidth - 20) . " h" . (350/440) * (A_GuiWidth - 20)
}
else
{
GuiControl, MoveDraw, ProductImage, % "w" . (440/350) * (A_GuiHeight - 85) . " h" . (A_GuiHeight - 85)
}
return
(the 20 is for window padding)
The webpage title on MobileSafari looks carven,host to make this effect?And what's the font family and font size of the title?
Thank you very much!
Open any iOS project in Xcode.
Launch MobileSafari in the simulator and visit google.
In Xcode, choose Product > Attach to Process > MobileSafari.
Choose Product > Debug > Pause.
In the debug console, type po [[UIApp keyWindow] recursiveDescription].
Note that this only works on the simulator. On the device, you can only attach to apps that you have installed using Xcode.
Doing all that gives you a printout of Mobile Safari's view hierarchy. Searching through it, I find this UILabel:
| | | | | <UILabel: 0x1096e800; frame = (0 0; 308 16); text = 'Google'; clipsToBounds = YES; userInteractionEnabled = NO; layer = <CALayer: 0x1096e8c0>>
The address of the UILabel object will be different each time we do this.
Anyway, we can print that label's font like this:
(lldb) po [0x1096e800 font]
$2 = 0x0bb88110 <UICFFont: 0xbb88110> font-family: ".Helvetica NeueUI"; font-weight: bold; font-style: normal; font-size: 13px
We can print its text color:
(lldb) po [0x1096e800 textColor]
$13 = 0x1096eb50 UIDeviceRGBColorSpace 0.173 0.212 0.259 0.9
We can also print its shadow color:
(lldb) po [0x1096e800 shadowColor]
$4 = 0x1096eb70 UIDeviceWhiteColorSpace 1 0.43
Printing the shadow offset is harder, because it is a CGSize structure, not a built-in type. The debugger doesn't know about CGSize because MobileSafari doesn't include debug information. We have to give the debugger a definition. This hideous command works:
(lldb) expr -o -- typedef struct { float x; float y; } CGSize; (id)[NSValue valueWithCGSize:(CGSize)[(id)0x1096e800 shadowOffset]]
$11 = 0x08063e60 NSSize: {0, 1}
It's the system's default font, Helvetica-Neue. In UIKit, you'd get it with [UIFont systemFontOfSize:...] or [UIFont boldSystemFontOfSize:...]. The "carve" effect is a simple white drop shadow. It's achieved with the shadowColor and shadowOffset properties of UILabel.