Posts

Showing posts from April, 2011

twitter - Zipkin is not nesting parent trace to its child -

we using finagle stack , taught of adding zipkin tracing our micro-services. i able see our tracing happening parent finishes before child. i have opened issue here: https://github.com/openzipkin/docker-zipkin/issues/100 any appreciated. i recording wrong annotation i.e client instead of server. just simple change did trick. trace.traceservice("function1","test") sample working zipkin example: https://gist.github.com/akhilj876/3e38757c28d43924f296dd2d147c0bd9#file-zipkintracing_example-l34

algorithm - Can an ant walk towards or away from a point with a polygon obstacle? -

Image
given polygon s , point p lies outside s, imagine ant can follow straight line towards or away p. for shapes (fig. 1), there choice of p such ant can move unobstructed in @ least 1 of 2 possibilities: towards (t) p, or away (a) it. condition corresponds ray cast p intersecting perimeter of s 0 or 2 times. however, same shape (fig. 2) there may points lead blocked (b) regions, ant bump polygon whichever direction tries move in. yet other shapes (fig. 3) there may no choice of p leads no blocked regions. having blocked regions corresponds rays cast p intersect perimeter of s more 2 times. is there algorithm determines whether p exists satisfies condition given polygon s? if such points exist, can determine region contains them? find concave corners of polygon obstacle. each corner, extend 2 edges infinitely. sector between these 2 rays, , (as nico schertler pointed out) point-reflected region of sector, define point must obstacle not hide corner form point's rays

What are the roles of each of these when creating IONIC application? -

i kind of confused , know (not ambiguous or opinionated) roles of these programming languages when creating ionic mobile application 1: ionic 2: angularjs 3: c# 4: asp.net mvc how role contribute on creating ionic application. if have built app else did use , why? ionic framework hybrid mobile development, framework7 , has nothing back-end , server languages c# or architectural pattern mvc framework.ionic build on html5, css , javascript , angularjs, of them used design , front end purposes. but u can use c# , mvc backend, example can create webapi communicate front end.

jsf - PrimeFaces ajax don't work -

