Posts

Showing posts from September, 2012

html - How to fix cutting edge of php date-picker on bootstrap modal form? -

Image
am using php date-picker on twitter bootstrap modal form , design issue it. when modal-form appears on-click event, didn't displayed proper date-picker design on modal form. this mozilla firefox v12.0, , ie-8 browsers. snap: here code snippet <div class="modal-body"> <div id="firdiv" style="float:left; height:210px; width:260px; padding-bottom:30px;"> <!--php datepicker --> <?php include_once('calendar/tc_calendar.php'); $curr_date = date("y-m-d", time()); $datepicker2=plugins_url('calendar/', __file__); $mycalendar = new tc_calendar("date1"); $mycalendar->seticon($datepicker2."images/iconcalendar.gif"); $mycalendar->setdate(date("d"), date("m"), date("y")); $mycalendar->setpath($datepicker2); $mycalendar->setyearinterval(2035,date('y'));

mathnet - QR decomposition in Math.NET Numerics -

how qr decomposition implemented in math.net numerics? is gram-schimdt or givens rotations? have feeling implemented gram-schimdt, i'm not sure. can't find implementation. is qr decomposition gram-schimdt different givens rotations, in terms of results? i generated (manually) qr decomposition using givens rotations matrix, , generated qr decomposition using mathnet.numerics.linearalgebra.generic.factorization.qrmethod (which believe implements gram-schimdt) , results different. difference between numbers 1e-16 (not big), , rows have opposite sign (*-1) (this real problem - think happens because mathnet.numerics implements different qr algorithm). can suggest libraries perform qr decomposition using givens rotations? according documentation , implemented using householder reflections : the computation of qr decomposition done @ construction time householder transformation. different methods can produce answers small numerical differences or negati

ios - Strange value of calculated float in Objective-C -

my app calculated this. float containtaxvalue = 840; float taxrate = 5; float divisionednum = (100 + taxrate)/100; float removedtaxvalue = containtaxvalue/divisionednum; float taxvalue = containtaxvalue - removedtaxvalue; finally answer nslog(@"%f",removedtaxvalue); => 800.000061 nslog(@"%f",containtaxvalue); => 840.000000 nslog(@"%f",taxvalue); => 39.999939 i "taxvalue == 40.000000" in code. i couldn't make sense what's issue. let me know advise please. the ieee 754 standard way of storing floating-point numbers in easy manipulate way machine. method used intel , mot of processors. ieee 754 specifies numbers stored in binary format reduce storage requirements , allow built-in binary arithmetic instructions available on microprocessors process data in relatively rapid fashion. however, numbers simple, non-repeating decimal numbers converted repeating binary numbers cannot stored perfect accuracy. 1/10

Maximo Anywhere New Look Up fields create issue -

i working on maximo anywhere 7.5.2 - work execution application. need show new field (created in maximo asset management) in app.xml. after executing app, new field showing in ui not showing respective data. kindly help. thanks the cookbook , other anywhere documentation on ibm site explain in detail how this. http://www-01.ibm.com/support/knowledgecenter/sspjlc_7.6.0/com.ibm.si.mpl.doc/config_apps/t_add_flds_domains.html

database - Java JPA - Persisting @OneToMany entity -

