Posts

javascript - How to programatically inject html to qunit-fixture -

i programatically inject html test qunit-fixture. have tried $.load js dealing html gets executed before html loaded. the html: <div id="qunit"></div> <div id="qunit-fixture"></div> <script src="../components/bower/qunit/qunit/qunit.js"></script> <script> qunit.config.autostart = false; </script> <script data-main="tests" src="../components/bower/requirejs/require.js"></script> the js manipulating html module want test: define(['jquery'], function($) { 'use strict'; var foo = { _init: function() { this._addclass(); }, _addclass: function() { console.log('adding class testit'); $('.foo').addclass('testit'); }, greet: function() { return "hello"; } }; foo._init(); return { greet : foo.greet }; }); and test: define(['foo'], function(foo...

PHP not sending email to email addresses that have 2 dot ('.') characters in their name -

i have been struggling send email using mail function in php while. want send 2 separate emails 2 different email addresses. $allowhtmlheader = "mime-version: 1.0\r\n"; $allowhtmlheader .= "content-type: text/html; charset=iso-8859-1\r\n"; $headers = "from: webmaster@xyz.com\r\nreply-to: webmaster@xyz.com\r\n" . $allowhtmlheader; $customerheaders = "from: a.b.c@gmail.com\r\nreply-to: a.b.c@gmail.com\r\n" . $allowhtmlheader; $subject = "enquiry"; $message = "try me..."; $cmessage = "i score better!"; if ($_post[cemail] != null) { if (mail("a.b@gmail.com", $subject, $cmessage, $cheaders)) { echo("message sent!"); } else { echo("message delivery failed..."); } if (mail("a.b.c@gmail.com", $subject, $message, $headers)) { echo("message sent!"); } else { echo("message delivery failed..."); } ...

scala - Play framework- design suggestion for validation -

i need validate if newly added entity, part of model has been added. addition happen taking input user. believe standard way add constraints in form along lines of .verifying( "already exists", <code check if entity exists> ) this lead globalerror entity exists. error message static "already exists". i'm looking for, though, tell user possible matches exist, globalerror incapable of doing. should want not adding validator , allowing binding succeed? way, when myform.fold{ entity returned success => <success code>, erroneousform => <failure code>} i can take success branch , check there if entity duplicate? if similarities exist can redirect user? feel shouldn't controller's job, , of design logic inside controller, should technically lie inside model itself. , model should tell controller wrong , 'type of w can first create new element , upon finding potential rongness' , controller can take appropriate ac...

android - Appcelerator Titanium - Problems detected with the SDK settings -

Image
so have error in title, have got several fresh copies of android sdk , titanium. still getting error. tried several other fixes non worked. for install titanium sdk, recommend (windows): unnistall android references, node.js, titanium sdk (users\\appdata\roaming\titanium), clean folders , registry (ccleaner or other) , reboot system. unzip android sdk r22 , install or update android machines less android sdk (android.bat) install android ndk set android_home , ndk_home @ os path (+ reboot) install latest titanium studio sdk + node.js check android sdk , ndk on titanium sdk preferences

c# - How to remove a control from window programmatically? -

i have window button in it, , need remove or not depending on argument passed window: public mainwindow(bool removecontrol) { initializecomponent(); if (removecontrol) { //code remove button } } in xaml file declare normal button: <button width="120" height="25" content="click" name="clickbutton"></button> i know can done doing reverse thing means add button depending of boolean parameter, need so. you can do: mybutton.visibility = visibility.collapsed; ...or if want removed "logical tree"...then depends "container"/parent button in, in how remove it. disconnecting element any/unspecified parent container in wpf remove control window in wpf http://joe-bq-wang.iteye.com/blog/1613370

qt - "You are creating QApplication before calling UIApplicationMain" error on iOS -

when create qtwidgets application, select iphonesimulator-clang qt5.3, , run app in debug mode on ios simulator error below. not adding code; running qt creator template code. "error: creating qapplication before calling uiapplicationmain. if writing native ios application, , want use qt parts of application, place create qapplication within 'applicationdidfinishlaunching' inside uiapplication delegate.” i have qt5.3.1 (installed using online installer) , xcode 5.1.1. running provided calculator example on ios simulator works fine without error. just in case solution decided disappear elsewhere: fix change signature of main function. #if defined(q_os_ios) extern "c" int qtmn(int argc, char **argv) #else int main(int argc, char **argv) #endif { ... }

How do I make my http request proxy in c#? -

when use code below error: servicepointmanager not support proxies https scheme. how change code around make proxyed? var request = (httpwebrequest) webrequest.create("https://website.com/index.php?"); var myproxy = new webproxy("https:/website.com/index.php?"); request.proxy = myproxy; string postdata = "secret=" +textbox1.text; byte[] data = encoding.ascii.getbytes(postdata); request.method = "post"; request.contenttype = "application/x-www-form-urlencoded"; request.contentlength = data.length; using (stream stream = request.getrequeststream()) { stream.write(data, 0, data.length); } var response = (httpwebresponse) request.getresponse(); string read = new streamreader(response.getresponsestream()).readtoend(); response.close();