Posts

Showing posts from March, 2012

sql - Any way to "shortcut" common joins or code blocks in MySQL? -

i have tables in normalized forms (i've started learning this, wildly guess i'm using 3rd normal form know i'm wrong, know of example code horribly written , potentially wrong), , there few common joins use across several queries. for illustration's sake, let's have information on songs, this: songs: song_id (pk) | song_title | first_artist | most_famous_artist albums: album_id (pk) | album_title | version | format | year_released song versions: song_version_id (pk) | song_id (fk) | artist | year_released album tracks: album_id (pk, fk) | track_no (pk) | song_version_id (fk) and suppose pulling information on particular version of song, including name of song , album appeared on, keep writing: from song_versions sv inner join songs s on sv.song_id = s.song_id inner join album_tracks @ on at.song_version_id = sv.song_version_id inner join albums on a.album_id = at.album_id or whatever case may be. know denormalize bit, , either combine couple of

java - Session not found in other server when running test script on jmeter -

i running test script on jmeter. design of system i'm testing multi-profile. meaning, login using http server, redirected either server1 or server2 (randomly). on test script recorded, redirected server2. whenever run pre-recorded test script again (with 100 users/threads), requests redirected server2 processed , requests redirected server1 returning 'user session not found' error. how fix this? i have http cache , http cookie manager in test plan before http samplers. it seems bad configuration of 2 servers not sharing session data. normally, servers share session related information such cookies client can response either of servers. i not sure whether can control server hit (though hit second server during recording, because load balancer has chosen server @ point in time), load balancer decision (based on algorithms used, least response times, client ip-based etc) i suggest check server configurations whether sharing cookie level data or not. also, su

Removing rogue webjob from Azure web application -

i have azure wep app, couple of web jobs running inside it. noticed 1 of these webjobs running old code. impossible remove it, keeps running no matter do. i have tried: * redeploying code. * stopping webjob * stopping web app * deleting web job. even after deletion, webjob still running, , consuming queue. there no web app anywhere running webjob old code anymore. i have suspicion webjob running inside deployment slot, deployment slots deleted, not know how confirm this. on kudu dashboard, webjob not present in process explorer. how rid of rogue webjob? you try specific job name , check job runs history via webjobs api , check whether job indeed deleted/stopped. if webjob deleted current website, please make sure whether other webjob running on other websites consuming queue. in addition please make sure whether azure functions being used. of cause, tasks outside of azure consuming queue possible. if worry performing storage maliciously, said, try regenerate s

MEAN Technology(mongodb,express js,angular js,node js) -

in mean technology,i need develop payroll application,in have 2 fields code , name,but code , name should unique,how code in mongodb? are serious? but still, mean code , name should unique individually or mean combination of code+name should unique. there difference, if code , name should unique individually means there cannot same code in 2 different db. if combination should unique means 1 code there different names , vice versa. i going provide subjective answer haven't shown have tried or wish try. either user _id code+name making sure unique. or can have different key code , name in document having unique key indexing on both of them. or in second case having compound unique indexing.

c - Why the pointer from called function doesn't return the value to calling function? -

#include<stdio.h> #include<stdlib.h> unsigned int *bin(int); int main(void) { unsigned int n=0,*i=null; printf("enter no:"); scanf("%d",&n); i=bin(n); printf("binary no: %d\n",*i); return 0; } unsigned int *bin(int n) { unsigned int i=0,j=0; static unsigned int *result=null; result=(unsigned int*)malloc(1*sizeof(unsigned int)); printf("result=%p\n",result); j=(unsigned int)result; for(i=(1<<31);i>0;i=(i>>1)) { if(n & i) { *result=1; result++; } else { *result=0; result++; } } result=(unsigned int*)j; printf("result=%p\n",result); return result; } output : enter no:6 address of result=0x2576010 address of result=0x2576010 binary no: 0 the purpose of program convert decimal number binary number.the main function calling bin() function convert decimal binary. logic of code :- let take unsigned integer (32 bit), consi

c# - Garbage collection of an object that is registerd to an event -

this question has answer here: why , how avoid event handler memory leaks? [closed] 3 answers i have view object initializes object, creditcard object, , register event creditcard raising. if view object have no reference it. garbage collected? or have unsubscribe in order happen? you need unsubscribe object garbage collected. "the cause simple explain: while event handler subscribed, publisher of event holds reference subscriber via event handler delegate (assuming delegate instance method)." - https://stackoverflow.com/a/4526840/283787

The Video is playing using iframe in a website. -

actually, video playing using iframe in website of now. want change iframe alternate way. because should not use iframe concept in website. there other way play video? use <video> tag check demo fiddle html <video width="320" height="240" controls> <source src="https://tutorialehtml.com/assets_tutorials/media/shaun-the-sheep-the-movie-official-trailer.mp4" type="video/mp4"> browser not support video tag. </video> for more can read here on video tag video tag p.s. : video used https://tutorialehtml.com/ it supported in browsers : chrome 4.0+ ie 9.0+ mozilla 3.5+ safari 4.0+ opera 10.5+

How do you extract color profiles from a PDF file using pdfbox (or other open source Java lib) -

once you've loaded document: public static void main(string[] args) throws ioexception { pddocument doc = pddocument.load(new file("blah.pdf")); how page page printing color intent pddocument? read docs, didn't see coverage. this gets output intents (you'll these high quality pdf files) , icc profiles colorspaces , images: pddocument doc = pddocument.load(new file("xxxxx.pdf")); (pdoutputintent oi : doc.getdocumentcatalog().getoutputintents()) { cosstream destoutputintent = oi.getdestoutputintent(); string info = oi.getoutputcondition(); if (info == null || info.isempty()) { info = oi.getinfo(); } inputstream = destoutputintent.createinputstream(); fileoutputstream fos = new fileoutputstream(info + ".icc"); ioutils.copy(is, fos); fos.close(); is.close(); } (int p = 0; p < doc.getnumberofpages(); ++p) {

ios - convert url into NSData -

i want upload voice recording on server. my file url is: file:///users/xantatech/library/developer/coresimulator/devices/77f4d768-1f04-4390-b60f-f1fe79388653/data/containers/data/application/87c457fa-1a9f-4ca9-a651-6a3d411a0b7e/documents/myaudio0.mp3 my code is: nsdata* data = [nsdata datawithcontentsofurl:audiourl options:nsdatareadinguncached error:&error]; but data nil. please try below code nsstring *audiourlstring = @"file:///users/xantatech/library/developer/coresimulator/devices/77f4d768-1f04-4390-b60f-f1fe79388653/data/containers/data/application/87c457fa-1a9f-4ca9-a651-6a3d411a0b7e/documents/myaudio0.mp3"; nsstring *sendstr = [[audiourlstring absolutestring] stringbyreplacingoccurrencesofstring:@"file:///private" withstring:@""]; nsdata *data = [[[nsdata datawithcontentsoffile:sendstr]]]; good luck.....

php - Getting 500 Error in admn grid edit form -

i transferred site dev server , when open cms pages , click on grid item shows me error: 500 internal server error - http://test.com/admin/cms_page/edit/page_id/3/key/0299dda10356a2de9059101b0355ab50/ it happens when click on edit grid item , click on "create new". causing error?

css - Height 100% for parent div not working in IE11 -

Image
this code works on google chrome, height minimized in ie11; expands when click on links in menu. , font size increases in ie; need help. tried setting parent div height 1000px; way not minimize height. when click on link display content not display content. highly appreciated. html { font-size: 62.5%; height: 100%; } body { font-size: 1.4rem; height: 100%; } @media (min-width: 1200px) { .container-fluid-full { overflow: hidden; position: relative; height: 100%; } #content { width: 85.578%; padding: 28px; margin: 0px 0px; margin-left: 14.422% !important; height: 100%; } #sidebar-left { background: #eeeeee; border-style: solid; border-right: thick #edf0f4; margin-left: 0px !important; position: absolute; height: 100%; } <div class="container-fluid-full"> <div class="row-fluid"> <!-- start: main menu --> <div id="si

java - Significance of Resource name in tomcat context -

can please explain me significance of resource name in context.xml. question similar " how resource name attribute in tomcat's context.xml work? " explaination: in server.xml have 2 contexts 2 different applications. 1.<context> <resource name="jdbc/app1"></resource></context> 2.<context> <resource name="jdbc/app2"></resource></context> when use app1 both context resource name, both applications works fine. if give app2 application gives me error "cannot create jdbc driver of class '' connect url 'null'" what problem? the resource's name more appropriately called path . path, rooted @ java:comp/env , within jndi namespace. value used code locate object within jndi namespace @ same location. ref: http://tomcat.apache.org/tomcat-8.0-doc/config/globalresources.html#resource_definitions

java - Dozer: Map class containing instance variable of itself -

i've been googling , trying find example dozer xml configuration maps class having instance variable of itself. example - public class { string var1; int var2; list<a> var3; } into class - public class b { string var1; int var2; list<b> var3; } from documentation http://dozer.sourceforge.net/documentation/mappings.html looks don't need define configuration , dozer map class class b (from dozer documentation - explicit xml mapping 2 classes not required if field mapping between src , dest object can performed matching on attribute name (sic)). but unsure if work. facing problem while setting dozer in project not able test it. please suggest how above class can converted class b using dozer?

json object convert to string java -

i have json file , want convert json string using org.simple.json { "header": { "issuerid": "000141", "authenticationid": "e07020c0d040a050a0808099", "authenticationdatetime": "20151103093035", "authenticationdatetimegmt": "20151103093035", "signature": "mthemtexqkmzqzm0ouixqjm5mdc2mjfgmzmyqjhdntk1oti0ndnertg5odcwqjnfotc0odqwnthbnkqxntgzntk2n0yzn0i2otkymzi1qjy2oendqjgxrunerdlgndfdnzvcmzq5njg5nty4nzkwnuq5mzbdn0exotvgouy0ouy2qjlcqzldqkreoeq3njezrkq2oeyymdheqty2qtkznuzdm0uzoti3rdk2otywodg4ntkynzyyqujcqkjfrezgnzncneeynuu5otc5otffodk2mtq0q0y4q0rgnzg1m0jbqtm4qkzbqzrfruy2mtkzm0e4rei3qkq0mejbrku4otleotvdntkxotq0m0iwnjmymzzdq0u4mzdbqtqzodu3rkmyoeq0rjk2numyrknerum0ndreqkiznum0quverduzrjfbotk5rtq4mjk4mznerju3rtq1que2nzc4mduyrtdertdgrtvfrurgrkvgmtlfn0y2qtayqtvcnjk3nuu2oungruu3mzrgndzdote0q0u3ntk5nzdgndkyotdfqkrgreiwndbcndhbqtkzmze1qju

ios - Crash app when call setUnselectedItemTintColor from UITabBar -

i've tried both line bellow cause [uitabbar setunselecteditemtintcolor:]: unrecognized selector sent instance [self.tabbar setunselecteditemtintcolor:[uicolor blackcolor]]; [[uitabbar appearance] setunselecteditemtintcolor:[uicolor blackcolor]]; any suggestion? this method available on ios 10 only, crash on previous versions. should check method availability before calling it. if ([[uitabbar appearance] respondstoselector:@selector(setunselecteditemtintcolor:)]) { [[uitabbar appearance] setunselecteditemtintcolor:[uicolor blackcolor]]; }

python - matplotlib locator_params or set_major_locator not working -

i trying reduce number of axis ticks in subplots (each axis different values, can't set ticks manually), other answers such this or this don't work. syntax creating figure standard, follows: fig = plt.figure(figsize=(7,9)) ax = fig.add_subplot(8,2,i+1) # plotting in larger loop, don't think there wrong loop, because else (axis limits, labels, plotting itself...) works fine. and reduce number of yticks, tried ax = plt.locator_params(nbins=4, axis='y') which raised error typeerror: set_params() got unexpected keyword argument 'nbins' and tried ax.yaxis.set_major_locator(plt.maxnlocator(4)) which gave error attributeerror: 'nonetype' object has no attribute 'yaxis' i don't understand why subplot considered nonetype. suspect core of problem, examples saw have same structure, i.e. fig = plt.figure() ax = fig.add_subplot(111) ax.yaxis.set_major_locator(plt.maxnlocator(4)) and should work. why ax nonetype? the

Azure Storage Account Metrics only visible for Classic Storage Account -

Image
i've tested creating both classic storage account ( manage.windowsazure.com ) , "new" storage account in new azure portal. set them similar , run same code create , configure queue. metrics showing classic storage account in portal (able see both accounts in new portal) i have set serviceproperties this, , can see these changes saved when fetching service properties or looking in azure portal. cloudstorageaccount storageaccount = cloudstorageaccount.parse(storageconnectionstring); cloudqueueclient queueclient = storageaccount.createcloudqueueclient(); metricsproperties metricsproperties = new metricsproperties(); metricsproperties.setmetricslevel(metricslevel.service_and_api); metricsproperties.setretentionintervalindays(2); loggingproperties loggingproperties = new loggingproperties(); loggingproperties.setretentionintervalindays(10); loggingproperties.setlogoperationtypes(enumset.

java - How to stop an applet from blinking? -

i have been trying convert 1 of games applet since first time using applet ran problem. whenever open game screen start blinking. i'm pretty sure due not having bufferstrategy whenever try create 1 "bufferstrategy bg = this.getbufferstrategy()" doesn't work. can help? package main; import java.awt.color; import java.awt.graphics; import javax.swing.japplet; import handling.handler; import other.hud; import other.keyinput; public class game extends japplet implements runnable{ private static final long serialversionuid = 9021342660060318393l; public static final int width = 640; public static final int height = width / 12 * 9; private thread thread; private boolean running = false; private handler handler; private hud hud; private spawner spawner; private menu menu; public enum state{ menu(), help(), settings(), deathscreen(), game(); }; public enum difficulty{

java - YouTube API v3 `getMonetizationDetails` returning null -

i trying acces monetization details within java application using youtube api v3 in order change monetization details particular videos. my youtube , google accounts set work google adsense , monetization feature enabled via youtube web frontend. still cannot retrieve monetization details video . returned videomonetizationdetails null . youtube.videos.list listvideosrequest = m_youtube.videos().list("snippet,status").setid(_svideoid); videolistresponse listresponse = listvideosrequest.execute(); list<video> videolist = listresponse.getitems(); if (!videolist.isempty()) { video video = videolist.get(0); videomonetizationdetails vmd = video.getmonetizationdetails(); // vmd null } i have tried values list filter already: contentdetails, filedetails, id, livestreamingdetails, localizations, player, processingdetails, recordingdetails, snippet, statistics, status, suggestions, topicdetails how retrieve , set monetization details videos using youtube api

jquery - add a class to first element in array -

i have simple question jquery array elements... <div id="holder"> <div class="a">a</div> <div class="a">a</div> <div class="a">a</div> <div class="b">b</div> <div class="b">b</div> <div class="b">b</div> <div class="b">b</div> <div class="c">c</div> <div class="c">c</div> <div class="c">c</div> <div class="c">c</div> <div class="c">c</div> </div> and js: var klassenarray = $("#holder").find("[class]").map(function() { return this.classname; }).get(); alert(klassenarray); gives me: a,a,a,b,b,b,b,c,c,c,c,c now need add class called first every element same classname. that: <div id="holder">

fiware spagobi api rest validate with keyrock -

Image
i have 3 instances: 1.- app web (ubuntu instance) 2.- keyrock instance 3.- spagobi instance my spagobi instance works validating users keyrock same app web. create reports in it. now, need these reports insert app web. im trying use http://docs.spagobi.apiary.io/ , the preview subresource option. times have modal window asking user/pass (as apache security option). im using http://spagobi-url/spagobi/restful-services/2.0/documents/printers_visited/preview (printers visited label of document). , results: if wrote user/pass in panel, validation dont work , tries loop. anyone know how solve this? the rest services provided spagobi require basic authentication, that's why see modal window asking credentials. in order avoid this, should implement sso between application , spagobi , open session in spagobi: when session opened, should able invoke rest services. pay attention fact preview subresource static (optional file), not executed report: if want exe

remote access - How do I connect to a computer using IP address? -

how connect computer using ip address. connected computer using team viewer recently. cannot anymore , use ip address of pc assuming computer connecting , running microsoft windows operating systems, please see article instructions:- connecting remote windows desktop

oauth 2.0 - Get location media from instagram api -

so, have situation here. client wants location media instagram without access token, authorized app, etc... can achieved? if not, please tell me how start submission permission, , permission instagram. do mean media geolocation? get https://www.instagram.com/explore/locations/<location_id>/?__a=1 without authorization , application, example curl https://www.instagram.com/explore/locations/212988663/?__a=1 for new york , parse json

java - Error while provisioning Active Directory account to user using access policy -

hi have oim11gr2ps3 environment installed active directory 11.1.6.0.0 connector configured. have password policy attached ad resource. earlier users having ad account provisioned. last couple of days on basis of user creation in oim ad account not bale see in account tab. checked access policy it's correctly configured. user got correct role on basis of role membership. i checked oim-server1-dignostic.log file oim server, found below stack traces: oracle.iam.platform.kernel.eventfailedexception: error occurred in oracle.iam.accesspolicy.impl.handlers.provisioning.provisionaccountactionhandler while provisioning resource 47,709 user 13 , cause of error error occurred in oracle.iam.provisioning.spi.dobprovisioningmechanism/provision while provisioning application instance key 0 user name 1161546 cause of error oracle.iam.provisioning.exception.genericprovisioningexception: dobj.usr_password_does_not_match_policy: h: password not satisfy policy: max. number of unicode charac

javascript - How to create Child Controller Angular Js -

define([], function() { function myctrl($scope,$http) { $scope.test = "course man"; } myctrl.$inject=['$scope','$http']; return myctrl; }); we have separate file each controller , lazy loaded when required.. have corresponding entry in application.js. now problem : i need 2-3 child controllers linked parent controller.. , there in single file.. can loaded.. tried : define([], function() { function myctrl($scope,$http) { $scope.test = "course man"; } function myctrl1($scope,$http){}; myctrl.$inject=['$scope','$http']; return myctrl; }); but, dosen't seems working. update ---- parent -- define([], function() { function myctrl($scope,$http) { $scope.test = "course man"; } myctrl.$inject=['$scope','$http']; return myctrl; }); wi

javascript - How can I access a single view in on a SPA? -

i have react-js application following structure: public src components - books.js - bookshow.js - app.css - app.js - index.js in package.json using following node modules: { "name": "tester", "version": "0.1.0", "private": true, "devdependencies": { "react-scripts": "0.7.0" }, "dependencies": { "bootstrap": "^3.3.7", "react": "^15.3.2", "react-bootstrap": "^0.30.6", "react-dom": "^15.3.2", "react-router": "^3.0.0" }, "scripts": { "start": "react-scripts start", "build": "react-scripts build", "test": "react-scripts test --env=jsdom", "eject": "react-scripts eject" } } in main site trying create 1 page app list books books.json

javascript - Kendo UI multi select drop down with filter and select all options -

Image
i need kendo ui dropdown list following features. multi select dropdown select check box check multiple options @ at time. select checkbox header template, on when click on it, filtered search results of option selected. i have gone through many references , find close solution telrik. in first requirement satisfied. have attached code snippet here with. <!doctype html> <html> <head> <meta charset="utf-8" /> <title>kendo ui snippet</title> <link rel="stylesheet" href="http://kendo.cdn.telerik.com/2016.3.1028/styles/kendo.common.min.css" /> <link rel="stylesheet" href="http://kendo.cdn.telerik.com/2016.3.1028/styles/kendo.rtl.min.css" /> <link rel="stylesheet" href="http://kendo.cdn.telerik.com/2016.3.1028/styles/kendo.silver.min.css" /> <link rel="stylesheet" href="http://kendo.cdn.telerik.com/2

Sort in MYSQL PHP date -

$mydate = date('h:i, j f y'); 11:51, 11 november 2016 what wrong here? select id, mydate, date(mydate) date2 mytable order date2 desc limit 5 its showing me this: 11:41, 10 november 2016 20:17, 4 november 2016 22:49, 9 november 2016 21:04, 9 november 2016 21:32, 3 november 2016

asp.net - insert one to many code first -

i want insert factor in db , factor have customer id. i have 2 class public class customer { [key, foreignkey("factor")] public int id { get; set; } [required] public string name { get; set; } [required] public string lastname { get; set; } public gender gender { get; set; } [required] public string mobile { get; set; } public virtual icollection<factor> factor { get; set; } } public class factor { public int id { get; set; } [required] public string name { get; set; } public datetime date { get; set; } public virtual customer customer { get; set; } public virtual icollection<factordetails> factordetails { get; set; } public virtual factortype factortype { get; set; } } and create modelview these 2 classes, public class createfactorviewmodel { public factor factor { get; set; }

Redirect http to https on iis server with multiple sites on custom ports -

so have scenario have iis server test server , houses 15+ different web apps. problem have found though because setting our deployments (via octopus deploy) use https cert on server if try access sites without explicit https:// prefix hangs not listening http traffic https on bindings. most solutions assume using normal 443 port our sites use custom ports someserver:1234 there seems little info on how enable http these scenarios. ideally want same port listen http , https , redirect http https, cannot find nice way solve without making 2 ports per site, , mean http on existing someserver:1234 , https on `someserver:98761 or former redirecting latter, feels bit clunky. so there better way solve problem?

android - How to change the text color of the bottom menu item? -

Image
how change text color of bottom menu item? thanks!!! change the text color values>>color.xml <item name="android:colorprimary">#000000</item> <item name="android:textcolorprimary">#000000</item> <item name="android:attr/textcolorprimary">#000000</item> you can put own color code in it. in case have put black(#000000) if dnt work try change accent color same color.xml

c# - Attach Generic method event handler with unknow type -

i need attach handler radlistview column creation, adding datasource control. public void genericcolumncreatinghandler<t>(object sender, listviewcolumncreatingeventargs e) { e.column.visible = baseentity<int>.membervisibility<t> (e.column.fieldname, telerikpropertyvisibilityattribute.visibilitytypeenum.basedetails); e.column.headertext = caricatestolocale(e.column.headertext, "col_" + e.column.headertext); e.column.bestfit(); e.column.autosizemode = listviewbestfitcolumnmode.allcells; } my problem need perform handler attach other generic method: private void populaterecord(tipotabellabase tipo) { type generic = typeof(commontableservice<>); type[] typeargs = { tipo.tipo }; var constructed = generic.makegenerictype(typeargs); var instance = activator.createinstance(constructed); if (instance == null) return

html - In a bootstrap table how remove lines between rows? -

i have bootstrap table, want remove lines between of rows in table (at end of table) there quick way achieve this? you can remove border bootstrap tables using following css: .table>tbody>tr>td, .table>tbody>tr>th { border-top: none; } this override bootstrap's td , th selector specificity , apply border-top style instead of theirs. note apply tr elements within tbody . you'll need add in styling thead , tfoot elements if want work well. now specify some of rows, i'm guessing don't want applying of them. that, add new class tr elements wish remove border on, , include class name in css selector(s): <tr class="no-border">...</tr> .table>tbody>tr.no-border>td, .table>tbody>tr.no-border>th { border-top: none; }

linux - LiteSpeed web server: Block DDoS attacks + web bots & crawlers -

how can limit ddos attacks + web bots & crawlers using litespeed web server? have wordpress site deployed on litespeed , observe slow response server, because of these attacks. i know litespeed has features block ddos attacks. if can suggest better option or possible configurations, helpful. thanks

json - Check List of object all properties Contains null then remove from list in c# -

Image
i have list of json data have deserialize in list of class object if proerties name not match json data takes value null. json data come url user dependent user can enter data validation handle null when properties not match. samplejson list of data like: [{"adsname":"francis","adsimageurl":"andrew love.jpg","ontop":false,"key":30012647,"onscan":true,"adscode":6689390,"brandname":{"adsbrand":"beth moon"},"category":"new ads","adsscription":"weinstein jacob sutton","from":"2016-12-30t00:00:00","to":"2016-12-30t00:00:00"},{"adsname":"mckay","adsimageurl":"lorraine spencer.jpg","ontop":false,"key":136301519,"onscan":true,"adscode":346146503,"brandname":{"adsbrand":"russell warner"},&qu

c# - Is Adding subreport in rdlc is good as comapare to adding content on same report? -

i have report contains more 1 datasets . have implement new functionality,in have add more content on basis of conditions. please suggest how should implement this? means using subreport or adding content on same report or else better.

c# - Get ImageUniqueID in .tiff images -

with following code-snippet uniqueimageid of .jpg image. same code doesn't work .tiff files. has idea? thx image myimage = new bitmap(@"c:\path\to\picture.tiff"); system.text.asciiencoding encoding = new system.text.asciiencoding(); propertyitem pi = myimage.getpropertyitem(42016); // exif-code -> uniqueimageid string uniqueimageid = encoding.getstring(pi.value, 0, 32); my solution: install nuget-package: http://bitmiracle.com/libtiff/ https://www.nuget.org/packages/bitmiracle.libtiff.net/ code example: string uniqueimageid; tiff mytiff = tiff.open(absolutepath, "r"); fieldvalue[] exififdtag = mytiff.getfield(tifftag.exififd); int exififdoffset = exififdtag[0].toint(); mytiff.readexifdirectory(exififdoffset); fieldvalue[] value = mytiff.getfield(tifftag.exif_imageuniqueid); if (value != null) { (int = 0; < value.length; i++) { uniqueimageid = value[i].tostring(); } } mytiff.close();

css - SVG transparency not preserved on iOS (iPad/iPhone) -

i have svg doesn't seem work ios devices. i've tried in both chrome , safari svg appears solid blue block colour , doesn't preserve different layers , opacity levels... https://jsfiddle.net/2fluspdm/ <svg version="1.0" id="layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewbox="0 0 1920 3840" style="enable-background:new 0 0 1920 3840;" xml:space="preserve"> <style type="text/css"> .st0{opacity:6.000000e-02;fill:#609fd0;enable-background:new ;} </style> <polygon class="st0" points="1920,2614 1920,3641 1470,3005.1 "/> <polygon class="st0" points="1920,1612.4 1210,780 1920,0.4 "/> <polyline class="st0" points="0,0 650,0 0,1184.3 1,0 "/> <polygon class="st0" points=&q

php - how do I get star rating in google search result underneath my site URL -

i want them code. not google reviews cause people need have google account that. i've looked on schema.org don't it. so how stars in snippet you should use aggregaterating : <script type="application/ld+json"> { "@context" : "http://schema.org", "@type" : "localbusiness", "name" : "my company", "url" : "http://www.mycompany.com/", "telephone" : "(+33) 1 23 45 67 89", "email" : "info@mycompany.com", "address" : { "@type" : "postaladdress", "streetaddress" : "1 rue de la place", "addresslocality" : "paris", "postalcode" : "75000" }, "aggregaterating" : { "@type" : "aggregaterating", "ratingvalue" : "4.2",

apache spark - Why doesn't the application UI storage tab show broadcast variables -

when broadcast variable in spark, don't see in storage tab of apllication web ui. handy see how memory uses. there reason why broadcast variables not shown? i came across same problem , found still unresolved ticket 2014: https://issues.apache.org/jira/browse/spark-3957 it says sending broadcast var info driver open new (quite unnecessary) channel. workaround pull request (sending broadcast info on top of other info) somehow got lost through time... https://github.com/apache/spark/pull/2851

python - Writing many tif files into h5 file format -

i trying prepare data cnn training in keras unfortunately images have (more 10kk) in tif format 3 channels keras not able read. need convert them , think best choice tif conversion numpy array , save h5 format. images selected few classes , want create few h5 files classes in them. wondering how should create h5 file able read keras , create labels later. way of generating h5 files correct? able read files without problems , shuffle them in batches different classes in each? thanks ! import h5py, os import matplotlib.pyplot plt folderwithtifsclass0 = "path/to/tifs/with/class/0" folderwithtifsclass1 = "path/to/tifs/with/class/1" folderwithtifsclass2 = "path/to/tifs/with/class/2" tablewithtifs0, tablewithtifs1, tablewithtifs2 = [], [], [] # writing tifs class 0 array tiffile in os.listdir(folderwithtifsclass0): img = plt.imread(tiffile) tablewithtifs0.append(img) # writing tifs class 1 array tiffile in os.listdir(folderwithtifsclass1):

unsetChild method is not work in magento 1 layout -

Image
i tried use code below no success: <reference name="right"> <action method="unsetchild"> <name>product.info.sharing</name> </action> </reference> image 1 : child block image 2 :for parent block turn on template path hints , see template file coming. then can search in catalog.xml of theme , see name used in as . check parent block, use name in reference tag, , in tag use value in as tag of original block. add local.xml in layout folder, try values <catalog_product_view> <reference name="product.info"> <action method="unsetchild"><name>sharing</name></action> </reference> </catalog_product_view> clear cache.

php - DI in yii2, constructor injection -

i have created interface, i'm trying inject inside controller. i'm getting following error: argument 1 passed backend\controllers\agencycontroller::__construct() must implement interface common\service\appserviceinterface, string given i created service folder inside common folder, added 2 files it appservice.php appserviceinterface.php now defined dependency inside common/bootstrap.php file below: yii::$container->set('common\service\appserviceinterface', 'common\service\appservice'); afterwards tried inject inside agencycontroller placed inside backend/controllers/agencycontroller below: namespace backend\controllers; use common\service\appserviceinterface; public function __construct(appserviceinterface $appservice) { $this->appservice = $appservice; } but i'm getting error mentioned earlier. so have change __construct method below , working fine: public function __construct($id, $module

javascript - onblur is getting called before textbox gets updated -

Image
i have textbox date user can select date using datepicker. i want know if date gets changed added onblur textbox: <asp:textbox runat="server" id="txtdate" cssclass="dateonly" width="80px" onblur="checkifdatechanged(this.value)" ></asp:textbox> then in jquery wanted check date getting added alert: function checkifdatechanged(date) { alert(date); } the onblur seems called before textbox changes new date. if current date 28/10/2016 , change 29/10/2016 alert shows 28/10/2016. date changes after close alert message. how know if date gets changed when select new date datepicker? you can use onselect event. $(".dateonly").datepicker({ onselect: function(date) { display("date: " + this.value); } }); read more https://api.jqueryui.com/datepicker/#option-onselect

gruntjs - Customize Bootstrap (sass) avoiding be overrided by someone else when packages are installed via Bower -

i know best way customize bootstrap (sass) avoiding overrided else when packages installed via bower. let's have project grunt, bower , bootstrap (sass). in bower.json have dependencies bootstrap-sass: { ... "dependencies": { "bootstrap-sass": "^3.3.7", ... } } through grunt install packages bower dependencies, downloaded in /bower_components folder. scss bootstrap files copied /bower_components/bootstrap-sass/assets/stylesheets /sass . have main.scss file in /sass wich imports bootstrap (@import 'bootstrap';). /sass/main.scss compiled /css/main.css . gruntfile.js: module.exports = function(grunt) { grunt.initconfig({ pkg: grunt.file.readjson('package.json'), 'bower-install-simple': { prod: { options: { production: true } }, dev: { options: { production:

VBA: Search, save and replace by rows according to conditions -

i have input this: gen,n,,,gongd,,,n,,,kl,0007bd,,,,,,,,tak, gen,n,,,ratec,,,n,,,kp,0007bc,,,,,,,,taz, kap,n,,,ebfwe,n,,,,,,,,,kp,002bd4,,,kp,123000,,,,,n,,,,p kap,n,,,st,weit,e3,ebfwei,,,kp,002bd2,n,,,,,,kp,002bd3,,,,,,,z,mg00,,,,,n,,,,p i have code this: sub find() dim rfoundaddress range dim sfirstaddress string dim x long thisworkbook.worksheets("sheet1").columns(1) set rfoundaddress = .find("kap,*", lookin:=xlvalues, lookat:=xlwhole) if not rfoundaddress nothing sfirstaddress = rfoundaddress.address dim wrdarray() string dim text_string string dim string dim k string dim num long text_string = rfoundaddress wrdarray() = split(text_string, "kp,") = left(wrdarray(1), 6) k = left(wrdarray(2), 6) columns("a").replace what:=i, _ replacement:=k, _

javascript - Anonymous function warning -

i have problem on code , don't know how fix it. write "important here" console tell me function(e) anonymous. how can resolve problem? (function() { var theform = document.getelementbyid('theform'), inputs = document.queryselectorall('input[type=text]'), inputslength = inputs.length; (var = 0; < inputslength; i++) { inputs[i].addeventlistener('keyup', function(e) { check[e.target.id](e.target.id); }); } theform.addeventlistener('submit', function(e) { //important here var result = true; (var in check) { result = check[i](i) && result; } if (result) { alert('le formulaire est bien rempli.'); } e.preventdefault(); }); theform.addeventlistener('reset', function() { (var = 0; < inputslength; i++) { inputs[i].classname = ''; } de

javascript - Is it possible to catch net::ERR_BLOCKED_BY_CLIENT? -

Image
so on our site have various searches of work fine , return appropriate results. few of them return javascript error: failed load resource: net::err_blocked_by_client when search on machine. i have found out issue running adblocker in google chrome , adblocker causing problem. know turn adblocker off fine , have, there way me catch error in javascript , report user why not getting search results? ideally after similar c# try/catch. edit: ok, after digging around , being pointed in right direction comments below think have deduced issue, others. after having read this looks trying accomplish cannot done using version of jquery running (1.10.x) guess solution use new version of jquery (2.x) , see if can catch error unfortunately cannot catch error message specifically, can catch error itself: $.ajax({ url: 'http://openx.net', datatype: 'json', success: function( data ) { console.log( "success:", data); }, error: funct

php - How to restore the right date if it was inserted lately -

Image
if have zktime machine register attendance of employees . sometimes machine insert bulk of transactions in sql server db wrong later date 8-2103 instead of 11-2016 what possible causes of problem , how restore right date if can't detect problem ? i've looked @ vendor link supplied , not in case. i'm afraid won't able answer due items outside of sql server. believe need contact vendor support this. the questions need find out are: how time machine calculate checktime data? how time machine store checktime data? how machine create file export sql server? this appears either issue how system records checktime data or in how either exports / writes data sql server. as far correcting issue basic update statement fix it, since there different dates need write unique update each case.