hello everyone, i'm having these days problem persisting object @onetomany. having problem i'm trying create both objects (one onetomany, other 1 manytoone), , want persist @onetomany one, , automatically have @manytoone persisted database also. ( all tables set autoincrement, , collection initialized in constructor of komponenta.class, i've put parts connected problem ). here's code: public class komponenta implements serializable { @id private integer idkom; @onetomany(cascade = cascadetype.all, mappedby = "idkom") private collection<ima> imacollection = new arraylist<>(); } public class ima implements serializable { @id private integer idima; @joincolumn(name = "idkom", referencedcolumnname = "idkom") @manytoone private komponenta idkom; } // runnable part tools.em.gettransaction().begin(); komponenta k = new komponenta(); ima = new ima(); collection<ima> list = k.getimacollection(

java - Fetch double value from customized JSlider -

i have created jslider 0 1 increment of 0.1. wrote following code implement not sure how fetch values slider since function getvalue() fetches integer values. in case fetches 10 no matter move slider. please can tell me how can fetch double values slider. slider=new jslider(); slider.setmajortickspacing(1); slider.setmaximum(10); slider.setpaintlabels(true); slider.setpaintticks(true); slider.setpreferredsize(new java.awt.dimension(230, 46)); format f = new decimalformat("0.0"); hashtable<integer, jcomponent> labels = new hashtable<integer, jcomponent>(); for(int i=0;i<=10;i++){ jlabel label = new jlabel(f.format(i*0.1)); label.setfont(label.getfont().derivefont(font.plain)); labels.put(i,label); } slider.setlabeltable(labels); following code listener slider.addchangelistener(new changelistener() { public void state

r - Using grepl to extract a value from text across multiple columns -

i have dataframe (df) containing 2 columns of data state , city. sometimes, however, data inside 2 columns transposed or incorrectly entered. dataframe this: location state bangkok bangkok metropolitan central thai bangkok i want create new column, "city" extracting 'bangkok' these 2 separate column. can 1 column like: df$city <- ifelse(grepl("bangkok",df$location),"bangkok","") however, want search @ least 2 or more columns @ once, like: df$city <- ifelse(grepl("bangkok",df$location||df$state),"bangkok","") which, obviously, doesn't work. 'filter' in plyr think similar in reverse. any appreciated. thanks! you can use grepl more once. besides, should use | rather || . df1 <- data.frame(location=c("bangkok", "", "central thai", "someth"), state=c("", "b

react native - Dark android theme in RN? -

i'm new android , i'm trying android 'dark' theme work in android versions. theres lot of information , i'm not sure how interpret it: holo isn't used anymore android 6 doesn't support dark theme? there material light/dark how can dark theme (for alert , such), compatible versions of android api > 16? you can use theme.appcompat dark theme , answer other question should use within style <item name="coloraccent">@color/accentcolor</item> <item name="colorprimary">@color/primarycolor</item> <item name="colorprimarydark">@color/darkprimarycolor</item> to change default accent , primary , darkprimary color

java - how to read two parameters of the same type? -

i'm trying create method transfer funds 1 account another.. i'm trying take both sending , receiving account numbers of account class input parameters i'm getting invalid account number exception. how without generating exceptions? there way make both parameters 'accountnumber'? public int fundtransfer(int accountnumber, int accountnumber1, int amount) throws invalidaccountnumberexception, insufficientbalanceexception{ account account=searchaccount(accountnumber); account account1= searchaccount(accountnumber1); if(amount>0){ account.setamount(account.getamount()-amount); account1.setamount(account1.getamount()+amount); }else{ throw new insufficientbalanceexception(); } throw new invalidaccountnumberexception(); } here opinion on code can change: public int fundtransfer(int accountnumber, int accountnumber1, int amount) throws invalidaccountnumberexception, insufficientbalanceexception{

swift - iOS Code Works on iOS 9 but not on iOS 8? -

one of tabs (in tab-based application) works on ios 9, not work on ios 8. specifically, when trying load data plist, error shown below. i have "planner" tab saves entries plist. ios 8 error - reason: '*** -[nskeyedunarchiver initforreadingwithdata:]: incomprehensible archive (0x62, 0x70, 0x6c, 0x69, 0x73, 0x74, 0x30, 0x30)' saving code: let appdelegate = uiapplication.sharedapplication().delegate as! appdelegate plistpath = appdelegate.plistpathindocument plistpath2 = appdelegate.plist2pathindocument // extract content of file nsdata let data:nsdata = nsfilemanager.defaultmanager().contentsatpath(plistpath)! let data2:nsdata = nsfilemanager.defaultmanager().contentsatpath(plistpath2)! do{ if(numofviewwillappear == 0) { if let x = nskeyedunarchiver.unarchiveobjectwithdata(data2) { self.sortedsections = nskeyedunarchiver.unarchiveobjectwithdata(data2) as! [string]

ios - Multiple Navigation Controllers -

i having trouble organizing registration/login flow of app. have storyboard entry point of app pointing navigation controller. in appdelegate.m if user not logged in have: signupviewcontroller *signupviewcontroller = [[signupviewcontroller alloc] init]; self.navcontroller = [[uinavigationcontroller alloc] initwithrootviewcontroller:signupviewcontroller]; self.window.rootviewcontroller = self.navcontroller; [self.window makekeyandvisible]; this creates 'sign up' navigation controller. i have tried pop signupviewcontroller along navigation controller initial screen of app (the navigation controller pointed in storyboard), have not had success. when use storyboards (and therefore have initial view controller there) ios doing set window.rootviewcontroller view controller initial view controller flag . in code replacing root view controller signupviewcontroller embedded in uinavigationcontroller , that's why cannot pop because there n

android - java.lang.NullPointerException while running the app after creating layout-land folder -

i have xml working in portrait mode. created 1 more folder landscape layout-land , added same xml , made changes according landscape mode, when run app getting following error. 03-18 09:30:59.276: e/androidruntime(5753): fatal exception: main 03-18 09:30:59.276: e/androidruntime(5753): java.lang.runtimeexception: unable start activity componentinfo{com.netserv.pungry/com.netserv.pungry.restaurantdetails}: java.lang.nullpointerexception 03-18 09:30:59.276: e/androidruntime(5753): @ android.app.activitythread.performlaunchactivity(activitythread.java:2180) 03-18 09:30:59.276: e/androidruntime(5753): @ android.app.activitythread.handlelaunchactivity(activitythread.java:2230) 03-18 09:30:59.276: e/androidruntime(5753): @ android.app.activitythread.access$600(activitythread.java:141) 03-18 09:30:59.276: e/androidruntime(5753): @ android.app.activitythread$h.handlemessage(activitythread.java:1234) 03-18 09:30:59.276: e/androidruntime(5753): @

c# - How to add List type code example in XML comment? -

i have used below xml comment, /// <example> /// example shows how use <see cref="samplecollection"/> property. /// <code> /// class testclass /// { /// list<string> collection = new list<string>(); /// collection.add("column1"); /// collection.add("column2"); /// this.samplecollection = collection; /// } /// </code> /// </example> public list<string> samplecollection { get; set; } but has following warning error, xml comment on 'samplecollection' has badly formed xml -- 'end tag 'code' not match start tag 'string'.' because list definition has <string> . considered xml tag. is there way resolve this? use cdata block embed raw text within xml: <![cdata[ list<string> ... ]]>

tomcat - Unable to connect to EC2 instance using JCONSOLE -

i using jconsole monitor memory utilization of ec2 instance w.r.to jvm, want set tomcat, mean want monitor tomcat. i have gone through many links, 1): http://gabenell.blogspot.in/2010/04/connecting-to-jmx-on-tomcat-6-through.html i followed steps mentioned in 2nd url still unable connect ec2 instance using jconsole , jconsole says "connection failed: retry?" i worried how import "openssh-key" think lacking in point 1st url says @ point start ssh tunnel with: ssh user@aws-host -l10001:127.0.0.1:10001 -l10002:127.0.0.1:10002 i unable step, please elaborate more on topic. i made setting in security group of amazone you can see amazon security group setting in immage

codeigniter - How to change the time zone in a MySQL database -

in database table field taking date time value current_timestamp. not getting current time of country. how can change time zone ('asia/kolkata') mysql database. i have access manage database phpmyadmin. i think database located in , using codeigniter develop site. instead of using current_timestamp() , try use sysdate();

embedded code - Writing GPIO interrupts for LPC1769 -

i developed application generate pulses(pwm) using timer of lpc1769. period of pulse 10milli seconds , pulse width can varied required. pulse width generated depending on reference signal square wave of 10milli seconds(with on period of 7.2ms , off period of 2.8ms). whenever there rising edge of signal pwm pulse should start. working fine. detect rising edge used gpio interrupt external interrupt3 isr : 1) if rising edge on gpio pin(p2.11) 2) clear rising edge status on pin. 3) set timer few milli seconds and in timer isr 1) clear pending timer irqs 2)make gpio pin high on generating pwm pulse(p2.6) 3) set timer few milli seconds , clear pin(p2.6)(same timer used in both isrs) 4) disabling timer , re enabling rising edge interrupt on gpio pin(p2.11), again serves isr of external interrupt3 on rising edge of reference signal , continues above. now getting problem in code in developing application as, 1) if rising edge disable interrupt , set timer 8 milli

