Posts

Showing posts from August, 2011

winforms - vb.net unwanted richtextbox resizing -

Image
i have 2 richtextboxes of exact same size located on form. however, when run it, one's height reduces. there other controls around leaves weird space. causes that? form in design tab form once run it i've tried constraining control "same height" button, i've created new richtextbox, keeps on happening. it depends on computers, on screens unusual resolutions box correct size. thank you its because scroll bar coming in picture. in order uniformly set positions , sizes of richtextboxes use docking or anchoring

symfony - Retrieve session value and pass to an entity attribute -

Image
i want retrieve quantity each item store in session , store in database. how retrieve quantity in session , passed quantity attribute of article entity during database persistence? for example article: (id 4, quantity 2). store 2 in quantity attribute of article entity. tried : $article->setquantity($session->get('panier')); i have error: an exception occurred while executing 'insert article ....... {"4": "2"} notice: array string conversion /** * @route("/payment", name="payment") */ public function paymentaction(request $request) { $session = $request->getsession(); $produits = $this->getdoctrine()->getmanager()->getrepository('appbundle:stock')->findarray(array_keys($session->get('panier'))); $commande = $session->get('commande'); var_dump($session->get('panier')); if ($request->ism...

R: 2-way repeated measures ANOVA & pairwise.t.test -

using example proposed field in discovering statistics using r (pag 561) 1-way repeated measures anova: participant <- gl(8, 4, labels = c("p1", "p2", "p3", "p4", "p5", "p6", "p7","p8" )) animal <- gl(4, 1, 32, labels = c("stick_insect", "kangaroo_testicle", "fish_eye", "witchetty_grub")) retch <- c(8, 7, 1, 6, 9, 5, 2, 5, 6, 2, 3, 8, 5, 3, 1, 9, 8, 4, 5, 8, 7, 5, 6, 7, 10, 2, 7, 2, 12, 6, 8, 1) longbush<-data.frame(participant, animal, retch) pairwise.t.test(longbush$retch, longbush$animal, paired=true, alternative="two.sided", p.adjust.method="none") the result is: stick_insect kangaroo_testicle fish_eye kangaroo_testicle 0.00202 - - fish_eye 0.00094 0.92007 - witchetty_grub 0.22673 0.29867 0.40204 change bit 'pairw...

Installing wordpress on Azurewebsites running Django -

Image
we running django application on azure websites. install blog on www.example.com/blog. we uploaded wordpress root directory, www.example.com/blog. django url handler stopping request subdirectory , issuing 404 page. how solve issue? it sounds want deploy multiple apps (a wordpress in php & django in python) on same azure website instance. so steps below, please try. first of all, please check php runtime option of application settings whether enabled on azure portal, figure below, , refer offical document configure php in azure app service web apps know more details. to configure new entry of virtual applications , directories on azure portal figure below, similar other thread how deploy multiple apps on azure webapps can refer to. finally, can upload wordpress installation files path site/wwwroot/blog , install normally. hope helps.

python - DataLossError: Unable to open table file error in TensorFlow -

i have been studying while kaggle link predicting fraud tensorflow . dataset releated fraud . commented on line 33 , when try rewrite codes saving/checkpointing gives error. datalosserror: unable open table file c:\users\mert\best_model.ckpt: data loss: file short sstable: perhaps file in different file format , need use different restore operator? [[node: save_5/restorev2_51 = restorev2[dtypes=[dt_float], _device="/job:localhost/replica:0/task:0/cpu:0"](_arg_save_5/const_0_0, save_5/restorev2_51/tensor_names, save_5/restorev2_51/shape_and_slices)]] at first created empty file right location called best_model . have taken error after converted empty best_model.txt file best_model.ckpt . could me please ? in advance. empty files not valid tensorflow checkpoint files. try saving checkpoint training model first.

java - Problems with generating another "Joke" Statement -