why, when use ajax = true action button primefaces not work? whenever happens me, has same situation? <p:commandbutton action="#{usuariobean.insert()}" value="gravar" icon="/resources/img/accept.ico"> <p:confirm header="confirmação" message="tem certeza??" icon="ui-icon-alert"/> </p:commandbutton> <p:confirmdialog global="true" showeffect="fade" hideeffect="fade"> <p:commandbutton value="sim" type="button" styleclass="ui-confirmdialog-yes" icon="ui-icon-check"/> <p:commandbutton value="não" type="button" styleclass="ui-confirmdialog-no" icon="ui-icon-close"/> </p:confirmdialog> in case, need 2 things , none work. you should review "action" attribute in commandbutton ( action="#{usuariobean.insert}"

celery - What methods are available in the Flower HTTP API? -

i want use flower http api monitor celery, can't seem find documentation of available rest methods, other few examples on readme. can point me in right direction, or reading source code option? all http api methods documented , available @ http://flower.readthedocs.org/en/latest/api.html

java - How to add two int array values together? -

i trying add 2 int arrays sum. first array contains 0000000000000000123456789 , second array contains 0001111111111111111111111. sum should 1111111111111234567900. i'm trying without biginteger or bigdecimal. for(int i=0; i<number1.length;i++){ add= number1[i]+number2[i]; if(plus>=10){ sum[i-1]+=add/10; sum[i] = add%10; }else{ sum[i]=add; } } the output produced @ moment 00011111111111112345678100. how can fix code 8 becomes 9? this kinda works. can think of couple of cases break, if arrays {9,9,9} , {9,9,9}, result {9,9,8} instead of {1,9,9,8}. it's minor fix being left activity reader. public static void main(string []args){ int[] number1 = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,3,4,5,6,7,8,9}; int[] number2 = {0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}; int carry = 0, sum = 0; int[] result = new int[number1.length]; (int = number1.length - 1; >= 0 ; i--) {

powershell v2.0 - I would like to read content of txt file ends it with ( ; ) semi-colon character -

i have txt file has 50 long character in line1 but, want read first 10 11 or less character , end on semi-colon. basically, want characters before semi-colon. first.txt 1234567891;45416564653afsd second.txt 124562;455466asdfa appreciate anyone's help.. the following returns portion of each line input file file before first ; . if there no ; entire line returned. get-content file | foreach-object { ($psitem -split ';')[0] } to give sense of elasticity of powershell, can rewrite following more terse form, utilizing built-in aliases (though it's better verbose , avoid aliases in scripts ): gc file | % { ($_ -split ';')[0] }

c++ - How to use gnu autotool to build a qt project -

solved compile program following setting. new autotool , want build qt project autotool. project structure root/bootstrap root/configure.ac root/makefile.am root/src/ ----root/src/firsttry.cpp ----root/src/firsttry.h ----root/src/makefile.am root/src/firsttry.cpp #include <qapplication> #include <qlabel> int main(int argc, char *argv[]) { qapplication app(argc, argv); qlabel *label = new qlabel("hello!world! orz..."); label->setwindowtitle("first qt!"); label->resize(200, 50); label->show(); return app.exec(); } root/src/makefile.am ... add @ bottom # qt project stuff moc-%.cc: %.h @moc@ -o$@ $(defs) $(default_includes) $(includes) $(am_cppflags) $(cppflags) $(moc_cppflags) $< ui-%.h: %.ui @uic@ -o $@ $< qrc-%.cc: %.qrc @rcc@ -o $@ $< root/configure.ac added inside configure.ac file # check qt libraries pkg_check_modules(qt, [qtcore, qtgui, qtnetwork], [], [

javascript - How can I search in a big data collection on server side without publishing everything in meteor -

i'm newbie meteor. need build text search system typeahead-like feature using meteor js. collection on server side has 1 million words, it's impossible publish them (my page take forever load i'm assuming collection large sync takes forever). however, each time, system needs search within whole collection. has suggestions how this? lot this server logic. have calculate stuff server method: meteor.methods({'mygreattextsearch': (someparameters) => { // text aggregation here return stuff }) you can 'stuff' on client with meteor.call('mygreattextsearch', someparameters)

python - Text formatting on pandas pivot table -

i creating dataframe , converting dataframe pivot table. text , column headers in pivot table aligned center in result. set text justify "left". please ? i've tried df.to_string(justify = 'true') throws attribute error "'unicode' object has no attribute 'columns'" this dataframe: df = dataframe({'customer': customercol,'title': titlecol,'count':countcol}) table = pivot_table(df,index = ['customer','title'],values='count') i think need set parameter justify left in to_string : import pandas pd df = pd.dataframe({'customer': ['ann green', 'joseph smith', 'ann green'], 'title': ['ms', 'mr', 'ms'], 'count':[4, 6, 7]}) print (df) customer title count 0 ann green ms 4 1 joseph smith mr 6 2 ann green ms 7 table = pd.pivot_table(df,

java - Why is my rotation matrix giving an extra translation? -

a couple weeks ago decided make own simple 3d game engine. i've followed couple tutorials online, , looked @ many videos, , far, i've gotten pretty engine. have 1 problem. when rotate or scale object, seems center top-left corner of screen instead of real center. example, when rotate object, rotates around left edge of screen, , when scale it, scales towards corner of screen or away corner of screen. here's code: mesh class package com.cub.cubefront.mesh; import com.cub.cubefront.math.matrix4f; import com.cub.cubefront.math.vector3f; public class mesh { private vector3f[] verts; private vector3f center; private double rotx = 0; private double roty = 0; private double rotz = 0; private double scalex = 1; private double scaley = 1; private double scalez = 1; private double translatex = 0; private double translatey = 0; private double translatez = 0; public mesh(int arg0) { verts = new vector3f[arg0]; } public vec

javascript - jquery to disable buttons on submit/click in forms and links -

in rails app have buttons submit information server. buttons part of form , not. i'm looking way apply jquery, disables buttons after click, both. here current jquery: $('.btn-disabler').on('click', function() { $(this).append("<i class='fa fa-spinner fa-pulse btn-loader'>").disable(true); $(this).find('.btn-label').addclass('invisible'); }); this code adds icon disables button , makes text invisible. i've extended disable function work on anchor tags explained here https://stackoverflow.com/a/16788240/4584963 an example link: <a class="btn btn-success btn-disabler" rel="nofollow" data-method="post" href="/approve?id=10"> <span class="btn-label">approve</span> </a> an example form: <form class="simple_form well" novalidate="novalidate" id="new_user" action="/" accept-charse

ios - How do i pass information to a Uilabel in the second view controller in swift? -

i'm new swift , i'm trying learn different techniques. the situation: have 2 view controllers. view controller number 1 consist of 4 buttons (north, south, east, west) example. lets click on north button. should take view controller number 2 , uilabel in view controller 2 should displaying name of whatever button pressed ("north" in case). know when you're passing information forward, should use "prepare segue" method there way 4 buttons? have optional string variable in view controller 2 should catch information being passed view controller 1. i've searched everywhere haven't gotten answer on this. the code have in view controller 1: @ibaction func north(sender: uibutton) { } @ibaction func east(sender: uibutton) { } @ibaction func west(sender: uibutton) { } @ibaction func south(sender: uibutton) { } the code have in view controller 2: @iboutlet weak var label2: uilabel! var updatethelabel: string? override func viewdidload()

sorting - How do I sort a linked list in a alphabetical order in c -

i'm trying sort linked list in alphabetical order, looks sorting algorithm doesn't. how can sort list? typedef struct s_file { char *file_name; struct s_file *next; } t_file; void sort_alpha(t_file **begin_list) { t_file *list; char *tmp; list = *begin_list; if (list) { while (list) { if (strcmp(list->file_name, list->next->file_name) < 0) { tmp = list->file_name; list->file_name = list->next->file_name; list->next->file_name = tmp; } list = list->next; } } } after looking @ code once more have optimized match original intention of @tenten peter. outer loop not needed. sorting done correctly: #include <stdlib.h> #include <stdio.h> #include <dirent.h> #include <string.h> // definition of structure (global scope) typedef

javascript - offset() doesn't work in Bootstrap Modal window -

i want set drop-zone ( drag drop files standard html file input ) in bootstrap modal. doesn't work. <div class="modal fade" id="mymodal" tabindex="-1" role="dialog" aria-labelledby="mymodallabel"> <div class="modal-dialog modal-lg" role="document"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="close"><span aria-hidden="true">&times;</span></button> <h4 class="modal-title" id="mymodallabel">modal title</h4> </div> <div class="modal-body"> <div id="drop-zone"> <span id="filename">drop files here...</span> <div id="clickhere"> or click here..

javascript - How Does One Include Bootstrap in Node Project -

Image
i have mean stack project scaffolded using basic npm command. @ moment, bootstrap included using cdn: link(rel='stylesheet', href='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css') my question how can add bootstrap using npm project works same cdn inclusion. in particular, when run npm install bootstrap a boostrap directory created within node_modules. however, if try include bootstrap.css directory, breaks glyphicon fonts. advise on how it? p.s. pose same question regarding angularjs itself. you can use browser package manager i.e bower bower offers generic, unopinionated solution problem of front-end package management, while exposing package dependency model via api can consumed more opinionated build stack. there no system wide dependencies, no dependencies shared between different apps, , dependency tree flat. if want more knowledge better , reliable read link also. why not npm the main difference between npm ,

c# - Prevent windows forms datagridview to change row after cell edit -

Image
this question has answer here: how prevent going next row after editing datagridviewtextboxcolumn , pressing enterkey? 8 answers i have datagridview in windows forms, default behavior when editing values after edition of cell, when press enter, selected row changes next. i don't want that, want exit edit mode staying in same cell. is possible? you can customize datagridview override processdialogkey method: public class customgrid : datagridview { protected override bool processdialogkey(keys keydata) { if (keydata == keys.enter) { endedit(); return true; } return base.processdialogkey(keydata); } }

adding winmerge as mergetool in git -

i getting error saying fatal bad config file line 24 in .git/config here have in config file.. [mergetool "winmerge"] name = winmerge trustexitcode = true cmd = "c:\program files (x86)\winmerge\winmergeu.exe" -u -e -dl \"local\" dr \"remote\" $local $remote $merged line 24 line starting "cmd = "... can tell me doing wrong here? i tried follow this try '/' instad of \ : cmd = "c:/program files (x86)/winmerge/winmergeu.exe" -u -e -dl \"local\" dr \"remote\" $local $remote $merged note that, as noted before ( details here ), since git 2.5+, simpler config shoud enough: git config diff.tool winmerge git knows right mergetool.cmd syntax use winmerge.

python - Cannot pickle Scikit learn NearestNeighbor classifier - can't pickle instancemethod objects -

i'm trying pickle nearestneighbor model says can't pickle instancemethod objects. the code: import cpickle pickle sklearn.neighbors import nearestneighbors nbrs = nearestneighbors(n_neighbors=50, algorithm='ball_tree', metric=self.distancecie2000_classifier) nbrs.fit(allvalues) open('/home/ubuntu/nbrs.p','wb') f: pickle.dump(nbrs, f) the full traceback: file "/home/ubuntu/colorsetter.py", line 82, in createclassifier pickle.dump(nbrs, f) file "/usr/lib/python2.7/copy_reg.py", line 70, in _reduce_ex raise typeerror, "can't pickle %s objects" % base.__name__ typeerror: can't pickle instancemethod objects somewhere within nearestneighbors instance attribute refers instance method passed in metric argument. pickle won't pickle instance methods, hence error. one way around move method distancecie2000_classifier() out of class regular standalone function, if possible.

c++ - Calling member->function(this); in Destructor causes Segfault -

here's offending code: class fullpage : public qwidget { q_object public: explicit fullpage(const appdata* appdata, qwidget* parent = 0); virtual void addiconworking(iconworking* temp); virtual void removeiconworking(iconworking* temp); ... } class iconworking : public qlabel { q_object public: explicit iconworking(fullpage* parent = 0); virtual ~iconworking(); ... } iconworking::iconworking(fullpage* parent) : qlabel(parent) { ... parentpage = parent; parentpage->addiconworking(this); ... } iconworking::~iconworking() { parentpage->removeiconworking(this); //segfault qmessagebox::information(0, "todo", "reminder message"); } the marked line segfaults before call. (breakpoint there hit, 1 inside function isn't) parentpage never deleted, , has non-zero value @ point. fullpage::add/removeiconworking(iconworking*) don't object itself; add/remove qlist. similar qt's na

cordova - Use ionic and ionic2 together on locale computer -

how use ionic , ionic2 on locale computer? after install crashes 1 of versions. resolved, use vagrant here box

Xcode compiles and runs only on iPhone 4s and 5 simulator -

Image
i think i've got pretty weird 1 here. so app runs on 4s , 5 simulator, above including 5s puts out below list of errors. never mind. went "ignoring file /user/..." , deleted them, , solved problem.

c++ - How to reference Windows Runtime classes in a Static Library? -

i new programming in c++ on universal windows platform , have quick question: created project of static library (universal windows) in visual studio 2015 couldn't use windows runtime classes such windows::ui::core::corewindow in project. i guess need add include directives or references libraries couldn't find information that. tried search msdn found 2 pages 2 headers mentioned namespace default , collections . does know how reference windows runtime classes in static library? you need build project /zw option allow consuming windows runtime extension in uwp static library: right click on project solution explorer click properties select c/c++ -> general set "consume windows runtime extension" "yes(/zw)" click ok after applying option, references windows runtime extensions appear under references of project , can use windows runtime classes. however, may see linker warning while building library: debug\pch.obj : warn

javascript - DateTimePicker Bootstrap hiding input field on blur -

Image
so, i'm using this [bootstrap datetimepicker] plugin allow user pick date , time. plugin works fine, except 1 small problem, whenever user clicks away or blurs calendar box, box , input element disappear! i have looked in css , js files find might lead me in right path (focus, blur, etc), have not had luck. i appreciate if point me in right direction. thank you! this html creating element: <div id="eventstartdate" class="input-append date"><input type="text" data-format="dd/mm/yyyy hh:mm:ss" /><span class="add-on"> <i data-time-icon="icon-time" data-date-icon="icon-calendar"></i></span></div> <script> $(document).ready(function () { $('#eventstartdate').datetimepicker({ language: 'en', pick12hourformat: true, format: 'dd/mm/yyyy hh:mm:ss', maskinput: tr

android - Switch stops displaying after adding Thumb/Track drawables -

i added switch, wanted change color, added following in drawables. thumb.xml <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_enabled="false" android:drawable="@color/black" /> <item android:state_pressed="true" android:drawable="@color/tabaccessorybuttonselected" /> <item android:state_checked="true" android:drawable="@color/tabaccessorybuttonselected" /> </selector> track.xml <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_focused="true" android:drawable="@color/tabaccessorybuttonselected" /> </selector> layout.xml <switch android:layout_width="200dp" android:layout_height="200dp" android:id="@+id/switch1" android:layout_centerhorizontal="true" android:paddin

jquery - result not getting in to the field -

here have 3 fields , while adding values in 2 fields sum of value should enter in third field here sum function not getting here code <script type="text/javascript"> $(document).ready(function () { var balanceamount = $("#balance").val(); var actual_amount = $("#total_amount").val(); var total_balance = $("#totalbalance").val(); $("#amount").keyup(function () { var amount = $("#amount").val(); var total_balance = $("#totalbalance").val(); var total_amount = total_balance + amount; alert(total_amount); $("#total_amount").val(total_amount.tofixed(2)); }); }); </script> you need parsefloat() values... <script type="text/javascript"> $(document).ready(function () { var balanceamount = parsefloat( $("#balance").val() ); var actual_amount = parsefloat( $(&q

android - cannot resolve getAssets() method -

hi have been having trouble getasset() method. trying xml file assets folder getasset() put inputstream. code: public class mainactivity extends appcompatactivity { list people; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); try { inputstream = getassets().open("people.xml"); people = xmlparser.readpeople(is); }catch (ioexception e){ e.printstacktrace(); } } } xml: <people> <person> <name>joe</name> <dob>11/08/16</dob> <gender>male</gender> </person> </people> can tell me going on getassets() method instead of this try { inputstream = getassets().open("people.xml"); people = xmlparser.readpeople(is); }catch (ioexception e){

python - Read inputs from stdin/file and raise errors for less inputs -

lets have simple python code this: num1 = input() num2 = input() res = sum(num1,num2) as per requirements, should able convert above code(that got input user) in such way, should able supply inputs predefined file. how ? , once add code, above works. if add input below "num3=input()", should raise error eoferror: eof when reading line. how raise error ? num1 = input() num2 = input() num3 = input() res = sum(num1,num2) please let me know questions. well far know there's no way tell pythons input function read stdin. without rewriting code use file objects, redirect file stdin. send eof @ end of file , raise error you're expecting. for example run: python script.py < file.in or if have shebang on first line of file , you've made executable: ./script.py < file.in this assuming you're running linux based or posix shell.

Can't open browser with Selenium after Firefox update -

i use selenium webdriver on ubuntu desktop 16.04, , can't open browser. following error after firefox update (before this, worked): traceback (most recent call last): file "test.py", line 6, in <module> driver = webdriver.firefox() file "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/firefox/webdriver.py", line 81, in __init__ self.binary, timeout) file "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/firefox/extension_connection.py", line 51, in __init__ self.binary.launch_browser(self.profile, timeout=timeout) file "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/firefox/firefox_binary.py", line 68, in launch_browser self._wait_until_connectable(timeout=timeout) file "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/firefox/firefox_binary.py", line 98, in _wait_until_connectable raise webdriverexception("the browser appears have exited " se

sql - mySQL AUTO_INCREMENT column creation -

i'm trying make simple database since yesterday primary id key auto_increment option keep getting error: executing: create table `spring`.`samochod` ( `idsamochod` int not null default auto_increment, primary key (`idsamochod`)); operation failed: there error while applying sql script database. error 1064: have error in sql syntax; check manual corresponds mysql server version right syntax use near 'auto_increment, primary key (`idsamochod`))' @ line 2 sql statement: create table `spring`.`samochod` ( `idsamochod` int not null default auto_increment, primary key (`idsamochod`)) error 1064: have error in sql syntax; check manual corresponds mysql server version right syntax use near 'auto_increment, primary key (`idsamochod`))' @ line 2 sql statement: create table `spring`.`samochod` ( `idsamochod` int not null default auto_increment, primary key (`idsamochod`)) i getting error normal integer columns. have read many articles before , far underst

c# - How to use AspNet.Identity in a Domain Model -

a domain model should model problem domain of application, unaware of aspects of implementation; data access example. in respect, feels bit dirty adding microsoft.aspnet.identity.entityframework domain model, since domain model should unaware (and not care) i'm going implement using entity framework... ...herein lies problem in domain model have several classes linked user accounts example class profile { public user owner { get; set; } } class blogpost { public user owner { get; set; } } the problem user extends identityuser , hence reference entityframework . the solution can think of replace references user guid , linking owner id example class profile { public guid ownerid { get; set; } } again, feels dirty, against oop , not solid given want elegant-a-solution possible, how can solve this? i agree identity framework model should seperate other models. , think give answer in question. model complete without implementing identi

MLT compile error on CentOS 6.7 -

installing on centos 6.7 make install getting error: make[2]: entering directory `/root/mlt/src/modules/avformat' cc -i../.. -darch_x86_64 -wall -dpic -o2 -pipe -fno-tree-dominator-opts -fno-tree-pre -ffast-math -duse_mmx -duse_sse -duse_sse2 -g -d_file_offset_bits=64 -d_largefile_source -fpic -pthread -davdatadir=\"/usr/share/ffmpeg/\" -i/usr/include/ffmpeg -i/usr/include/ffmpeg -i/usr/include/ffmpeg -i/usr/include/ffmpeg -i/usr/include/ffmpeg -dfilters -dcodecs -davdevice -c -o filter_avcolour_space.o filter_avcolour_space.c filter_avcolour_space.c: in function ‘convert_mlt_to_av_cs’: filter_avcolour_space.c:50: error: ‘av_pix_fmt_rgb24’ undeclared (first use in function) filter_avcolour_space.c:50: error: (each undeclared identifier reported once ... filter_avcolour_space.c:323: error: ‘av_pix_fmt_rgb32’ undeclared (first use in function) make[2]: *** [filter_avcolour_space.o] error 1 make[2]: *** waiting unfinished jobs.... make[2]: *** [filter_a

linq - How does c# interpret my query? -

why does: var allshapes = _context.attributevalueslibraries.where(x => x.attnameid.equals(1)).select(y => y); work, error "unable create constant value of type 'system.object'. primitive types or enumeration types supported in context" when exclude select() like: var allshapes = _context.attributevalueslibraries.where(x => x.attnameid.equals(1)); is there way write query makes more sense? played query make work. thanks in advance! try this: var allshapes = _context.attributevalueslibraries.where(x => x.attnameid == 1); it depends on linq provider.

PHP and Javascript JSON.stringify in localstorage and convert it into JS object? -

lets have simple php echo's/prints this: [['staff', 'somewhere', 'map-marker-icon.png'], ['chinese', 'london', 'map-marker-icon.png'], ['trade', 'essex', 'map-marker-icon.png'], ['fare', 'london', 'map-marker-icon.png'], ] i whatever php echo's on html page using ajax , stores them in localstorage using stringify.json so: $.ajax({ type: "post", url: "my-php-page.php", data: datastring, crossdomain: true, cache: false, beforesend: function(){}, success: function(data){ localstorage.setitem('mapmarkers', json.stringify(data)); } }); i ajax response (data) stored in localstorage , can see there being stored. now, next step i'm trying same localstorage value , use javascript object. so went ahead , did in html page after localstorage set above: var locations = json.parse(localstorage.getitem('mapmarkers')); alert(locations);

intellij idea - New project from existing sources from command line -

i saw video presenter had clojure lein project. typed: > intellij . at root of project , new intellij project created sources. script wrote or possible intellij idea distros. thanks you can running following command root project: idea.exe . just make sure intellij bin folder included in path environment variable, or provide full path of idea executable.

PHP MySQL SSL certificate -

i have vb.net software , shall use php code on website make user customer. have tried many codes same error: warning: mysqli_ssl_set() expects parameter 1 mysqli, null given in xxxxxxxxxxx/makeuser/insert.php on line 12 warning: mysqli::mysqli(): (hy000/2002): the php code needs certificate shall store certificate. shall store them in webserver? understand can store certificate in webserver safe? when shall execute sql script doing this: $sql = $conn->prepare ("create database '$_post[group]' /*!40100 default character set latin1 */;"); i error on execute process. if use $ssl instead of $conn don't error. correct? whoa. first things first never use $_post directly in sql. dangerous. post "; drop databases" , run. next, query, error because mysql query failed, either syntax error, or connection. how creating $conn object? should $conn = mysqli_connect($host... if not connected mysql server, that's p

php - Symfony 2 server deploy Fatal Error: It tries to open localhost file -

i've made symfony2 app , try deploy on shared server, fatal error. i've taken recommended steps here: deployment-tools i've updated vendor dependencies: php composer.phar install --optimize-autoloader i've cleared cache: php app/console cache:clear --env=prod --no-debug i've change permissions on server app/cache , app/logs but doesn't work. error: fatal error: uncaught exception 'unexpectedvalueexception' message 'the stream or file "/var/www/cookieboy/app/logs/prod.log" not opened: failed open stream: no such file or directory' in /homepages/32/d453730371/htdocs/cookieboy/vendor/monolog/monolog/src/monolog/handler/streamhandler.php:71 stack trace: #0 /homepages/32/d453730371/htdocs/cookieboy/vendor/monolog/monolog/src/monolog/handler/abstractprocessinghandler.php(37): monolog\handler\streamhandler->write(array) #1 /homepages/32/d453730371/htdocs/cookieboy/vendor/monolog/monolog/src/monolo

jpa - Configuring Hibernate Search with EntityManager -

i want add hibernate search project, write sample code test it. entitymanagerfactory entitymanagerfactory = persistence.createentitymanagerfactory("pu"); entitymanager em = entitymanagerfactory.createentitymanager(); fulltextentitymanager fulltextsession = search.getfulltextentitymanager(em); em.gettransaction().begin(); querybuilder builder = fulltextsession.getsearchfactory().buildquerybuilder().forentity(place.class).get(); double centerlatitude = 0d; double centerlongitude = 0d; org.apache.lucene.search.query lucenequery = builder .spatial() .within(100, unit.km) .oflatitude(centerlatitude) .andlongitude(centerlongitude) .createquery(); javax.persistence.query jpaquery = fulltextsession.createfulltextquery(lucenequery, place.class); list result = jpaquery.getresultlist(); em.gettransaction().commit(); em.close(); and im getting exception this. javax

Debugging a stack overflow in haskell -

i'm new haskell , functional programming , have program works overflows stack after few seconds. question is, should here? how can @ least hint of occurs, print stack or anything? the program slow when running in ghci :trace stack overflow not occur. not occur runhaskell eat more , more memory. error when compiling ghc , executing. in case, strictness problem causing stack overflow. 1 easy way find such issues using deepseq library . adds few functions allow evaluate value (which better seq , goes 1 level down). key function force :: nfdata => -> a . takes value, evaluates it, , returns it. it works on types implement nfdata type class though. luckily, there template haskell macro in deepseq-th library : derivenfdata . used own data types, eg derivenfdata ''bfmachine . to use, put force $ in front of functions may having strictness problems (or liftm force $ monadic functions). eg code, put in front of step , since key function in file: {-# lan

php - Echo a XHTML tag -

when try echo of xthml tags inside php loop 1 echo's data mysql shows text in browser. i'm running xampp control panel apache , mysql tests. code: echo "<textarea readonly>"; while ($wiersz = mysql_fetch_array($sql_wynik_zapytania)) { echo " ".$wiersz['nick'].":\n"; echo $wiersz['koment']."\n"."<hr />"."\n"; } echo "</textarea>"; the results in browser: nick: <hr /> nick: asdaa <hr /> pallluch: cccc "a" "asdaa" "cccc" random texts added table in databse tests. echo works fine <textarea> , <hr> doesn't seems to. can help? a textarea element can't contain other plain text. you writing invalid html , browser trying recover treating < character plain text instead of start of tag. it looks aren't using textarea accept user input anyway (you've made readonly). don&

android - How to upload image on server using multipart using Retrofit library -

using retrofit library how can upload image on server? detail scenario have signup module in want send user profile image , other user detail on server using php web api. 1 know come in answers. want know best , fast method upload image on server after searching bellow code made uploading asset image on server can upload sd card image replacing asset image path sd card path. hope effort solution of question work other people also. in case work fine , complete project purpose image uploading using retrofit. code given bellow. file= copyreadassets(); okhttp3.requestbody requestbody=okhttp3.requestbody.create(okhttp3.mediatype.parse("multipart/form-data"), file); // multipartbody.part used send actual file name body =multipartbody.part.createformdata("uploadfile", file.getname(), requestbody); btnupload.setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) { hashmap<st

office365 - Display a list of upcoming birthdays of Office 365 users using Microsoft Graph API -

using microsoft graph api, want create list of office 365 users's birtdays, cannot list of users related properties @ moment. to set list need following properties exposed via graph api: id displayname userprincipalname birthday using graph explorer, https://graph.microsoft.io/en-us/graph-explorer , i've tried request own properties (graph.microsoft.com/v1.0/me/?$select=id,displayname,userprincipalname,birthday) works: { "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users(id,displayname,userprincipalname,birthday)/$entity", "id": "aaaaaaaa-bbbbb-ccccc-a3c6-63817c4bbbca", "displayname": "harold van de kamp", "userprincipalname": "harold@company.com", "birthday": "2000-08-15t00:00:00z" } when query users (graph.microsoft.com/v1.0/users), works, doens't contain required properties but when query users required properties (

Setting new variables in a while loop with calculations PYTHON -

i'm running population model, , wrong numbers come out because i'm setting variables new values, when want use old variables, loop automatically updates , uses new ones. juvenile_population = 10 adult_population = 10 senile_population = 1 juvenile_survival = 1 adult_survival = 1 senile_survival = 0 birth_rate = 2 generations = 5 counter = 0 while counter < generations: juvenile_population = adult_population * birth_rate adult_population = juvenile_population * juvenile_survival senile_population = (adult_population * adult_survival) (senile_population * senile_survival) total_population = juvenile_population + adult_population + senile_population print("juvenile: ",juvenile_population) print("adult: ",adult_population) print("senile: ",senile_population) print("total: ",total_population) counter += 1 a friend said set new named variables, after 1 loop, won't same problem again? want