Why can't I fill this php array in while loop? -

i'm trying add values array in while loop in php, however, can't seem so. values added array if test strings, using variables doesn't work. variables ($array[$j][0]) can echoed not added added array. while($j>0){ $added=array(); $added[]=$array[$j][0]; } print_r($added); each time $added array getting reset(empty) in while loop. use below code $added=array(); while($j>0){ $added[]=$array[$j][0]; } print_r($added);

show multiple products foreach row in mysql php -

i making latest product list in php getting data database. want echo 18 latest products database. having outer html each item echoed pruducts different data. below query getting latest products $query = mysql_query("select * devices order id desc limit 3") or die(mysql_error()); while($row=mysql_fetch_array($query)) and here html: <div class="col-xs-6 col-sm-4 col-md-3 col-lg-2 nopadding"> <div class="device_box"> <a title="'.$row['name'].'" href="'.$row['link'].'"><img class="img-responsive" alt="'.$row['name'].'" title="'.$row['name'].'" src="'.$row['img'].'" /></a> <span> <a title="'.$row['name'].'" href="'.$row['link'].'">

parallel processing - Code implementation for openmp -

i want implement following sequential code in openmp (2 core) parallel computing. which modifications should run openmp? if me appreciated. in advance program potential parameter (imx=201, jmx=201) common /pars/ imax,jmax,kmax,kout common /grid/ dr,dth,r(imx),th(jmx),x(imx,jmx),y(imx,jmx) common /vars/ phi_k(imx,jmx),phi_kp1(imx,jmx) data rl2,rl2allow /1.,1.e-7/ c..read input data, generate grid data , initialize solution call init c..start iterative solution loop k = 0 while (k .lt. kmax .and. rl2 .gt. rl2allow) k = k + 1 call bc c..point iterative solutions call sor c..line iterative solution c call slor c..update phi_k array , evaluate residual rl2=0. j = 2,jmax-1 = 2,imax-1 rl2 = rl2 + (phi_kp1(i,j) - phi_k(i,j))**2 phi_k(i,j) = phi_kp1(i,j) enddo enddo rl2 = sqrt(rl2/((imax-2)*(jmax-2))) pri