currently, creating simple program tells jokes users. bot: how can 4 suits dollar? type reveal view answer you: reveal bot: buy deck of cards. giggle giggle bot: wish continue? yes or no? you: yes bot: call boomerang won't come back? type reveal view answer that intended script. however, faced problem: bot: wish continue? yes or no? you: yes bot: wrong >:d the bot print out "wrong" instead of generating joke. here code: public class newclass { public static void main(string[] args) { int randomnumber; string userinput; string[] jokesanswer = {"snowballs! haha ", "a stick!!! :d", "a pork chop.", "a piano! hehe ", "a dead centipede!! xd", "at crystal ball. *chuckle chuckle*", "a conversation. teehee", "buy deck of cards. *giggle giggle*"}; string[] jokes = {"what difference between snowman , snow...

user interface - how to use scrollbar in kivy python -

Image
can tell me how use scrollbar in code? , secondly, there way align labels , textinput text inside textinput visible no matter how input there. here alignment means: if there 100s(hundreds or thousands) of textinputs , text inside textinput should visible. when giving (spacing = 50) in code, after 20s input, text not visible properly. in advance. from kivy.app import app kivy.uix.tabbedpanel import tabbedpanel kivy.uix.boxlayout import boxlayout kivy.properties import stringproperty kivy.uix.textinput import textinput kivy.uix.checkbox import checkbox kivy.lang import builder rows = ['goc', 'coc', 'eee', 'abs' , 'kju' , 'iop' , 'nmg', 'gty', 'jkio', 'dbkgcd' , 'udbcbjkb'] builder.load_string(""" <test>: do_default_tab: false tabbedpanelitem: text: 'page1' table: padding: 50, 50, 50, 50 orientation: 'vertical...

structuremap4 - Get context for log4net ILog with StructureMap? -

i'm trying inject log4net.ilog interface classes replace typical method of private readonly ilog logger = log4net.logmanager.getlogger(typeof(myclass)); i'm trying figure out way register ilog replicates above. this question not duplicate of existing question: how output context class using log4net service? as i'm using structuremap 4, , objectfactory gone , icontext interface seems have been simplified. i can do for<imyclass>().use(x => new myclass(logmanager.getlogger(typeof(myclass)))); but i'd configure ilog instead of needing logmanager, requires changing concrete type in 2 places

c++ - overloading operators of builtin types -

this question has answer here: can overload operators built-in types int or float? 2 answers program of power operator in c 1 answer while writing code syntactic sugar implementation of power-operator known in python , other languages, operator definition ok, expression operand(s) matching operators signature yields error, operators never defined. there way (compiler option) implement new operators builtin types? #include <iostream> #include <cmath> template<typename t_float> struct powertmp { t_float value; }; powertmp<double> operator*(double f) { return {f}; }; double operator*(double l, powertmp<double> r) { return std::pow(l, r.value); }; int main() { std::cout << 10.5 *powertmp<double>{2.0} << '...

angular - Change href to routerLink for dynamically loaded content in angular4 -

i'm creating admin interface site can write article. in editor, can create links end a[href] in html code of article. when load article , insert content page, links still using href (as should) means internal links reload full page , don't use angular router. how "compile" dynamic content tell angular transform "href" "routerlink" ?

Getting a 301 error when trying to php curl -

for first time i've become desperate enough issue sign here. i'm trying write webservice curl others can upload info server. have no influence on code of "customers" , hence url call must must muuuust http://..../update however, results in "301 - permanently moved" error until add / @ end. adding / simple enough solution if wasn't fact cannot change url. in other words, has work without / my support team suggested try put redirect in .htaccess , did , add / @ end, still 301. in .htaccess rewriteengine on rewritebase / rewriterule ^update$ update/ [r] so, code calls: error_reporting(e_all); $ch=curl_init(); $url="http://www.virtualairlines.eu/update"; $cleaned_params='(some xml)'; curl_setopt($ch, curlopt_post, 1); curl_setopt($ch, curlopt_postfields, $cleaned_params); curl_setopt ($ch, curlopt_returntransfer, true); //curl_setopt($ch, curlopt_followlocation, true); curl_setopt ($ch, curlopt_url, $url); $ret = curl...

reactjs - visual studio code *.jsx file emmet snippet -

i cannot emmet snippet work on jsx files on vs code. when write jsx html code want div give me cannot work when changed emmet config files "jsx": "html". you should put in user config file follows. "emmet.includelanguages": { "javascript": "javascriptreact" }

Valid OAuth redirect URIs for facebook - Django Social Auth -

Image
i referring tutorials implement django social-auth , hace implemented twitter , google+ . but, in case of facebook , not seeing "valid oauth redirect uris" has provided facebook. assume new developer console of facebook has new field. by leaving field empty, still able login not getting relevent details fb. might because of "redirect uri". i followed below tutorials tutorial 1 tutorial 2 i guessed " http://localhost:8000/oauth/complete/facebook/ " uri looking @ google+ , twitter pattern still not getting email id of user. can please confirm redirect uri has been used them facebook in django app

Office-Js Add-in Debugging with Angular-CLI and F12chooser: No map files shown -

Image
last time developing office add-ins using angular webpack. now want try angular-cli . all works expected, except 1 thing: f12chooser debugging it used take advantage of map files, therefore debug add-ins f12chooser . don't see them. please see screenshots below (chrome debug cosole compared f12chooser). both same app, served https. do need make changes in default angular-cli settings ask, again, how come same app looks different in debugging tools, can't make sense of. i'm using angular-cli v1.3.0-rc1 way. it not answer/solution per se, workaround achieve debugging . i've ended adding "add-in" manifest file in office 365 (word online) , debug there. see screenshots below. adding localhost served app-manifest fine here, since debugging, works. once open devtools, try search name baseframename (under 'sdx_ow_iframe') in sources section. angular-cli initialized webpack session resides there , you'll see ts ...

javascript - I'm having trouble getting my JS variable display within my HTML -

<td id = "customername" style="font:12px arial,helvetica,sans-serif;color:#000001;padding:3px 0px 3px 10px">dear&nbsp;<script>document.getelementbyid("customername").innerhtml = custname</script>,</td> </tr> <tr> i'm creating email template company work for. can't seem js variable custname display within html snippet id'd customername table i've posted above. edit: here full html code, variable within javascript program using suitescript api /** * @napiversion 2.x * @nscripttype usereventscript * @nmodulescope sameaccount */ define(['n/email', 'n/record', 'n/search'],function(email, record, search) { function beforeload(scriptcontext) { } function beforesubmit(scriptcontext) { } function aftersubmit(scriptcontext) { var fromid = 450103; // internal id var recordtosend = record.load({ //fake...

java - Jstack:At which point is Amazon redshift jdbc driver is stuck? -

i executing 7 parallel queries amazon redshift , process output. code cease progress once in while. ran jstack , noticed 7 threads stuck @ epollwait:- "thread-124" daemon prio=10 tid=0x00007fc3b0080800 nid=0x72e1 runnable [0x00007fc33868c000] java.lang.thread.state: runnable @ sun.nio.ch.epollarraywrapper.epollwait(native method) @ sun.nio.ch.epollarraywrapper.poll(epollarraywrapper.java:269) @ sun.nio.ch.epollselectorimpl.doselect(epollselectorimpl.java:79) @ sun.nio.ch.selectorimpl.lockanddoselect(selectorimpl.java:87) - locked <0x000000078ec691c8> (a sun.nio.ch.util$2) - locked <0x000000078ec691b8> (a java.util.collections$unmodifiableset) - locked <0x000000078ec690a0> (a sun.nio.ch.epollselectorimpl) @ sun.nio.ch.selectorimpl.select(selectorimpl.java:98) @ com.amazon.jdbc.communications.inboundmessagesthread.run(inboundmessagesthread.java:309) looks 7 threads(although ...

How to set display value in typeahead.js -

i set twitter typeahead display description different key value. $('#scrollable-dropdown-menu .typeahead').typeahead({ hint: true, highlight: true, minlength: 1 }, { name: 'searchproduct', source: bloodhoundds.ttadapter(), displaykey: 'descr', valuekey:"productid", limit: 20 }); how can preselect display value if have productid i've try $('.typeahead').val("2200718"); and $('.typeahead').typeahead('val', "2200718").trigger('change'); all can see in field id value instead description.

How to enable Tomcat debugging -

i have tomcat installed on server , want able check if debuggin disabled/enabled. searched everywhere , found instructions below: 1. open user interface , navigate administration > system management > hosts > ui server. 2. select "use local settings" , check boxes enable tomcat logging , enable tomcat debugging. 3. save changes , restart services when prompted. the problem is not clear whether need install additional admin console access features. appreciate or pointers in right direction. thank in advance to enable debugging in tomcat can use jpda. jpda stands java platform debugger architecture , it's tool creating debugging applications. enable debugging, need specify 2 things. 1 transport mechanism move bits between debugger , debugee , other address debugging connections accepted. depending upon location of debugger , debugee transport mechanism different. export transport , address variables shown below. export jpda_address=8000 export...

java - Log4j2 use XInclude from within an executable jar -

i have 2 webapps , executable jar (3 in total) using similar log4j2 set up. all 3 apps following <configuration status="off" xmlns:xi="http://www.w3.org/2001/xinclude"> <properties> <property name="logfile-name">logname.log</property> <property name="logfile-folder">/home/${env:puid}/utm/logs</property> <property name="console-pattern">%d [%-6p] %c{1}.%m(%l) - %msg %n</property> <property name="logfile-pattern">%d [%-6p] %c{1}.%m - %msg %n</property> <property name="max-log-size">100 mb</property> <property name="max-log-keep">12</property> <property name="rolling-interval">1</property> </properties> <xi:include href="/opt/app/jtm/conf/jtm-log4j-appenders.xml" /> <xi:include href="/opt/app/jtm/conf/jtm-log4j-loggers.xml" /...

Aerospike Java Async library seems stuck -

i executing udf using aeropike async client. client has been initialized as:- try { asyncclientpolicy.maxthreads = 40; asyncclientpolicy.asyncmaxcommands = 20; asyncclientpolicy.maxsocketidle = 13; asyncclientpolicy.asyncmaxcommandaction = maxcommandaction.block; asyncclientpolicy.asyncselectorthreads = 7; asyncclientpolicy.asynctaskthreadpool = executors.newfixedthreadpool(20, new threadfactory() { public final thread newthread(runnable runnable) { thread thread = new thread(runnable); thread.setdaemon(true); return thread; } }); } so have 20 threads handle callbacks. after while see program not doing progress, indicating deadlock/starvation. jstack gives me following result:- java.lang.thread.state: waiting (parking) @ sun.misc.unsafe.park(native method) - parking wait <0x000000064048f338> (a java.util.concurrent.locks.abstra...

reference - Idiomatic way to determine if an object has been destroyed -

i've been trying find better way accomplish determining if particular object has been destroyed ( destroy(...) ). way i've been doing so: class c { bool valid = false; this(){ valid = true; } } then do: c c = new c; c.valid.writeln // true destroy(c); c.valid.writeln // false if(c !is null && !c.valid) c = null; i don't see wrong (perhaps can tell me else wrong it) other takes memory , requires putting valid = true; in each constructor (and ugly because uses variable destroyed object). best case, of course, have magical function can tell if object valid or not valid(c); // true / false . so question if there standard way determine if object has been destroyed (like, gc hasn't collected memory location , valid object sitting in spot without reference vtable) , pointer virtually dangling? if there isn't way secondary question: method dangerous in foreseeable way? previously, made sure each reference object -> b there reference...

gcc - Distutils partially ignoring CC environment variable when building python extension -

i trying install subprocess32 python module ( https://github.com/google/python-subprocess32 ) , having issues distutils. module includes c extension has built, when run either pip install . or python setup.py install following output: ... creating build creating build/temp.linux-x86_64-2.7 /non/existent/path/gcc -pthread -fpic ... -c _posixsubprocess.c -o build/temp.linux-x86_64-2.7/_posixsubprocess.o unable execute '/non/existent/path/gcc': no such file or directory obviously distutils using wrong path gcc reason. tried manually specify right path gcc using export cc=/correct/path/to/gcc , output: building '_posixsubprocess' extension creating build/temp.linux-x86_64-2.7 /correct/path/to/gcc -fpic -fno-strict-aliasing -g -o2 ... -c _posixsubprocess.c -o build/temp.linux-x86_64-2.7/_posixsubprocess.o /non/existent/path/gcc -pthread -shared ... build/temp.linux-x86_64-2.7/_posixsubprocess.o -o build/lib.linux-x86_64-2.7/_posixsubprocess.so unable execute ...

indexing - Google Index returns not safe results on my website -

i have website joomla based, , persons start saying website redirecting "not safe contents" when searched on google or bing, made checks necessary , found had 100 files .htacess redirects non safe results. i did this: point 1. made backup of joomla installation , databases computer. point 2. removed these databases, , public_html site point 3. when searched google, still had same problem, went to: https://www.google.com/webmasters/tools/googlebot-fetch (where reindexing of platform done, , way bot changed view site); point 4. check entire installation locally, modules , theme folders in index.php there might link text captcha, htaccess in installations , delete everything. at first solved now, robots.txt redirects non safe content. user-agent: * allow: /index.html allow: /style.css disallow: / at moment, can see should allowed access 2 files. how can avoid google index website non-safe content, after fetching site on webmasters tools? thanks solve...

angular2 template - update table data based on combo box selected value angular 2 -

<foo-combo-box (change)="changeselecteduser($event.target.value)" ></foo-combo-box> <foo-table [colheads]="getcolheads()" [data]="[]"> </foo-table> i new angular 2. able selected value, based on value want updated table data. how bind service? have changeselecteduser method in component. have tried call backend service using selected user value, didn't work suggestions please

windows - PHP SQLSRV Error using machine account -

i using sqlsrv function using windows authentication using machine account default. how can change it? want run using homesbuild\john.davis i running php 5.3.10 on wamp server 2.2 error message: connection not established. array ( [0] => array ( [0] => 28000 [sqlstate] => 28000 [1] => 18456 [code] => 18456 [2] => [microsoft][sql server native client 11.0][sql server]login failed user 'homesbuild\kkk-454-iah05$'. i had configure wamp server services run different account.

angular - Cannot read property 'initialized$' of undefined -

i'm using ngui/map on angular/node application. i'm receiving error mentioned above when try load map static page. flow follows. user opens side nav togglefunction , clicks faq link directs faq page via routerlink closes side nav togglefunction. if user opens sidenav , clicks logo return map, side nav not toggle , map not load , error thrown. to sum up, if side nav open, , company link clicked, supposed close , route map, instead, stays open , throws initialize error , loads black screen side of side nav. if click again, map loads. // here logic side nav <div id="sidenavigation" class="sidenav" [ngstyle]="{width: sidenavactive ? '250px' : '0'}"> <a class="navbar-item" routerlink="/" [ngstyle]="{display: sidenavactive ? 'block' : 'none'}" (click)="togglesidenav()" id="atlastext">company</a> <a class="navbar-item" router...

css - Joomla Virtuemart category mobile layout -

i trying resolve problem day , found solution, not imagine , have, reaching greater , smarter minds here :) i have web shop showing 1 product per row on mobile layout, here: enter image description here but see 2 in row. now, problem: in configuration of virtuemart, showing products per row set 3, because see 3 products per row on computer , desktop devices (also laptops , bigger tablets), ok , works fine. but on mobile devices, in template mobile.css set show 1 in row.so searched , found code .category-view .vm-col-3 that set width: 100% when insert 50% this: enter image description here i insert clear: none and float: left nothing happened. figure out have find .row code, because see 3 products in row set in configuration, smaller , sorted this, still not like have. then, found line sets row: .category-view .browse-view .row and inserted line: clear: none; float: left; width: 50%; with this, results closest, still not need. when ends 9 products, next 3...

python - django rest framework user prefix in serializers -

models.py address_choices = (("home":"home"),("shop", "shop")) class address(models.model): address_type = models.charfield(max_length=128, choices=address_choices) location = models.charfield(max_length=128) forms.py class addressform(forms.modelform): class meta: model = address views.py home_address = addressform(prefix="shop") shop_address = addressform(prefix="home") can use prefix in serializers used in forms above serializers.py class addressserializers(serializers.modelserializer): class meta: model = address views.py home_serializer = addressserializers(prefix="home") shop_serializer = addressserializers(prefix="shop") as have current model address it's enough have 1 serializer that. can specify {'address_type': 'home'} or {'address_type': 'shop'} when using that. if want have multip...

html - Adjust the width of an element based on the width of another element -

Image
please check solution here: https://stackoverflow.com/a/41686102/4180447 the above solution can used implement editable dropdown (select) element in angular. however, width of element assumed fixed. now, implementing responsive design, , need way adjust width of element based on width of element. basically, implementation uses 2 elements , places them on top of each other. 1 element select element id ends _sel , , other text element id ends _disp . text element must narrower drop-down element drop-down arrow visible. the width of text element must 18px less width of select element. is there way adjust height of text input 18px less size of select element? see snapshot below , related code clarify situation: html: <div class="select-editable stop-wrap" style="width: 265px; border:none"> <select type="text" id="exterior_finish_sel" editable-dropdown="exterior_finish" name="exterior_finish_sel"...

php - Regex not giving the results expected -

so, got html tables need extract values, did regular expression values wanted. the html tables can in these 2 formats: <td height="20" style="width:59px;height:20px;">1</td> <td style="width:212px;">mendes, paulo [aa]</td> <td style="width:99px;">39</td> <td>8</td> <td style="width:85px;">$10,000</td> </tr><tr height="20"><td height="20" style="width:59px;height:20px;">2</td> <td style="width:212px;">campos, miguel [ac]</td> <td style="width:99px;">37</td> <td>6</td> <td style="width:85px;">$5,000</td> and other one <td>1</td> <td>mendes, paulo [aa]</td> <td>39</td> ...

Ajax Woocommarce Add to cart button click append html content to a Div jquery -

in woocommarce there way add current products image, price etc, append div( ajax or jquery) ? note: added codes function.php not reload page after product added cart. remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 ); add_action( 'woocommerce_single_product_summary', 'woocommerce_template_loop_add_to_cart', 30 ); also place (div) want append current products attributes working slider mean want every time add item cart should display in slider full function slide show. have tried fragment , fragment contents adding slider div slider div not functional. add_filter('add_to_cart_fragments', 'woocommerce_header_add_to_cart_fragment'); function woocommerce_header_add_to_cart_fragment( $fragments ) { global $woocommerce; ob_start(); <div class=” et_updater_ajx”> //codes bind slider content elements cart items </div> $fragments['div.et_updater_ajx'] = ob_get_clean...

sharepoint - SPEmailEvent Receiver not working -

we have created custom spemail event receiver in sharepoint 2010 1 of document library in order achieve lazy approval, if activate our feature incoming email not working(oob), if deactivate feature receiving mail. business logic has been written in event receiver code. tried restarting timer service did iisreset etc no use. does 1 had issue earlier or can please me in figuring out might cause issue.

cmake - Renaming `CMakeLists.txt` -

is there way rename various cmakelists.txt more meaningful? it can quite distracting have bunch of them open @ same time when working on bigger project contains several cmake projects. no, it's not possible. name meaningful, used it. rationale: cmake must find files, common choice related files have common name , cmake in every folder. make (makefile) , autotools (e.g. makefile.am) chose similar. alternative approaches configure file name project wide (your problem remain) or indicating file names in file in parent directory (error prone).

Is it possible to not generate package-lock.json with npm 5? -

i've updated npm it's latest version performance upgrade. since company hasn't updated globally, don't want usage of package-lock.json. i ignore in git workflow adding package-lock.json .git/info/exclude . still used npm when installing or updating dependencies. so how can tell npm not use it? disactivate package-lock.json usage globally to disable globally, you'll have set package-lock false in ~/.npmrc . can using: npm config set package-lock false this allow use npm@5 performance without bothering package-lock.json. though package-lock.json has many benefits according npm doc , , may consider using it. disactivate package-lock.json usage per command according npm-cli doc , can use --no-package-lock options install command: npm install --no-package-lock any-lib and according this question , existing package-lock.json not taken care of.

Error inflating class android.support.design.widget.NavigationView when adding Drawer Navigation -

there many answers on stackoverflow error , have read many of them none helped me. following tutorial drawer navigation. have tried appcompat , design version 23.4.0, 23.1.1, 23.2.0 , minsdkversion 21, 19 nothing changed. i have added app:itemtextcolor="@color/colorprimary" navigationview . here gradle: apply plugin: 'com.android.application' android { compilesdkversion 23 buildtoolsversion '25.0.2' defaultconfig { applicationid "com.example.nishant.book" minsdkversion 21 targetsdkversion 23 versioncode 1 versionname "1.0" testinstrumentationrunner "android.support.test.runner.androidjunitrunner" } buildtypes { release { minifyenabled false proguardfiles getdefaultproguardfile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { compile filetree(include: ['*.jar...