Posts

javascript - How to print directly in IE 11 with ActiveX -

on page show pdf document in iframe , try print directly. @ end of search, situation suitable ie 11 reason security etc. how can that? don't know. please save me situation :/ i use these dom element , function <button type="button" onclick="printdoc()" class="btn success">print it</button> <script type="text/javascript"> function printdoc() { $(document).ready(function () { document.getelementbyid("mydiv").contentwindow.print({ bui: false, bsilent: true, bshrinktofit: true }); }); }; </script> activex control not work on ie11 microsoft no longer allows activex plugins run in browser space.however if having 54 bit operating system can try forcing ie run in 32-bit m...

swift - Getting run time error when adding constraints -

i'm trying center image view i'm getting error..this code: let markerimage = #imageliteral(resourcename: "ic_new_mark_icon") let size = cgsize(width: 60, height: 60) var newimage = imagewithimage(image: markerimage, scaledtosize: size) var imageview = uiimageview(image: newimage) self.view.addsubview(imageview) let xconstraint = nslayoutconstraint(item: imageview, attribute: .centerx, relatedby: .equal, toitem: self.view, attribute: .centerx, multiplier: 1, constant: 0) let yconstraint = nslayoutconstraint(item: imageview, attribute: .centery, relatedby: .equal, toitem: self.view, attribute: .centery, multiplier: 1, constant: 0) imageview.addconstraint(xconstraint) imageview.addconstraint(yconstraint) and error is 2016-12-22 16:29:11.305417 googlemappractice[21426:362773] [layoutconstraints] view hierarchy not prepared constraint: <nslayoutconstraint:0x600000285f00 uiimageview:0x7ff772f15560.centerx == uiview:0x7ff7...

c# - Email not sending ASP.NET MVC 4 Using SMTPClient -

i add more functionalities method, such email sent once user has edited data. debugged code no errors generated not know going wrong. [httppost] public actionresult edit(editptg eptg) { try { using (managegrade gradelogic = new managegrade(ref uow)) { foreach (var ptg in eptg.ptgforgrade) { ptg.overwritten = true; ptg.active = true; producttogradelogic.update(ptg); } //need investigate why need recalculate grade @ point of time - sri mark?? //eptg.grade = gradehelpers.recalculategradestringfromproductassignment(eptg.ptgforgrade, eptg.grade); smtpclient smtpclient = new smtpclient("www.hotmail.com", 25); // smtpclient.credentials = new system.net.networkcredential("username", "password"); smtpclient.usedefaultcredenti...

python - Using Mocks inside Doctests? -

i using doctests. wondering correct way doctest function performs external action (e.g. sends email, connects server, etc)? using mock seems answer muddy doc string of function. for example: class sshconnection(baseconnection): """provides basic ssh functions. >>> host = '127.0.0.1' >>> port = 22 >>> username = 'user' >>> password = 'password' >>> ssh = sshconnection(host, username, password, port) >>> ssh.execute('uname -a') """ ...

preferencefragment - Increasing Items in a list view based on condition -

i want add listprefernce initailly ex:a,depending on condition same list want add other ex:b, how can achieve using list preferences . i able add listview, listview rather list adding more entries... here code: preferences.xml: <preferencecategory android:key="custom_frag" android:title="some options"> addpreferencesfromresource(r.xml.preferences); preferencecategory targetcategory = (preferencecategory) findpreference("custom_frag"); listpreference checkboxpref1 = new listpreference(context); charsequence[] entries1 = { "googlemaps"}; charsequence[] entryvalues = { "1" }; checkboxpref1.setentries(entries1); checkboxpref1.setentryvalues(entryvalues); checkboxpref1.settitle("number of blahs"); targetcategory.addpreference(checkboxpref1); targetcategory.addpreference(checkboxpref1); ...

windows - How to openfile in special program using autoit? -

i need open file in special program. example, need open *.docx file if office word. i have figured out how run office example() func example() ; run notepad window maximized. local $ipid = run("c:\program files (x86)\microsoft office\office15\winword.exe", "", @sw_showmaximized) ; wait 10 seconds notepad window appear. winwait("[class:winword]", "", 5) ; wait 2 seconds. sleep(2000) ; close notepad process using pid returned run. processclose($ipid) endfunc ;==> how open file? for word documents, pass name of document command line argument example() func example() ; run notepad window maximized. local $ipid = run("c:\program files (x86)\microsoft office\office15\winword.exe" & " " & "path_to_document", "", @sw_showmaximized) ; wait 10 seconds notepad window appear. winwait("[class:winword]", "", 5) ...

assembly - MASM: Using Current Location Counter ($) in .data declaration -

i met problem current location counter in masm. here assembly code, , used visual studio 2013 express assembling .386 .model flat,stdcall .stack 8192 exitprocess proto,dwexitcode:dword .data ptr1 dword $ ptr2 dword $ ptr5 dword $ .code main proc mov eax, $ mov eax, $ invoke exitprocess,0 main endp end main in opinion, think ptr1, ptr2, , ptr5 should have own location value. but it's not correct in fact. when in debugging mode, variables show same result. ptr1, ptr2, ptr5 have same address , there no offset between them. what's problem when using $ declaration ? your problem seems bug in masm (or microsoft put it, "feature"). problem isn't dword directives aren't generating object code or aren't advancing assembler's location counter. if former true wouldn't show in executable @ all, , if later true have same address. the problem masm incorrectly uses offset of start of current segment (in generated obje...