ios - Developing a simple Course Management System for iPhone using Xcode using Table Views only -

i have build course management app. using table views app. using table view controllers. the first view contains semesters - 1,2,3,4....12. the second view contains details respective previous table view controller. the details in second table view controller are: lectures, papers, to-do list, record lecture. depending on user's selection, can access lectures, papers, list, record lecture particular semester. not able figure out how pass data third view fourth , subsequent views. eg. lecture->lecture 1: introduction->download pdf. how assign specific table view controller when user taps particular cell? using seques or cellforrowatindexpath method? i confused. kindly me in regard. highly appreciated. you in didselectrowatindexpath . here prepare view want present , push navigationcontroller . instance: // on user tap, present details want. - (void)tableview:(uitableview *)tableview didselectrowatindexpath:(nsindexpath *)indexpath { deta

ios - Not able to load my view controller after completed ~10 min in background -

i putting app in background ~10 min (using beginbackgroundtaskwithexpirationhandler ) after home button pressed. @ end of 10 min setting local notification launch app again same view controller. but when interact local notification not able come on same view controller. it's called applicationwillenterforeground , didreceivelocalnotification . in didreceivelocalnotification setting view controller no success. edit code in didreceivelocalnotification nf1abccontroller *abc = [[nf1abccontroller alloc]init]; [self.navigationmanager.defaultnavigationcontroller pushviewcontroller:abc animated:yes]; you have make sure abc view controller not nill, check defaultnavigationcontroller not nil. the appropriate way such thing send notification of type nsnotifcation inside applicationdidrevievelocalnotification method also have register last view controller visible before app entered background ,when view controller receives notification pushes desired view control

Run Windows Phone Emulator on 32-bit version of Windows -

i have 32-bit version of windows 10. have installed visual studio 2013 ultimate, unable find emulator windows phone. how can test application? the windows phone sdk uses hyper-v, requires 64-bit platform host. see below excerpt. note requirements listed under operating system . system requirements emulator windows phone 8 your computer must meet following requirements: bios in bios, following features must supported: hardware-assisted virtualization. second level address translation (slat). hardware-based data execution prevention (dep). ram 4 gb or more. operating system windows 8 64-bit pro edition or higher source: msdn notice regarding universal apps ( uwp ) universal apps targeting windows 10 can created , tested on 32-bit ( x86 ) platform, unable build , test applications 64-bit ( x64 ) , arm platforms. source: msdn

performance - Selecting a random row in Django, quickly -

i have view returns data associated randomly-chosen row 1 of models. i'm aware of order_by('?') , performance problems, , want avoid using order_by('?') in view. because data in model changes (if @ all), i'm considering approach of caching entire model in memory between requests. know how many records i'm dealing with, , i'm comfortable taking memory hit. if model change somehow, regenerate cache @ moment. is strategy reasonable? if so, how implement it? if not, how can select random row model changes if @ all? if know ids of object, , range can randomize on ids, , query database

javascript - a is a function, then what `a.call.call` really do? -

Image
these codes run on chrome devtool. it seems b.call (same a.call.call ) calling first argument, function, pass second argument this . if first argument not function, throw not function error. can explain how <function>.call.call work? let me show example. function a() { console.log(1) } function b() { console.log(2) } a.call(b) // 1 a.call.call(b) // 2 a.call.call.call(b) // 2 why? we know a.call(b) means invoke a() this value b . so a.call.call(b) means invoke function.prototype.call() this value b, same function.prototype.call.call(b) . but function.prototype.call.call() not ordinary function object. can invoked has no property. there's unique rules invoke it. function.prototype.call.call(a) // 1 function.prototype.call.call(b) // 2 in fact, function.prototype.call.call(b) exotic object, furthermore, bound function exotic object. [specification] bound function exotic object wraps function object. [specificat

python - how to build dynamic database (autonomously operating) in Django? -

my problem want build django website has periodically-automatically-updated databases @ back-end of django application. example, want add new record database every 5 second, , wrote code in models.py follow: import datetime django.db import models import time class descriptors(models.model): updated = models.datetimefield(auto_now=true) def add_new_record(): descriptor = descriptors(updated = datetime.datetime.now()).save() time.sleep(5) while true: add_new_record() this code create record in background when run python manage.py startserver . however, code stick @ creating record without starting server. there idea how can solve problem, or tutorial should refer making dynamic database @ back-end of django? thank you. make separate management command that: # yourapp/management/commands/create_descriptor.py import datetime django.core.management import basecommand class command(basecommand): def handle(self, *args, **kwargs): descriptor

