Posts

Showing posts from July, 2014

php - Usage of Blenc extension of Apache -

i'm bit confused while using blenc v1.1.4b in apache 2.2 on ubuntu 12.04 php 5.3.10. tutorial online, have encrypt php scripts using key file. use following commands encrypt php scripts: export blencode='php -f /path/to/blenc-1.1.4b/tools/blencode.php' $blencode plain.php the script will: create 32-character blowfish unencrypted key create 44-character redistributable key file in same directory, named key_file.blenc create backup directory save original plain.php convert plain.php encrypted version plain.phpenc create symlink named plain.php , link plain.phpenc it returns: fatal error: blenc_compile: validation of script '/path/to/plain.php' failed, cannot execute. in unknown on line 0 seems failed. copy contents of key_file.blenc /usr/local/etc/blenckeys (assume have rights write file): cat key_file.blenc > /usr/local/etc/blenckeys reload browser, still fails. create .htaccess define key is: php_value blenc.keyfile /usr/local

php - Multimerch seller add and edit error -

i using opencart v.2.1.0.1. have used multimerch seller listing , seller profile management. getting error below when try add or edit seller profile admin panel. please help. error code : syntaxerror: json.parse: unexpected character @ line 1 column 1 of json data ok <!doctype html> <html dir="ltr" lang="en"> <head> <meta charset="utf-8" /> <title>permission denied!</title> <base href="https://localhost/shoppercrux/admin/" /> <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0" /> <script type="text/javascript" src="view/javascript/jquery/jquery-2.1.1.min.js"></script> <script type="text/javascript" src="view/javascript/bootstrap/js/bootstrap.min.js"></script> <link href="view/stylesheet/boo

cors - Why does my JavaScript get a "No 'Access-Control-Allow-Origin' header is present on the requested resource" error when Postman does not? -

i trying authorization using javascript connecting restful api built in flask . however, when make request, following error: xmlhttprequest cannot load http://myapiurl/login . no 'access-control-allow-origin' header present on requested resource. origin 'null' therefore not allowed access. i know api or remote resource must set header, why did work when made request via chrome extension postman ? this request code: $.ajax({ type: "post", datatype: 'text', url: api, username: 'user', password: 'pass', crossdomain : true, xhrfields: { withcredentials: true } }) .done(function( data ) { console.log("done"); }) .fail( function(xhr, textstatus, errorthrown) { alert(xhr.responsetext); alert(textstatus); }); if understood right doing xmlhttprequest different domain page on. browser blocking allows request in same origin securi

java - MediaRecorder.GetSurface() returning null -

i using code screen recording on nexus 5 running 6.0.1 july security update. screen recording works fine on other devices running 5.0.1, 6.0, 6.0.1 it's not working on phone. gives me following error when try start screen recording. e/mediarecorder: surfacemediasource not initialized! e/androidruntime: fatal exception: main java.lang.runtimeexception: failure delivering result resultinfo{who=null, request=1995, result=-1, data=intent { (has extras) }} activity {mainactivity}: java.lang.illegalstateexception: failed surface @ android.app.activitythread.deliverresults(activitythread.java:3699) caused by: java.lang.illegalstateexception: failed surface @ android.media.mediarecorder.getsurface(native method) it's failing surface screen recording. what's causing , how can resolve this? source code: public static mediaprojectionmanager getmmediaprojectionmanager(final mainactivity context) { displaymetrics metrics = new displaymetrics(); context.getwi

cakephp 2.x plugin not working in cakephp 3.x -

i have develope 1 plugin in cakephp 2.x , working fine managing basic configuration y website have make following things , below code in appcontroller public $uses = array( 'configuration.configuration', ); public function beforefilter() { $this->configuration->load(); } after in plugin's model have create function function load(){ $settings = $this->find('all'); foreach ($settings $variable){ configure::write("{$variable['configuration']['name']}",$variable['configuration']['value']); } } then in main admin login file using configuration <?php echo $this->html->link($this->html->image(configure::read('site.logo'),array('alt' => 'logo','title'=>configure::read('site.title'),'style'=>'max-width:148px;max-height:33px;')),array('controller'=>'users','action' =

redirect - Why is Apache redirecting all domains without a .conf file to one particular domain? -

