Say I have an image tag such as this:  &lt;img src="smiley.gif" alt="Smiley face" height="42" width="42"&gt;   I know I can get the src by using myImageEl.src.  However, how do I get the type of the src (.gif in this case)?  Basically, my end goal is to pass the file type to window.URL.createObjectUrl()  let src = imageEl.src; let srcType = src.type; // Here I need to get the type let videoFile = new Blob([src], {type: srcType}); let videoSrc = window.URL.createObjectURL(videoFile);
960
See code:   var file1 = "50.xsl"; var file2 = "30.doc"; getFileExtension(file1); //returns xsl getFileExtension(file2); //returns doc  function getFileExtension(filename) {     /*TODO*/ }
17511
So this seems pretty basic but I can't get it to work.  I have an Object, and I am using reflection to get to it's public properties.  One of these properties is static and I'm having no luck getting to it.  Public Function GetProp(ByRef obj As Object, ByVal propName as String) as PropertyInfo     Return obj.GetType.GetProperty(propName)  End Function   The above code works fine for Public Instance properties, which up until now is all that I have needed.  Supposedly I can use BindingFlags to request other types of properties (private, static), but I can't seem to find the right combination.  Public Function GetProp(ByRef obj As Object, ByVal propName as String) as PropertyInfo     Return obj.GetType.GetProperty(propName, Reflection.BindingFlags.Static Or Reflection.BindingFlags.Instance Or Reflection.BindingFlags.Public)  End Function   But still, requesting any Static members return nothing.  .NET reflector can see the static properties just fine, so clearly I am missing something here.
113280
I have layer (ImageWMS that has GeoTIFF format) and also OSM or another for my baselayer. According to  I should get pixel[0] and pixel[1] and pixel[2] to calculate height . But I have an image layer and when clicked on image layer I received pixel values of base layer not image layer. So I added filter to my codes for showing just image layer's pixel value but console show me (NON). How can I find the pixel value of image layer or better way for calculate height from image layer (raster layer .tiff)? Here is my code : const UnTiled = new ol.layer.Image({         opacity:0.9,         title:'UnTiled',         source: new ol.source.ImageWMS({             ratio: 1,             url: 'http://localhost:8080/geoserver/world/wms',             params: {                      'VERSION': '1.1.1',                     &quot;STYLES&quot;: '',                   &quot;LAYERS&quot;: 'world:world',                   &quot;exceptions&quot;: 'application/vnd.ogc.se_inimage',             }                    })                    });map.addLayer(UnTiled);  map.on('singleclick', function(evt) { map.forEachLayerAtPixel(     evt.pixel,     function (layer, pixel) {       var height =         -10000 + (pixel[0] * 256 * 256 + pixel[1] * 256 + pixel[2]) * 0.1;         console.log(height)     },     {       layerFilter: function (layer) {         return layer === UnTiled;       },     }   ); })
30996
Is there a way that I can get the last value (based on the '\' symbol) from a full path?  Example:  C:\Documents and Settings\img\recycled log.jpg  With this case, I just want to get recycled log.jpg from the full path in JavaScript.
24948
I want to know how to get the X and Y position of HTML elements such as img and div in JavaScript relative to the browser window.
19825
But here's an example:  Dim desiredType as Type if IsNumeric(desiredType) then ...   EDIT: I only know the Type, not the Value as a string.  Ok, so unfortunately I have to cycle through the TypeCode.  But this is a nice way to do it:   if ((desiredType.IsArray))       return 0;   switch (Type.GetTypeCode(desiredType))  {       case 3:       case 6:       case 7:       case 9:       case 11:       case 13:       case 14:       case 15:           return 1;  }  ;return 0;
72820
It's very easy to mark an image file to become an embedded resource however how does one access the image thereafter. Please can I have some example code?
8126
Something like .//div[@id='foo\d+] to capture div tags with id='foo123'.  I'm using .NET, if that matters.
116963
Is there any way to access the &lt;compilation /&gt; tag in a web.config file?  I want to check if the "debug" attribute is set to "true" in the file, but I can't seem to figure out how to do it. I've tried using the WebConfigurationManager, but that doesn't seem to allow me to get to the &lt;compilation /&gt; section.  Update:  I know I could easily just load the file like an XML Document and use XPath, but I was hoping there was already something in the framework that would do this for me. It seems like there would be something since there are already ways to get App Settings and Connection Strings.  I've also tried using the WebConfigurationManager.GetSection() method in a few ways:    WebConfigurationManager.GetSection("compilation")// Name of the tag in the file WebConfigurationManager.GetSection("CompilationSection") // Name of the class that I'd expect would be returned by this method WebConfigurationManager.GetSection("system.web") // Parent tag of the 'compilation' tag   All of the above methods return null. I'm assuming there is a way to get to this configuration section since there is a class that already exists ('CompilationSection'), I just can't figure out how to get it.
29862
So what I have right now is something like this:  PropertyInfo[] info = obj.GetType().GetProperties(BindingFlags.Public);   where obj is some object.  The problem is some of the properties I want aren't in obj.GetType() they're in one of the base classes further up.  If I stop the debugger and look at obj, the I have to dig through a few "base" entries to see the properties I want to get at.  Is there some binding flag I can set to have it return those or do I have to recursively dig through the Type.BaseType hierarchy and do GetProperties on all of them?
86062
How can I display an image which is stored in files?  For attachments I can use the code below, but it doen't work for files.  &lt;apex:image id="Stat1" URL="/servlet/servlet.FileDownload?file=0698E0000008w5e" width="15" height="15"/&gt;
36405
How can I change or set the default application for handling a given file type? What about for some specified actions, like "open web browser" and "preview image"?
24824
Consider type like this one  public interface IHaveGenericMethod {    T1 Method&lt;T1&gt;(T1 parm);    T2 Method&lt;T1,T2&gt;(T1 parm);    int Method2(int parm); }   How do I get a methodInfo for its methods? for a regular non-generic method, like method2, I can go with  typeof(IHaveGenericMethod).GetMethod("methodName",new Type[]{typeof(itsParameters)});   for a generic method though, I can't, since it's parameters are not types per-se. So, how do I do that? I know that I can call  typeof(IHaveGenericMethod).GetMethods()   to get all methods of that type, and then iterate over that collection and do some matching, but it's ugly. Is there a better way?
71933
What kind of node is this?    Image from this
84610
Is there any way I can take a URL of an image and find the attachment or post id of that image in the database?  Here is the situation:  I'm in a loop going over all the 'img' tags that are surrounded by 'a' tags in my post content. if the src attribute of the 'img' tag does not match the href attribute of the outer 'a' tag, then i want to replace the 'img' tag. In doing this, if the 'img' that is to be removed is in the gallery, i want to delete that post, and then put my replacement 'img' in its place. I tried using a function like this:   function find_image_post_id($url) {   global $wpdb;   $postid = $wpdb-&gt;get_var($wpdb-&gt;prepare("SELECT DISTINCT ID FROM $wpdb-&gt;posts WHERE guid='$url'"));   if ($postid) {     return $postid;   }   return false; }   This apparently is not right because the guid is ironically not globally unique. I had (earlier in the same script) uploaded a file with the same name (why? because it was higher resolution and i am trying to replace low resolution versions of the same image) and although wordpress will save the image with a different name in the directory, the guid's were set to be the same. (possibly a bug).  Is there another technique I can use?
38485
is handy, but is there a similar function in the .NET framework for ?  I'm looking for syntax like this:  Url.Combine("http://MyUrl.com/", "/Images/Image.jpg")   which would return:  "http://MyUrl.com/Images/Image.jpg"
56840
I have a problem with GetFeatureInfo (I'm working with openlayers).  In my HTML file I have this:    &lt;div id="map" class="jumbotron"&gt;       &lt;h1&gt;Sieraków &lt;span class="badge badge-secondary"&gt;MAPA&lt;/span&gt;&lt;/h1&gt;   &lt;/div&gt;   &lt;div id="info"&gt;&lt;/div&gt;   And I want to show some info in div #info.  In javascript I have layer from geoserver:  var theurl = 'http://localhost:8080/geoserver/sierakow/wms';     var jeziora = new ol.layer.Image({           source: new ol.source.ImageWMS({             url: theurl,             params: {'LAYERS': 'sierakow:jeziora'},             serverType: 'geoserver'           })     });     map.addLayer(jeziora);      map.on('singleclick', function(evt) {             document.getElementById('info').innerHTML = '';             var viewResolution = view.getResolution();             var url = jeziora.getGetFeatureInfoUrl(               evt.coordinate, viewResolution, 'EPSG:4326',               {'INFO_FORMAT': 'text/html', 'FEATURE_COUNT': 50});             if (url) {               document.getElementById('info').innerHTML =                   '&lt;iframe seamless src="' + url + '"&gt;&lt;/iframe&gt;';             }     });   To do this I followed this examples:  I also try  with parsing but result is the same, nothing happend. My div #info is still empty and I don't know why.   Console show me this errors:  Uncaught TypeError: jeziora.getGetFeatureInfoUrl is not a function  Uncaught DOMException: Failed to execute 'getImageData' on 'CanvasRenderingContext2D': The canvas has been tainted by cross-origin data.   This is url:   http://localhost:8080/geoserver/sierakow/wms?SERVICE=WMS &amp;VERSION=1.3.0 &amp;REQUEST=GetFeatureInfo &amp;FORMAT=image%2Fpng &amp;TRANSPARENT=true &amp;QUERY_LAYERS=sierakow%3Ajeziora &amp;LAYERS=sierakow%3Ajeziora &amp;INFO_FORMAT=text%2Fhtml &amp;FEATURE_COUNT=50 &amp;I=50 &amp;J=50 &amp;CRS=EPSG%3A4326 &amp;STYLES &amp;WIDTH=101 &amp;HEIGHT=101 &amp;BBOX=6919511.668971639%2C1779979.5230483634%2C6921441.703935839%2C1781909.558012564   And this error shows:  Refused to display 'http://localhost:8080/geoserver/sierakow/wms?SERVICE=WMS&amp;VERSION=1.3.0&amp;REQUEST=GetFeatureInfo&amp;FORMAT=image%2Fpng&amp;TRANSPARENT=true&amp;QUERY_LAYERS=sierakow%3Ajeziora&amp;LAYERS=sierakow%3Ajeziora&amp;INFO_FORMAT=text%2Fplain&amp;FEATURE_COUNT=50&amp;I=50&amp;J=50&amp;CRS=EPSG%3A4326&amp;STYLES&amp;WIDTH=101&amp;HEIGHT=101&amp;BBOX=6918701.436880034%2C1786965.867550262%2C6920631.4718442345%2C1788895.9025144626' in a frame because it set 'X-Frame-Options' to 'sameorigin'.   I will be greatful for every tips how to do that :)