using C++ libraries in python using ctypes -

i have c++ library provides various classes managing data. have source code library. trying call function of lda.cpp of library python using ctypes. function in turn uses function other .cpp files in library. //lda.cpp #include "model.h" #include <stdio.h> #include "lda.h" int lda_est(double alpha, double beta) { model lda; if (lda.model_est(alpha, beta)) { return 1; } lda.estimate(); return 0; } what found out need use c++ wrappers declaring functions extern , compile them .so file. question how should make wrapper file? , should declare functions in library extern or 1 want call python? ctypes tool integrate existing libraries can't change. since have sources , willing change them, can write python module in c++, there multiple toolkits e.g. boost.python. in other words, @deleisha right, ctypes wrong tool job. note can still create python module existing library wrapping functions , classes. using tool

Download Google Map from a website and show it from android app -

i'm planning build android app support website. site shows map nodes , links have installed around territory, in case, spain. goal access app map download updated , show phone. map in website google map , android phone may support without problems. there easy wait so? the site want download map this: http://www.guifi.net/ca/maps thank in advance!

Typeface returns null on Android 4.4 when looking at widgets inside a parent view when targeting API higher than 21 -

there seems problem appcompat widgets on android.support.v7. basically, using getlayoutinflator().inflate() load xml layout relativelayout or linearlayout viewgroup . then, pass viewgroup function extracts child views , attempts @ typeface of child view if textview, button or edittext. works fine on android 5 , above. however, on android devices running 4.4.4 or below, typeface of child view returns null. why widgets return null? if inflate viewgroup, add parent activity , find widget id, can typeface. i need change typeface of child view if textview, button or edittext. , code below works on android devices running 5 , above not below android 5. public void checkview(view view) { // custom_typeface defined elsewhere in code. // if check of widgets below typeface gettypeface(), // returns null on android devices running 4.4.4 , below. if (view instanceof textview) { textview txt = (textview) view; typeface custom_typeface = createtypefacebasedonexistingstyle(txt.g

My gpcc can not input account and password,greenplum is normal -

it greenplum database down.contact database administrater start it,command center i see gpsmon.log: [internal error gpsmon.c:2124] unable bind udp socket error 98 (address in use) hi,i cant input account password,but gp , gpcc running.

c# - ItemsControl and ItemTemplateSelector in Windows 10 UWP app -

i did little wpf programming long time ago, returning xaml uwp, think should work , cannot figure out why. want use itemscontrol (because want list data, don't want selection) instead of listview control. here resources: <page.resources> <datatemplate x:key="sentmessagedatatemplate"> <textblock text="sent" /> </datatemplate> <datatemplate x:key="receivedmessagedatatemplate"> <textblock text="recieved" /> </datatemplate> <services:messagedatatemplateselector x:key="messagedatatemplateselector" receivedtemplate="{staticresource receivedmessagedatatemplate}" senttemplate="{staticresource sentmessagedatatemplate}"></services:messagedatatemplateselector> </page.resources> here itemscontrol: <itemscontrol itemssource="{binding messages}" itemtemplateselector="{staticresource messagedatatemplatese

MongoDB aggregation projection on collection -

i have collection full of documents this. { "_id" : objectid("5696db8a049c1bb2ecaaa10f"), "resultsets" : [ { "headers" : [ "a", "b" ], "data" : [ [ 0, 1 ] ] }, { "headers" : [ "c", "d" ], "data" : [ [ 2, 3 ] ] } ] } i use aggregation project document just. { c: 2, d: 3 } just wondering best way be. if using mongodb 3.2 $arrayelemat go long way in getting desired aggregation output dealing arrays . run following aggregation pipeline, uses $arrayelemat operator return desired values in new keys: var pipeline = [ { "$match": { "resultsets.headers": { "$in": [ "c", "d" ] } } }, { "$unwind": "$resultsets" }, {

ios - exceptionPreprocess Unknown crash in app -

hi app crashing randomly please find solution here sending crash report. 0 corefoundation 0x24629fef __exceptionpreprocess + 127 1 libobjc.a.dylib 0x32f6dc8b objc_exception_throw + 36 2 corefoundation 0x2462f409 -[nsobject(nsobject) doesnotrecognizeselector:] + 186 3 corefoundation 0x2462d327 ___forwarding___ + 712 4 corefoundation 0x2455ce78 _cf_forwarding_prep_0 + 22 5 uikit 0x27cd8777 -[uiviewanimationstate actionforlayer:forkey:forview:] + 68 6 uikit 0x27ca1489 +[uiview(animation) _defaultuiviewactionforlayer:forkey:] + 86 7 uikit 0x27ca109d -[uiview(calayerdelegate) actionforlayer:forkey:] + 114 8 quartzcore 0x276b7487 -[calayer actionforkey:] + 144 9 quartzcore 0x276ad9f9 _zl12actionforkeyp7calayerpn2ca11transactionep8nsstring + 54 10 quartzcore 0x276ad8df _zn2ca5layer12begin_changeepns_11transactionejrp11objc_object + 128 11 quartzcore 0x276b0b5b _zn2ca5layer6setterej12_cavaluetypepkv + 176 12 quartzcore 0x276b73f1 -[calayer

unity5 - Unity3D hi res image of Canvas -

i have canvas in unity3d images , text. need able turn canvas picture of set resolution, no matter resolution mobile app running on. i creating texture2d of desired picture resolution , use set pixels of images in canvas, not work text. how font well? another thing use camera take picture of canvas, reliant on screen resolution. there way overcome this? ui has option automatically adjust range size assigning minimum , maximum @ source. but perhaps interested in investigating uiautolayout. http://docs.unity3d.com/manual/script-text.html ui-text , paragraph, best fit. assign min size , max size. as each picture want assign maximum resolution has texture or want most. assigning devices , platforms deploy. http://docs.unity3d.com/manual/class-textureimporter.html beware automatic adjustment, misconfiguration causes loss of quality images , text fonts, automatic rescaling. hope can you.

mysql - Unknown Column In Where Clause With Join -

i want join 3 table 1 column sum has compare column here query select *, `e`.`id` `event_ac_id`, sum(case when trans.gift_transaction_status = 1 trans.event_gift_amount else 0 end) amount `tbl_event_category` `cat` left join `tbl_event` `e` on e.event_category = cat.id left join `tbl_organisation` `org` on e.organisation_id = org.id left join `tbl_event_gift_transaction` `trans` on e.id = trans.event_id cat.type ='campaign' , is_approved=1 , e.funding_goal_amount <= amount group `event_ac_id` limit 8 exception (database exception) 'yii\db\exception' message 'sqlstate[42s22]: column not found: 1054 unknown column 'amount' in 'where clause' the filter on aggregate values base on having could need select *, `e`.`id` `event_ac_id`, sum(case when trans.gift_transaction_status = 1 trans.event_gift_amount else 0 end) amount `tbl_ev

rest - HATEOAS Content-Type : Custom mime-type -

i've been trying implement restful architecture, i've gotten thoroughly confused whether custom media-types or bad. currently application conveys "links", using http link: header. great, use title attribute, allowing server describe on earth 'action' is, when presented user. where i've gotten confused whether should specify custom mime-type or not. instance have concept of user. may associated current resource. i'm going make example , have item on auction. may have user "watching" it. include link <http://someuserrelation> rel="http://myapp/watching";title="joe blogg", methods="get" in header. if had ability remove user watching get. <http://someuserrelation> rel="http://myapp/watching";title="joe blogg", methods="get,delete" i'm pretty happy this, if client has correct role can remove relationship. i'm defining relationship. neat thing call on &#

JQuery dialog not opening second time on click -

this code open jquery dialog. works first time (gets opened) not second time (not opening). similar question asked here not working me function loadgridview(id, row) { var dlg = jquery('#edit').load('edit.aspx'); dlg.dialog({ autoopen: false, modal: true, show: 'slide', close: 'slide', width: 400, height: 160, buttons: { "cancel": function() { dlg.dialog("close"); } } }); dlg.dialog("open"); } your dlg scope not exist when try open second time, need store globally // global var hold dlg var dlg; $(document).ready(function() { // element , store in dlg global var scope may retain dlg = $("[id$='edit']"); dlg.dialog({ autoopen: false, modal: true, show: 'slide', close: 'slide', width: 400, height: 160, buttons: { "cancel": functio

Merge two git repos into one without renaming files -

i'd merge 2 repos , b common repo c. , b both have lot of files @ root folder level, i'd create folders , b in root folder of repo c, , put content of each original repo in matching folder. is there without using git mv in process? problem i'm using xcode unfortunately doesn't follow history of renamed files, i'd avoid moves if possible. in effect, i'd merge each repo directly subfolder. subtree merging — simple solution. merge set of files relocating them @ same time under different prefix (a directory). not past history of files. the git-subtree script add command. create synthetic history if originating code has been located in specified directory.

java - Rest Assured - retry request if failed -

example test: @test public void shouldgetrouteslist() { response response = given() .headers("requestid", 10) .headers("authorization", accesstoken) .contenttype(contenttype.json). expect() .statuscode(httpurlconnection.http_ok). when() .get("address"); string responsebody = response.getbody().asstring(); system.out.println(responsebody); logger.info("log message"); } thing response service equals 500 error. it's because of application error , it's application fault add temp. workaround retry .get if service returns 500. thinking if or do-while know it's not clever way. advice solution ? in words - want retry whole test (or .get) if statuscode=!http_ok

Migrating from JDK 1.5.0_06 to 1.8.0_66 - Replacing the deprecated Java JPEG classes -

i migrating application jdk 1.5.0_06 1.8.0_66. in application, there multiple files use com.sun.image.codec.jpeg classes. when try create jar i'm getting below error. error: package com.sun.image.codec.jpeg not exist import com.sun.image.codec.jpeg.*; i referred blog on replacing deprecated java jpeg classes java 7 , errors cleared. i'm getting warning below: warning: jpegimagewriter internal proprietary api , may removed in future release import com.sun.imageio.plugins.jpeg.jpegimagewriter; the problematic code blog: public static void saveasjpeg(string jpgflag, bufferedimage image_to_save, float jpegcompression, fileoutputstream fos) throws ioexception { // image writer jpegimagewriter imagewriter = (jpegimagewriter) imageio.getimagewritersbysuffix("jpeg").next(); imageoutputstream ios = imageio.createimageoutputstream(fos); imagewriter.setoutput(ios); //and metadata iiometadata imagemetadata = imagewriter.getdefaultimagemetad

gorm - Indexing in many to many relationship grails -

i have 2 domains class , class b many many relationship. performance tuning want add indexes in a_id,b_id columns of table a_b(table produced grails). fyi have added indexes query. it looks you'll need create index within database itself. if there option index join table it'd in jointable() , it's not there.

Detecting the SSID of WiFi connected to in MIT App Inventor? -

Image
is there extensions in mit app inventor 2 can ssid of wifi network user connected to? thanks in advance! yes, there wifi extension , ssid block. extension offers more useful blocks use in wireless lan.

Compare password to LDAP stored password -

i creating "change password" form user required enter previous password first, new password (twice). i should compare entered "previous password" 1 stored. my web application uses ldap server store user credentials. password apparently stored using sha. so previous password entered user, digest using sha1, compare it. string oldpass = request.getparameter("oldpass"); string enteredoldpass= app.getinstance().getcipher().cipher(oldpass); string ldappassword= ctx.get("userpassword"); but isn't working, because passwords different. when store "test" in ldap obtain {sha}quqp5cyxm6yctahz05hph5gvu9m= when calling .get("userpassword") , whilst a94a8fe5ccb19ba61c4c0873d391e987982fbbd3 when hashing "test" myself. what doing wrong here? seems step missing since result purely hex, while 1 ldap ascii. tried converting string hex (using string hex online converters) result still differnet.

html - Serializing the complete Javascript state of a website including Closure/Hidden scopies? -

i save "snapshot" of webpage should remain in "interactive" state -> javascript state has saved , restored. example showing issue i'm trying solve: given webpage executes following script in global scope: function f(x) { return function() { return x; } } var g = f(2); i'd save both function f (more or less trivial) , variable g (which closes on x f invocation) file , restore state of website later. as far figure out seems impossible using "web" technologies (ie. permissions webpage has). i'm therefore guessing i'll have implement browser addon achieve this. does exist? starting point? noticed firefox session restore similar, know if reuse mechanism? if not feasible implement "debugger" style addon? there simpler solutions? javascript objects hold onto dom/other native objects. native objects have hidden state , can entangled global browser state or addons. so real way can think of run browser in vm , sn

php - my Sql query to select 2 records per each category -

i have 2 tables. 1. news table 2. category table. in news table have id, title, category id in category table have id , category name. in news table there many news items multiple news items each category. what need select 2 record per each category news table, need join 2 tables, can name of category category table. tried using below query select * ( select news.id, news.fk_lookups_category, lookups_category.name, news.title, news.description,news.datetime,lookups_category.priority news join lookups_category on news.fk_lookups_category=lookups_category.id news.ispublished='1' , news.datetime >= ('today' - interval 7 day) order datetime desc ) newitem order priority

javascript - Change variable or call funtion from a component from an other component -

this case : i have component : @component({ selector: 'home', templateurl: './administration.html', directives: [directivetest] }) export class administration { hello : string; constructor(private http: http) { } ngoninit() { //init stuff here } callme(value) { alert("call you" + this.hello ); } } and template : <h3>test administration </h3> <directivetest></directivetest> this directive : @component({ selector: 'directivetest', templateurl: './directivetest.html' }) export class directivetest{ klickme() { //call administration function (callme(value)) or change value???????????? } } is there way change variable or call function "directive" component, what should : first make service ( component without selector) put data , related methods in service. inject service in both component.

R: How to use approx in more than one dimension (multidimensional interpolation)? -

this should no hard, searched lot , did not find solution far... i dealing scattered data where y = f(x1,x2,x3,..., xn) i create lookup function, gives me exact known values of y when entering vector x in data set, linearly interpolates when vector x not in data set. basically approx() , higher number of dimensions. to ease tryouts, here data: y<-rnorm(27) x1<-seq(1,3,1) x2<-seq(10,30,10) x3<-seq(100,300,100) df<-expand.grid(x1,x2,x3) df<-cbind(y,df) names(df)<-c("y","x1","x2","x3") # task create function # fun(x1,x2,x3) --> interpolated y # expected output example: # fun(1,10,100) --> -0.89691454 # fun(1.5,10,100) --> -0.3560327

Case Statement in Where Clause in SQL Server -

good day! i have query using sql gives result set of sales per tenant. now, want final result set shows top 5 , bottom 5 in terms of sales (may flexible, sets 5 example) i used rank function ranking per sales, , able desired output displaying top , bottom tenant based on sales. here's part of code stored procedure @rankedby int = 5 select *from ( select #temptable5.*, 'bottom' 'rankname' , rank() on (partition business order sales ) rank #temptable5 ) rs rank <= @rankedby union select *from ( select #temptable5.*, 'bottom' 'rankname' , rank() on (partition business order sales desc ) rank #temptable5 ) rs rank <= @rankedby order business, rankname desc ,rank and result set tenant business sales rankname rank sample a1 food 1500 top 1 sample a2 food 14

php - Installing ssh2 on xampp -

i trying install ssh2 on xampp xampp version : 3.2.1 php version : 5.4.19 until have used following step install: download , copied libssh2.dll file c:\windows\system32 php_ssh2.dll , php_ssh2.pdb files in "ext" (e.g c:\xampp\php\ext ) folder; remove ; line extention:php_ssh2.dll in php.ini. restart xampp but getting error in log file: unable load dynamic library php_ssh2.dll can me this? a couple of things may have missed :- you need thread safe (-ts-) version of php_ssh2 you need make sure 32 or 64 bit version match php/apache and not match os you need version of php_ssh2 matches php version i.e. 5.4 having here download there 32bit version of ssh2 compiled vc9 available php5.4, have ensure have 32bit version of xampp installed. oh , final note, you not need, , should not do , copy of php_ssh2.dll c:\windows\system32 remove dll folder. php knows load extensions , putting files in c:\windows\system32 confuse things whe

linux - configure virtualbox vms to use proxy settings of host -

i have 6 vms testing purpose in virtualbox. have proxy @ work , not have proxy @ home. switch settings , internet inside vms. there has way vms adapt system settings of host, or wrong? google didn't quite yet. found article microsoft loop interface, nothing linux. way use linux since october, new operation system some system details: host: arch-linux gnome shell , virtualbox 5.0.12 guests: ubuntu, win7, win8, centos6 nat bridge internet purpose , host-only adapter internal network anybody experience in matter can me? i had same problems had. wanted configure vm's on corporate proxy. googling did not me either. after lots of trials , errors, managed connect internet. what did configure proxy settings in guest os. i using ubuntu guest os , easy configure proxy settings follows: sudo gedit /etc/apt/apt.conf it opens following file: acquire::http::proxy "http://username:pass@myproxyaddress:port/"; acquire::https::proxy "https://us

python - Tensorflow network diverges if reading/preprocessing is done on cpu -

i have code reads images tensor record, preprocesses them (cropping, apply random hue/saturation etc., through tensorflows own methods) , uses shuffle_batch_join generate batches. tf.variable_scope('dump_reader'): all_files = glob.glob(dump_file + '*') filename_queue = tf.train.string_input_producer(all_files, num_epochs=epochs) example_list = [read_tensor_record(filename_queue, image_size) _ in range(read_threads)] return tf.train.shuffle_batch_join(example_list, batch_size=batch_size, capacity=min_queue_size + batch_size * 16, min_after_dequeue=min_queue_size) this works , leads converging network when placing operations on gpu. however, right bottleneck of code , i'd speed placing on cpu wrapping block in with tf.device('/cpu:0'): . have faster iterations (about 1/5th), network diverges after 10 iterations, leading loss of nan. when v

android - How to create google play app with my website? -

i want website should act google play store app. for example, go to-> hytoz , hytoz app both source same. when open app, website shown app , after click or close, it's asking confirm application. how can make this? i'm not android person. i'm in php. first of all, making android app isn't 1 click process. make simple android app, can make use of android webview . since you're new android, i'd suggest take courses on basics of android . you've mentioned you're familiar php. can better try phonegap , basics of html5, css3 , js, can build app. also, needs back, close can done it, , moreover, it's cross platform, can ship other operating systems too. good luck.