my company has lamp server, , not expert @ web hosting manage basic tasks. my server hosts twelve different domains. each domain has .conf file in sites-enabled directory, , work fine. let's have example1.com, example2.com, , example3.com, explain question. recently, person work registered bunch of new domains. domain registrar, pointed domains our ip address. believe called "parking" domain. have not set .conf file or enabled of these new domains on our server yet. let's newsite1.com, newsite2.com, etc... what's puzzling me if 1 types 1 of new domains browser, 1 of our existing domain shows up. let's it's example1.com. so, if go browser , type in newsite1.com, or newsite2.com, taken example1.com. also, in address bar @ top of browser, displayed example1.com. this not desired behaviour. 1 thing, did not choose, far know, example1.com default, , it's not website want default. in case, don't know why system going example1.com opposed e

ios - Uploading image to server Detail Explanation for Beginner -

i'm working on uploading image server last 2 days there tons of questions uploading image through afnetworking , nsurlsession , other methods of uploading i'm asking didn't found single answer explaining whole concept how things work , going on under hood searched youtube stuff available in swift , trust me no explanation @ , result found answer looks familiar me //init nsurlsession configuration nsurlsessionconfiguration *defaultconfigobject = [nsurlsessionconfiguration defaultsessionconfiguration]; nsurlsession *defaultsession = [nsurlsession sessionwithconfiguration: defaultconfigobject delegate: nil delegatequeue: [nsoperationqueue mainqueue]]; //create urlrequest nsurl *url = [nsurl urlwithstring:@"yoururl"]; nsmutableurlrequest *urlrequest = [nsmutableurlrequest requestwithurl:url]; //create post params , add httpbody nsstring *params = @"api_key=apikey&email=example@example.com&password=password"; [urlrequest sethttpmetho

c - Error dereferencing pointer to incomplete type and I can't figure out why -

i've went thru material here , can't seem spot error. i've created structs used , when trying manipulate them error. advice appriciated! these structs defined in kdarray.c struct sp_kdarray_t { sppoint* points; int** sorted; int rows; int size; }; struct sp_kdarrays_t { spkdarray kdleft; int leftsize; int rightsize; spkdarray kdright; }; and in kdarray.h have: typedef struct sp_kdarray_t* spkdarray; typedef struct sp_kdarrays_t* spkdarrays; now when try manipulate them ( recursively building tree ) in following function: kdtreenode recursivetreebuild(spkdarray kdarr, int size, sp_tree_split_method spkdtreesplitmethod, int splittingdimension) { int split; kdtreenode result; result = (kdtreenode)malloc(sizeof(kdtreenode)); if (result == null) { sploggerprinterror("memory allocation error", __fil

c# - Include TFS path in .NET assembly -

when troubleshooting our applications, in many situations cannot sure branch assemblies come from, due imperfect release cycle , human error. (we have quite lot of different bugfix/feature/test/release branches etc. in our tfs). the pdb-files can sometimes, in test environment @ least, they're missing or outdated / belong assemblies branch. so, trying think of way include source branch information inside assembly directly. surprisingly, not find straight forward way online accomplish this. my answer below explains approach. happy feedback or alternative solutions. in short: created custom attribute put into assemblyinfo.cs . inside attribute's constructor, server path current assembly queried tfs , compiled it. it's combination of following: can add custom version strings .net dll? how path of assembly code in? get tfs mapped folder of local sub folder of solution? (note: cannot post actual source code due company restrictions, think it

ProGuard for Android and Retrofit2 Converter Gson? -

i using proguard in project giving wrong data in new gson().tojson(request); i getting out put {"a":"manage","b":"689184d4418b6d975d9a8e53105d3382","c":"10","d":"76"} instead of {"username":"manage","password":"689184d4418b6d975d9a8e53105d3382","value":"10","store":"76"} my proguard rule -dontwarn okio.** -dontwarn retrofit2.platform$java8 -dontwarn sun.misc.unsafe -dontwarn org.w3c.dom.bootstrap.domimplementationregistry -dontwarn retrofit2.** -keep class retrofit2.** { *; } -keepattributes signature -keepattributes exceptions -keepclassmembers class rx.internal.util.unsafe.** { long producerindex; long consumerindex; } -keepclasseswithmembers class * { @retrofit2.http.* <methods>; } -keep class com.google.gson.** { *; } -keep class com.google.inject.** { *; } and using compile 'com

Down-grade Sql Server Management Studio 2014 to SSMS 2012 -

i have developed project db in ssms 2014 deploying project, using ssms 2012. there way down-grade ssms 2014 ssms 2012? well had same issue solved generating script of current ssms. have generate scripts of db created in ssms 2014 , past in ssms 2012. hope helps you, helped me though.

php - How to add Reply-To header in $woocommerce->mailer() -

i had custom woocommerce mailer function below sending emails customers notification of there purchase, got requirement add reply-to tag. to describe in detail, customer has email( $order->billing_email ) order notification store@mycompany.com , need append reply-to tag support@mycompany.com . what emails send store@mycompany.com , when customers hit reply when want ask questions, these replies go support@mycompany.com can 1 me how change $mailer->send function achieve requirement ? function my_awesome_publication_notification($order_id, $checkout=null) { global $woocommerce; $order = new wc_order( $order_id ); if($order->status === 'completed' ) { // create mailer $mailer = $woocommerce->mailer(); $message_body = __( 'hello world!!!' ); $message = $mailer->wrap_message( // message head , message body. sprintf( __( 'order %s received' ), $order->get_order_number() ), $message_body

git - using AWS CodeCommit for website development -

i have client wants use multiple developers work on wordpress website hosted on aws ec2 instance. using codecommit right tool use in order have proper version control on project? works through git , can push files etc. possible apply current ec2 site codecommit including database? codecommit git server hosted , managed aws. it's no different using github, bitbucket, gitlab or of other managed git services. honest use 1 of other ones instead of codecommit since tend offer more features, bug tracking , project wiki hosting. if want automate deployments have integrate other services, possibly aws codedeploy or 1 of many third-party services. might search "automated deployment tools" see i'm talking about, there tons of different services out there. but possible apply current ec2 site codecommit including database? you can commit files make wordpress site git. commit database git have export database file first. common practice keep database schem

javascript - AngularJS validation select box -

have selectbox in form, try make validate not work same before input type text. wrong ? example <div class="form-group"> <label class="control-label col-sm-3">email<sup>*</sup></label> <div class="col-sm-6"> <div class="input-icon-right"> <i class="fa fa-envelope"></i> <input class="form-control" placeholder="example@example.com" type="email" ng-model="patient.email" name="email" required> <p ng-show="myform.email.$error.required" style="color:red" ng-if="myform.email.$touched">add email</p>

java - parsing a table with jsoup -

i'm trying extract e-mail adress , phone number linkedin profile using jsoup, each of these informations in table. have written code extract them doesn't work, code should work on linkedin profile. or guidance appreciated. public static void main(string[] args) { try { string url = "https://fr.linkedin.com/"; // fetch document on http document doc = jsoup.connect(url).get(); // page title string title = doc.title(); system.out.println("nom & prénom: " + title); // first method elements table = doc.select("div[class=more-info defer-load]").select("table"); iterator < element > iterator = table.select("ul li a").iterator(); while (iterator.hasnext()) { system.out.println(iterator.next().text()); } // second method (element tablee: doc.select("div[class=more-info defer-load]").select(

android - How to put a ProgressBar ontop of a View -

i trying put progressbar on top of view in layout, have looked solution couldn't find 1 online, there way me achieve outcome ? here layout: <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingbottom="@dimen/activity_vertical_margin" android:paddingleft="@dimen/activity_horizontal_margin" android:background="#dedede" android:paddingright="@dimen/activity_horizontal_margin" android:paddingtop="@dimen/activity_vertical_margin" app:layout_behavior="@string/appbar_scrolling_view_behavior" tools:context="apps.radwin.wintouch.activities.alignmentac

angularjs - $scope.msgs.push is not a function at n.$scope.send_msg -

i trying create chat application have push message user-1 user-2 privately. create $scope.msgs=[]; variable store message.this code not code, took source code here . here send message function send message. $scope.msgs.push({ msg:$scope.send_text, from_id:$scope.uid, to_id:$scope.send_to_userinfo.id, timestamp:math.floor(new date() / 1000) }); $scope.send_text=""; $scope.self.scrolldiv(); console.log($scope.msgs); } instead of one---> $scope.msgs=[]; , try var msgs=[]; . hope works .

osx - Recorder Service Error: Left Mouse Down: Failed to find matching element - Xcode error -

Image
i'm trying automate mac app xctest. while trying record app xcode, got error message: this happens when tap on button. button hierarchy is.. button -> stack view -> nsview here, button subclass of nsbutton, added buttons in stack view. stack view added in myview(subclass of nsview). p.s: each button has image view , label in it. question: when tap on button, app crashes above alert. there solution it?

hadoop - How to take solr index collection backup? -

how take solr collection lfs or hdfs? while running query: curl ' quickstart.cloudera:8983/solr/admin/… '; got error: ml version="1.0" encoding="utf-8"?> <response> <lst name="responseheader"><int name="status">400</int><int name="qtime">0</int></lst><lst name="error"><str name="msg">unknown action: backup</str><int name="code">400</int></lst> </response>

appium - How can I get http response sent by android app? -

my app sending http request, , want during test step requests , responses. in browser used browsermobproxy responses it's it's work on browser. 1 know how can responses app in test step ? you can re-route connections through proxy running on development pc. note assume have local wifi router , local network both computer , android phone connected to. all need ip of development pc accessible android phone use app testing. on pc install inspection proxy fiddler (windows), burp suite (java) or charles proxy (osx). by default proxies listen on localhost connection, can configured accept connections other computers (or in case android phone). for fiddler find in menu tools -> fiddler options -> tab connections -> allow remote computers connect. configure accordingly , change wifi setting on android phone used wifi network. enable manual proxy configuration , enter computer's ip address in local network , port number proxy listening on. after sa

java - Static Variables on Properties File vs Singleton vs Static Class vs enum -

i have lot of static variables use in whole application like: class a: final static string a="a"; final static string b="b"; final static string c="c"; class b: final static string a="a"; final static string b="b"; final static string e="e"; class c: final static string a="a"; final static string c="c"; final static string f="f"; i don´t need change variables @ runtime. so best opt here? you can put these variables in interface. way, make these "public static final". ideally can put these properties file. in case, these should config properties of application may control feature or could've been changed outside(e.g. url).

sql - vb.net Date equivalent to String.Empty -

in program, writing class read values in 1 database table, , copy them another. when reading string fields, have function called checks whether or not string value null, , if is, returns empty string, if not, returns string. (see code below) i have datetime fields can contain nulls, , without similar function, runtime error when trying copy them. is there equivalent of code below can use entering in blank date if value in database row null? public shared function dbtostring(o object) string if o dbnull.value return string.empty else return cstr(o) end if end function datetime value type, therefore notion of 'blank' doesn't exist. use minvalue of datetime there might problems , intent might not clear. use nullable datetime instead: public shared function dbtodate(o object) datetime? if o dbnull.value return nothing else return convert.todatetime(o) end if end function

ios - Pass a variable value from an IBAction to an IBOutlet -

ok, new , working through development course. realise if crack 1 long way forwards. i make post call php file on server , return json data. works. , can print variable print("firstnamevalue: \(firstnamevalue)") i want output value of 1 variable...firstnamevalue text field called textfield. i new swift , thinking "global variable?". worked want wait response http call complete update text field. i hope can help. new oop , head bursting. import uikit class viewcontroller: uiviewcontroller { @iboutlet weak var feel: uitextfield! @ibaction func anxious(sender: anyobject) { let myurl = nsurl(string: "http://mywebsite.com/jamesbond.php"); let request = nsmutableurlrequest(url:myurl!); request.httpmethod = "post";// compose query string let poststring = "firstname=james&lastname=bond"; request.httpbody = poststring.datausingencoding(nsutf8stringencoding);

java - Split up jSoup scraping result -

i scraping this link using jsoup library on java. source works , want ask how split every elements get? here source package javaapplication1; import java.io.ioexception; import java.sql.sqlexception; import org.jsoup.jsoup; import org.jsoup.nodes.document; public class coba { public static void main(string[] args) throws sqlexception { masukdb db=new masukdb(); try { document doc = null; (int page = 1; page < 2; page++) { doc = jsoup.connect("http://hackaday.com/page/" + page).get(); system.out.println("title : " + doc.select(".entry-title>a").text() + "\n"); system.out.println("link : " + doc.select(".entry-title>a").attr("href") + "\n"); system.out.println("body : " + string.join("", doc.select(".entry-content p").text()) + "\n");

Asterisk not auto Connecting to an upstream Asterisk -

i in need of help. have main asterisk server 4 digit extensions use sip trunks other phones , asterisk servers. register main asterisk server, , main asterisk server has internet connection , connection our upstream telephone number provider. everything works perfectly, question have is: server crashed , needed reboot, after reboot none of asterisks connect sip trunk main asterisk, auto reconnected. said connected on clients pbx had 1 way voice issues among other. way fixed issue had manually sip reload , dialplan reload every client pbx connects main asterisk. any suggestions why auto reconnect made such issues , needed sip reload. some more info requested diagram of connections internet<----main asterisk server -----> client asterisk --------> phone i use extensions on main asterisk servers client asterisk uses connect main asterisk server. , client asterisk normal asterisk extensions phone uses the client asterisk connected normal no issue registration ret

CSS - 'Common Classes' Bad practise or not? -

i used add call 'common classes' css such as:- .text-color{color:#2da8d9;} .text-white{color:#fff;} .text-lgrey{color:#919d9d !important;} .text-dgrey{color:#879798 !important;} .text-dkgrey{color:#656d6e !important;} .text-dblue{color:#15355c;} .text-lblue{color:#1466b1;} .nopadding{padding: 0 !important; margin: 0 !important;} .margin0{margin:0px !important;} .margint5{margin-top:5px !important;} .margint10{margin-top:10px !important;} .margint20{margin-top:20px !important;} .margint30{margin-top:30px !important;} .margint40{margin-top:40px !important;} .margint50{margin-top:50px !important;} .margint60{margin-top:60px !important;} .margint70{margin-top:70px !important;} .margint80{margin-top:80px !important;} .margint90{margin-top:90px !important;} .margint100{margin-top:100px !important;} .margint120{margin-top:120px !important;} .marginb10{margin-bottom:10px !important;} .marginb20{margin-bottom:20px !important;} .marginb30{margin-bottom:30px !important;} .marginb40

JavaScript audio.play() error -

my code stopped working today (it worked before). here code: playme = new audio(link); playme.play(); here error in console: uncaught (in promise) domexception: failed load because no supported source found. it audio.play(); doesn't work because if keep first line don't error (but dos't play). i'm using chrome 52.0.2743.82 m (64-bit) thanks.

vb.net - Why am I getting System.NullReferenceException: Object reference not set to an instance of an object? -

this question has answer here: what nullreferenceexception, , how fix it? 33 answers i'm trying assign instance of form form property the system keeps showing error @ second line of code below dim objfrm = new lsprog.sfile.frmtestrel(addressof sopdos, addressof sopdosline, addressof sopfac) _favoriteform.frminstance = objfrm _favoriteform.frmname = objfrm.name if nullreferenceexception need think null , go , make sure initialise it. you told us _favoriteform.frminstance = objfrm threw exception, _favoriteform null , needs initialised fist.

c# - Upload image to Skype BOT -

i have bot develop microsoft bot framework, , in debug run correctly after install on skype, after upload image have link this https://df-apis.skype.com/v2/attachments/0-eus-d4-7e19a097c62f5fc21dd53eabfa19d85e/views/original the code , run without skype if ((activity.attachments != null) && (activity.attachments.count > 0)) { analysisresult = await analyzeurl(activity.attachments[0].contenturl); } ........ how find picture sent? according this comment , fetch attachment, request should contain jwttoken of bot authorization header: var attachment = activity.attachments?.firstordefault(); if (attachment?.contenturl != null) { using (var connectorclient = new connectorclient(new uri(activity.serviceurl))) { var token = await (connectorclient.credentials microsoftappcredentials).gettokenasync(); var uri = new uri(attachment.contenturl); using (var httpclient = new httpclient()) { if (uri.host.e

sql - Linq return nothing if nullable data is compared -

i have column in database value null. , reading value in linq result linq not return result. linq looks dim result= (from t in <tablename> i.id=pid) pid passed nothing , db consist id value null linq should return result not return. why ? this query translated sql following clause: where [t1].[id] = @p1 the problem here null comparison semantics in sql returns null, not true, , row filtered. you want, instead, have clause: where [t1].[id] null which can different query. dim result= (from t in <tablename> i.id nothing)

windows - What is the structure of AppxSignature.p7x? -

Image
universal windows apps in .appx file, zip of bunch of files , metadata. of metadata files extensively documented on microsoft website , trivial parse and/or regenerate. appxsignature.p7x remains mystery. from diagram ( source ): appxsignature.p7x should have hashes of appxblockmap.xml, content & directory hashes, , signature. cannot find documentation of appxsignature.p7x file itself. ideally use alternative tool produce , verify signature, e.g. openssl/gnutls or similar. practical use update , repackage apps on linux, , prepare .appxupload file windows store. as described in blog post link to, appxblockmap.xml file stores cryptographic block hashes every file in package. file verified , secured digital signature when package signed using authenticode. so, on windows, have 2 tools: makeappx.exe creates package (.zip format) , blockmap file at same time . important, what's in block map corresponds closely .zip file bits, can't zipping tool step, must p

c# - check if age is <18 datepicker wpf -

i'm making application user has more 18. if he/she less 18 messagebox appears saying "under age". i'm using datepicker to select users d.o.b. problem i'm not entirely sure on how code gave go looking @ tutorials tutorials seem datetimepickers . my code follows: xaml <datepicker horizontalalignment="center" name="dpkdob" grid.column="1" verticalalignment="top" grid.row="1" /> xaml.cs int age = datetime.today.year - tbkdob.value.year; if (age < 18) { messagebox.show("under age"); } i have tested in visual studio. please find below working code : xaml : <datepicker horizontalalignment="center" name="dpkdob" grid.column="1" verticalalignment="top" grid.row="1" selecteddatechanged="dpkdob_selecteddatechanged"/> xaml.cs : public mainwindow() { initializecomponent(); } private void

java - Trigger when Date Changes in Different TimeZones -

one of business use case requires recalculate metrics on date change , need cover clients working on different time zones edt, ist etc. is there option in java trigger on date change , should work different time zone? example: want trigger date change in ist, edt, gmt, mst, cst etc only. , not time zones. there jar or framework supports can input time zones , notifications. i cannot use cron triggers here because works on single timezone. cron expression takes particular time zone. any appreciated.

php - simple yes or no checkbox for forms -

i have inserted checkbox in form. my code: <input type="checkbox" id="checkbox" name="checkbox" value="1"/> if($checkbox = ($_post['checkbox']) == '1') { $checkbox = "si"; } else { $checkbox = "no"; } i if checkbox checked receive "yes" otherwise "no". thanks. you've written wrong if condition here, cannot use assignment in conditions. also there no need assign value variable in checking condition, can directly use $_post['checkbox'] . this, if($_post['checkbox'] == '1') { $checkbox = "si"; } else { $checkbox = "no"; } update: a better option use isset() determine if variable set , not null. this, if(isset($_post['checkbox'])) { $checkbox = "si"; } else { $checkbox = "no"; } program go in if condition

javascript - How to create Horizontal Scroll-able menu with dyanamic content -

here want create horizontal scroll-able menu using javascript , not able achieve can 1 help? <script type="text/javascript"> $(function () { var div = $('div.sc_menu'), ul = $('ul.sc_menu'), ulpadding = 15; var divwidth = div.width(); div.css({ overflow: 'hidden' }); var lastli = ul.find('li:last-child'); div.mousemove(function (e) { var ulwidth = lastli[0].offsetleft + lastli.outerwidth() + ulpadding; var left = (e.pagex - div.offset().left) * (ulwidth - divwidth) / divwidth; div.scrollleft(left); }); }); </script> if want more details check site http://jsfiddle.net/qdjvb/

sql server 2008 - IF statement with Transact SQL -

when execute transact sql code if (select model_id request_unit request_id = '4357') null select part_id request_unit request_id = '4357' else select model_id request_unit request_id = '4357' i receive following error: subquery returned more 1 value. not permitted when subquery follows =, !=, <, <= , >, >= or when subquery used expression. how using coalesce() ? select coalesce(model_id, part_id) request_unit request_id = '4357'; the if not needed. the error seems pretty self-explanatory. there more 1 row in request_unit request_id 4357.

mysql - Schema design for a table having one column pointing towards multiple tables -

consider following schema: create schema testschema; use testschema; create table ( id int not null auto_increment, name varchar (50), primary key(id)); create table b ( id int not null auto_increment, name varchar (50), primary key(id)); create table c ( id int not null auto_increment, name varchar (50), primary key(id)); create table main ( id int not null auto_increment, typeid int, type varchar(50), tablemappingsid int, primary key (id) ); create table tablemappings ( id int not null auto_increment, tablename varchar(50), primary key (id) ); insert (name) values ('usa'), ('uk'), ('uno'); insert b (name) values ('earth'), ('mars'), ('jupiter'); insert c (name) values ('1211'), ('12543'), ('345'); insert main (typeid, type, tablemappingsid) values (1,'tablea',1), (2,'tableb',2), (3,'tablec',3); insert t

regex - Python Regular Expression for stopping in between -

this string: age: adult/child gender: male/female age range: 3 - 5 years/5 - 8 years/8 - 12 yrs/12 years , up product type: costume character: animals & insects material: polyester theme: animal age start: 3 years age end: adult features: -face seen through mouth of zebra. -zipper closure in front , tail in back. -set includes: jumpsuit , head mask. -animal collection. age: -adult/child. gender: -male/female. age group: -3 - 5 years/5 - 8 years/8 - 12 years/12 yrs , up i want catch bold part python regex. not able it. used regex not working quite possibly. regex is: \bage[a-z]?\b.*\d+\s(?:years[a-z]?|yrs|month[a-z]+) this getting weird answer, catching unwanted string. you can use following: \bage range:\s*(?:\d+\s*-\s*\d+\s*y(?:ea)?rs/)+\d+\s*y(?:ea)?rs , up\b see demo

mysql - how do you insert data into a table correctly using INSERT INTO? -

i new sql , relational databases, writing code add data tables have created. not sure if code have written correct inserting table. can tell me if correct please. insert job (job_id, job_name) values (‘1’, ‘teacher’); you code right if use autoincrement column job_id should use and use single quote s , not ‘ insert job ( job_name) values ( 'teacher'); otherwise code prodivided insert job (job_id, job_name) values ('1', 'teacher );

asp.net core - Running Visual Studio Build in VSTS with deployment package configuration results in multiple errors -

Image
hi trying configure continuous deployment build on vsts can not seem make build work. should mention started learning vsts week ago might miss pretty obvious. here have done far: i have created visual studio build step following configuration: solution: $/commercify/dev/commercify.sln msbuild arguments : /p:deployonbuild=true /p:webpublishmethod=package /p:packageassinglefile=true /p:skipinvalidconfigurations=true /p:packagelocation="$(build.artifactstagingdirectory)\" platform : $(buildplatform) configuration: $(buildconfiguration) clean: true 7: visual studio version:visual stiudio 2015 8: have enabled nugget restore packages in advanced when build step gets run following errors: my application build asp.net core , have multiple .net core class libraries. class libraries have been created , have default project.json generated visual studio: { "version": "1.0.0-*", "dependencies"

android - Why wont the button disappear? -

im trying develop android app, , 1 of features when hitting button, should button disappears. this, not work, can explain me why? thanks! button startbutton = (button) findviewbyid(r.id.startbutton); startbutton.setonclicklistener(new view.onclicklistener() { @override public void onclick(view view){ view thisbutton = findviewbyid(r.id.startbutton); thisbutton.setvisibility(view.gone); } }); try following: button startbutton = (button) findviewbyid(r.id.startbutton); startbutton.setonclicklistener(new onclicklistener() { @override public void onclick(view view) { view.setvisibility(view.gone); } });

python 2.7 - How do recipe clippers/recipe scrappers/ recipe copier works on many web sites? -

i working in python- asking question out of curiosity , requirement. have requirement create recipe copier/scrapper can work on 20-25 website. know scraping website using beautifulsoup module of python 2.7 , helps in scraping data when know structure of website. but there plenty of meal/recipe websites provide recipe clipper/copier , work per plan eat one tsp big oven food network and many more. provide option import recipe other websites. have created custom scrapper work on of websites or there wonderfull api exist using? i have found 1 such custom scrapper: recipe scraper but built in python 3 , not support python 2 not useful me when went through code came know using beautiful soup , wrote custom code scrap content major recipe websites. can me understand howcome sites listed , many more creating recipe clippers??

ios - Autoresize subviews when resizing the superview -

i not able handle subview resizing correctly: suppose have custom uiview class, inside contains uiimageview. initially, set uiviews followings: // width , height uiimage width height // possible uiimage width height larger container self.imageview.frame = cgrectmake(0 ,0, width, height) self.imageview.backgroundcolor = uicolor.redcolor() self.imageview.contentmode = uiviewcontentmode.scaleaspectfit self.imageview.autoresizingmask = [.flexiblewidth, .flexibleheight,.flexibletopmargin, .flexibleleftmargin, .flexiblerightmargin, .flexiblebottommargin] addsubview(self.imageview) self.frame = cgrectmake(0, 0, width, height) self.backgroundcolor = uicolor.greencolor() let's call custom uiview myview. and when want place "myview" in viewcontroller. did followings: myview.frame = cgrectmake(xpos, ypos, 100, 100) myview.autoresizesubviews = true and found after did this, got following results. myview place @ correct place correct size, internal uiimageview got