Posts

Showing posts from June, 2014

iphone - How can I create an array of UIButtons/(UIImageViews) that appear after the last one was pressed -

i wasn't sure how search answer question figured try luck on here. to put in short, have uiview , created uibutton programmatically along uiimageview added button subview , happens is, when press on button, allows me add image , gets stored on button. so question is: once completed, how can make button/imageview appear in view, next first button (or after fills screen right, appear in 2nd row, 1st column) etc thank in advanced! you can use uicollectionview pointed out @bernahard harrer or use following code. code adds 2 buttons. in case, need more buttons or array of buttons, implement following code , calculate size of added button, height/width of button1 calculated adding button2 : #import "viewcontroller.h" @interface viewcontroller () @end @implementation viewcontroller - (void)viewdidload { [super viewdidload]; // additional setup after loading view, typically nib. [self addbuttons]; } - (void)didreceivememorywarning { [super...

javascript - geolocation not working in chrome -

i have used following script in mozilla , chrome browser. in mozilla, asking whether share location. in chrome not displaying anything. <script> var x = document.getelementbyid("demo"); function getlocation() { if (navigator.geolocation) { navigator.geolocation.getcurrentposition(showposition); } else { x.innerhtml = "geolocation not supported browser."; } } function showposition(position) { x.innerhtml = "latitude: " + position.coords.latitude + "<br>longitude: " + position.coords.longitude; } </script> do use chrome50 ? removed geolocation support non https sites. https://developers.google.com/web/updates/2016/04/geolocation-on-secure-contexts-only

r - sorting columns from lowest to highest values (i.e. 1, 2, 3 etc, not 1, 10, 11...2, 20, 21... etc) -

i have dataset 50 thousand rows want sort according the values in 1 of columns. numbers in column go 1-30, , when following data=data[order(data$columnname),] it gets sorted order of columns this 1, 10, 11 12, 13, 14, 15, 16, 17, 18, 19, 2, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 3, 30, 4, 5, 6, 7, 8, 9 how sort this 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30 for me seems, format not numeric. try this: data$columnname<-as.numeric(data$columnname) data=data[order(data$columnname),]

How to use index to get the value from the result of map function by Python 3? -

i try this: def test(x): return x**2 = map(test,[1,2,3]) if value this: for in a: print(a) i 1,4,9 , works perfectly. but if this: a[0] . error raised. i know because result of map function map class: type(map(test,[1,2,3])) == <class 'map'> which not subsciptable. so how can use index value of result of map function? note: behavior specific python 3. convert map object list object: a = list(map(test,[1,2,3])) then can use list indices access individual elements.

c# - How to specify a "COM" class, when multiple "COM" class has same name in C++? -

i have defined com interface shown below(c#): using system.runtime.interopservices; namespace commoninterop.hello { [comvisible(true)] [guid("24484884-daae-4b24-b0bd-c7b9aeb3d70d")] public interface icominterop { int plus1(int x); } } and again same interface defined different namespace , guid : using system.runtime.interopservices; namespace commoninterop.world { [comvisible(true)] [guid("66664884-daae-4b24-b0bd-c7b9aeb34444")] public interface icominterop { int plus1(int x); } } usage in c++: in c++ pointer object show below if 1 of com class defined: icominteropptr m_interop; // , void setsome(icominteropptr); but have 2 "com" class has same class name. how can tell c++ use specific "com" class? im noob in c++, tell me explain further if question not specific enough.

django - Threading for sending Notifications and Emails -

i developing web application in django, on update call activity following things: call stored procedure update database. generating data notification. sending actual notification users. generating email data emails. sending actual emails users. the users can more one, tested 50 users giving slow response there processing in call. i planning implement thread run in background , steps 2,3,4 & 5 , call return response after step 1. i confused whether doing right or wrong. is there approach doing it? i never have used threads kind of stuff ... , may problematic depending on server running. (are running multiple instances? every instance start thread? servers uwsgi disable threading default) i use libraries django-q ( http://django-q.readthedocs.io/en/latest/ ) or celery ( http://www.celeryproject.org/ ) sending email , other stuff delay requests. if using uwsgi serving app, has simple feature stuff that: http://uwsgi-docs.readthedocs.io/en/latest/mules....

windows store certification kit - c++ library validation issues -

i'm trying port c++ library universal windows windows store app. using x86 developer command prompt in visual studio 2015 v14.0.24720.00 update 1 on windows 10. wondering i'm doing wrong - compiles , links fine following flags: cl /nologo /fobuild\obj\windows\release\[obj_file].obj /c /md /ox /w4 /ehsc /frbuild\obj\windows\release\ -ddefine_little_endian -ddefine_trace -d_crt_secure_no_warnings -ddefine_windows_universal /ai "c:\program files (x86)\microsoft visual studio 14.0\vc\lib\store\references" /wx /zw /d "winapi_family=2" -ibuild\include [source].cpp and: link /nologo /opt:ref /map ws2_32.lib /appcontainer /dll /out:build\obj\windows\release\mydll.dll [obj_file.obj]* getting whole bunch of unusual looking wack validation errors things surely should standard functions such malloc , std::bad_alloc etc. , furthermore, lot of these not supported apis seem exist in whitelist files though declared not supported. not sure i'm doing wrong ...

Capture an argument passed to function in different JavaScript file using Jasmine -

i have javascript file main_one.js requires javascript file helper.js . helper.js warp = { postthisevent: function(a) { // operation on } }; main_one.js var helper = require('path/helper.js'); // steps helper.warp.postthisevent(event); i want capture event using jasmine. how create spy object capturing event in postthisevent() ? in jasmine test require helper , spy way: spyon(helper.warp, "postthisevent").and.callthrough(); this replace postthisevent on object helper.warp spy function. when it's called spy register call , call original method instructed callthrough() . then can expect postthisevent() called expected objects way: expect(helper.warp.postthisevent).tohavebeencalledwith(jasmine.objectcontaining({ someproperty: "somevalue" })); jasmine.objectcontaining() helper test expecte properties present among multiple properties of object under test. you can inspect complex objects directly: expect...

python - Reducing size of vectorized contourplot -

i include filled contour plot pdf document (for example tex document). using pyplot s contourf , , saving pdf pyplot s savefig . problem size of plots becomes rather big compared high resolution png . one way reduce size of course reduce number of levels in plot, few levels gives poor plot. i'm searching simple way example let colors of plot saved png, axes, ticks etc. saved vectorized. you can using axes option set_rasterization_zorder . anything zorder less set saved rasterized graphics, when saving vector format pdf . for example: import matplotlib.pyplot plt import numpy np data = np.random.rand(500,500) # fig1 save contourf vector fig1,ax1 = plt.subplots(1) ax1.contourf(data) fig1.savefig('vector.pdf') # fig2 save contourf raster fig2,ax2 = plt.subplots(1) ax2.contourf(data,zorder=-20) ax2.set_rasterization_zorder(-10) fig2.savefig('raster.pdf') # show difference in file size. "os.stat().st_size" gives file size in bytes. p...

Where is the error in my Conditional Statement (PHP)? -

the challenge is: if n odd, print "weird". if n , in inclusive range of 2 5, print "not weird". if n , in inclusive range of 6 20, print "weird". if n , greater 20, print "not weird". and code is: <?php $n=5; if($n%2==0 && $n>20){ echo "not weird"; }else{ echo "weird"; } ?> and problem is: when rut locally it's okay. when submit hackerrank fails test when comes $n=5; case. have problems in conditional according challenge? <?php $n=5; if($n%2==1){ echo 'weird'; }else{ if($n >= 2 && $n <= 5){ echo 'not weird'; }elseif($n > 5 && $n <= 20){ echo 'weird'; }else{ echo 'not weird'; } } ?>

Is there a android-standard badge or method to show action-bar notification icon with a count from android Fragment Button Click -

Image
i wants update count notification fragment's button onclick event for m doing that: uses custom button show count badger: please tell me if know need changed in case, have button. custom item on menu - menumain.xml <item android:id="@+id/badge" android:actionlayout="@layout/feed_update_count" android:icon="@drawable/shape_notification" android:showasaction="always"> </item> custom shape drawable (background square) - shape_notification.xml <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <stroke android:color="#22000000" android:width="2dp"/> <corners android:radius="5dp" /> <solid android:color="#cc0001"/> </shape> layout view - feed_update_count.xml <?xml version=...

How to Plot ROC curve with matplotlib/python -

Image
i want plot roc curve in python matplotlib , want show this: i cannot find function that. is there easy way it? yes, don't think there's direct plot command it. recommend follow scikit-learn recipe it: import numpy np import matplotlib.pyplot plt sklearn import svm, datasets sklearn.metrics import roc_curve, auc sklearn.cross_validation import train_test_split sklearn.preprocessing import label_binarize sklearn.multiclass import onevsrestclassifier scipy import interp # import data play iris = datasets.load_iris() x = iris.data y = iris.target # binarize output y = label_binarize(y, classes=[0, 1, 2]) n_classes = y.shape[1] # add noisy features make problem harder random_state = np.random.randomstate(0) n_samples, n_features = x.shape x = np.c_[x, random_state.randn(n_samples, 200 * n_features)] # shuffle , split training , test sets x_train, x_test, y_train, y_test = train_test_split(x, y, test_size=.5, ...

sql - PHP call to undefined function mysql_connect -

Image
im getting error "php call undefined function" don't know cause of error can give me clue how solve this? im new html , css. here error. here sql here php code. <?php //for connecting db include('connect.php'); if (!isset($_files['image']['tmp_name'])) { echo ""; } else { $file=$_files['image']['tmp_name']; $image= addslashes(file_get_contents($_files['image']['tmp_name'])); $image_name= addslashes($_files['image']['name']); move_uploaded_file($_files["image"]["tmp_name"],"gallery/" . $_files["image"]["name"]); $photo="gallery/" . $_files["image"]["name"]; $query = "insert images (photo)values('$photo')"; $result = mysql_query($query); echo '<script type="text/javascript">alert("image uploaded ");window.location=\'index.php\';</script...

When embedding an OLEObject (Word/XLS/PDF doc) in Excel, how can I set the icon's position relative to the attachment button? -

i'm trying create button allow me attach word/excel/pdf files. i've read bunch of other articles , tutorials, have button , vba macro gives me dialogue box browse file of choice. file can selected , embeds in excel fine. issue i'm having getting position of embedded file sit next button i've created. @ moment defaults top left of active sheet, despite best efforts hard code different position in. so 2 questions: how set position oleobject? is there way can identify cell reference/position of command button, , set position of oleobject relative it? example, 2 columns right of button. thanks jk here's code far: sub attachfile() 'identify cell command button in , set location attachment icon 3 columns right dim buttonname string dim buttonaddress string dim buttonlocation range dim iconlocation range buttonname = activesheet.shapes(application.caller).name buttonaddress = activesheet.shapes(buttonname).topleftcell.address set iconlocation = ran...

parse.com - Is Parse service down right now? -

i can't access parse.com dashboard @ least few minutes now. try refreshing , different browsers , keep getting same errors - 500 there’s been error, it’s not fault. if keep seeing this, check page more info. tried going page written parse healthy.

Calabash Android random failures because of elements not found -

we use calabash-android our functional tests here , experiencing strange behaviors. have simple scenario like: when skip tutorial must land on 'fancy' screen this scenario succeed of time, (about 10-15% of time) 2 failures possible. first 1 because element looked when skip tutorial not found calabash-android (it button id button_ok ). when inspecting screenshot taken see element, quite weird. suspecting animation of element, i've had post_timeout , this: tap_when_element_exists("* id:'button_ok'", :post_timeout => 2) but nothing changed. the second possible failure when step when skip tutorial passed next step check on correct page fails, because page has not changed... on screenshot taken calabash indeed on page of tutorial, not on next 1 expected. how possible since step change page successful? does faced kind of random failures? (sorry bad english, not mother tongue :( ) i have faced similar random failure on devices. pro...

c# - TestStack.White does not return element properly -

i'm trying 2 editboxes main application after start. window.getmultiple() returns me 1 editbox. there method wait element appearance? editboxes don't have automation id or text. you can use retry function wait until 2 edit boxes appear: retry.for(() => { var editboxes = window.getmultiple(criteria); assert.areequal(2, editboxes.length); }, timespan.fromseconds(10));

java - Access to another maven dependency configuration files -

i'm writing here because i'm getting headaches trying find out happening. i'm working on "toolbox" project id validate provided string among different kind of rules. i've stored different rules on xml files , project works properly. its structure : validatorproject : |___ src/main/java |____ validatormanage.java (this 1 have method able load correct config validator file , validate provided string) |___ src/main/resources |____ *.xml (a lot of xml config files) unit testing, direct manager instanciation inside project works expected. now i'd add project maven dependency other projects need validate datas. my problem creating new validatormanger instance in second project validatormanager.class.getclassloader().getresourceasstream not working because used project n°2 classpath , can't find config files. i tried import resources in maven build of validator project (i got if unzip jar file), don't know how can have access it. if h...

javascript - How can I add fade in, fade out effects -

i have simple script works simple html gallery. however, need add transition effects gallery, fade in, fade out, or effect of similar subtitles @ end of every movie (you know mean). how can solve this? make using js, html, css, without external plugins. possible? on, have below: <head> <title>test</title> <script> var images = [ "https://upload.wikimedia.org/wikipedia/commons/7/70/example.png", "https://upload.wikimedia.org/wikipedia/commons/a/a9/example.jpg", "https://upload.wikimedia.org/wikipedia/commons/c/ce/example_image.png", "https://upload.wikimedia.org/wikipedia/commons/e/ee/example-zh.jpg", "https://upload.wikimedia.org/wikipedia/commons/e/e2/p%c5%99%c3%adklad.jpg", "https://upload.wikimedia.org/wikipedia/commons/d/d6/beispiel.png" ]; var links = [ "http://www.example1.com", ...

How to find out Android device diagonal display width or screen size using adb shell? -

i need find out device-width keep track set different actions based on different width of every device, further used write script automate process. through research find out using commands like- $ adb shell wm size output-physical size: 720x1280 adb shell wm density output-physical density: 320 curious know, if there other better way of doing this? precise format of dumpsys command depends on hardware vendor (of graphics chipset/driver , handset itself) should able find info in adb shell dumpsys display output

How to update git working copy to a specific commit while staying on the same branch? -

say have working copy on clean master branch. want bring whole code state @ commit without switching commit / detaching head. i can achieve using these steps: create copy of whole working copy directory; checkout new copy commit want code in state of; get rid of .git directory , bring 1 original working copy (that still @ clean master ): here example illustrating want in end: mkdir code cd code/ git init . echo 'content 1' > file.txt git add --all && git commit -m 'version 1' && git tag v1 echo 'content 2' > file.txt git add --all && git commit -m 'version 2' && git tag v2 cd .. cp -pr code code1 cd code1/ git checkout v1 rm -rf .git mv ../code/.git ./ git diff diff --git a/file.txt b/file.txt index 4d4bc1c..a0054e4 100644 --- a/file.txt +++ b/file.txt @@ -1 +1 @@ -content 2 +content 1 git status on branch master changes not staged commit: modified: file.txt the question is: how achieve us...

Distance between signals / rows for each levels in R -

i have following sample: id = c(1, 1,3,3,3) long = c("60.466681", "60.664116", "60.766690", "60.86879", "60.986569" ) lat = c("24.158253", "24.266036", "24.368283", "24.479058", "24.5599858") data = data.frame(id, long, lat) data$long <- as.numeric(as.character(data$long)) data$lat <- as.numeric(as.character(data$lat)) data$id <- as.factor(data$id) i create new column called distance cumulative sum of distance between each lat/long points each level of factor id i tried create own function found on internet , using distcosine() package geosphere . got: create function distance <- vectorize(function(i, j) distcosine(data[i,], data[j,])) run function library(dplyr) dist <- data %>% filter(id != 0) %>% #i keep because in final data can have id==0 group_by(id) %>% do(distance(.$lat, .$long)) it looks function not work, guess there pro...

android - Espresso waiting for textview -

i have service connecting socket.io server. simple app sends message , gets echoed client. have test follows: @test public void checksendmessage() { final string testmessage = "here test message"; onview(withid(r.id.textentry)).perform(typetext(testmessage), closesoftkeyboard()); onview(withid(r.id.send)).perform(click()); onview(withid(r.id.messages)).check(matches(withtext(containsstring(testmessage)))); } i have server running on local network, , in scenario runs , passes. however, if add 3 second delay in server, test fails. want wait x seconds , check if contains text. i have seen similar questions people answering use idlingresource. not sure how integrate app. guess have implement isidlenow function. using service connects com.koushikdutta.async.http.socketio.socketioclient; it doesn't ever go idle though, sits there listening on socket. not waiting finish, want keep checking view x seconds see if message arrived. how might this? ...

javascript - Fetch localStorage values to other page using id -

i storing values in localstorage , values getting stored through input[type:hidden] , input[type:text]. js: $('.proceed_btn').on('click', function() { // blank start var order = {}; // loop through inputs... $('input[type="text"], input[type="hidden"]').each(function() { // ...adding values properties order[this.name] = this.value; }); // store object in json format localstorage.setitem("order", json.stringify(order)); }); i want print these value in other page when user redirects after submitting form. working on ruby currently. there many products in website, information in summary page gets rendered according that. there way display specific form details in through there id's? you can create partial .js.erb extension eg _order_partial.js.erb , retrieve order object thus: order = json.parse(localstorage.getitem("order")); // loop through object , print out then can rend...

javascript - How does openload.co manage to go into fullscreen mode without warning message on chrome? -

the video hosting site openload.co seems have found way force browser go full screen mode without displaying usual message on top of page (like "www.youtube.com full screen. exit full screen. allow"). @ least on chrome 50.0.2661.94 (64-bit) on mac os x v10.10.5. doesn't seem work on firefox , safari. to demonstrate uploaded video here: https://openload.co/f/88qxnnav4rg/ just click on play button. beware of several pop-ups. i want find out how did it. out of curiosity. way implemented annoying user. i'm aware of being bad practise.

AngularJS / JAX-RS : how to have a proper Excel doc response -

Image
i export excel file via jax-rs webservice , download / open web application. sounds works whether called curl not called angularjs v1.4.7 front end. using microsoft excel 2013 64 bits under windows 7 professional. on server side webservice implemented below: @post @produces("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet") @consumes(mediatype.multipart_form_data) @path("/compare") public response compare( @formdataparam("controlfile") inputstream controlis, @formdataparam("controlfile") formdatacontentdisposition controlfiledetail, @formdataparam("testfile") inputstream testis, @formdataparam("testfile") formdatacontentdisposition testfiledetail ) { //(...) //creating excel file using apache poi sxssfworkbook file file = new file(reportfilename); responsebuilder responsebuilder = response.ok((object) file, mediatype.application_octet_stream) ...

python - PyQt Rounded progress bar -

inspired post , code here any pyqt circular progress bar? trying embed 4 rounded progress bar in gui application. in gui not need border of progress bar , base rectangle. how can remove these 2 in code of paintevent. def paintevent(self, event): outerradius = min(125,110) baserect = qtcore.qrectf(1, 1, outerradius-2, outerradius-2) # don't want rectangular shape behind circular bar buffer = qtgui.qimage(outerradius, outerradius, qtgui.qimage.format_argb32) buffer.fill(255) p = qtgui.qpainter(buffer) p.setrenderhint(qtgui.qpainter.antialiasing) # data brush self.rebuilddatabrushifneeded() # background self.drawbackground(p, buffer.rect()) # base circle self.drawbase(p, baserect) # data circle arcstep = 360.0 / (self.max - self.min) * self.value self.drawvalue(p, baserect, self.value, arcstep) # center circle innerrect, innerradius...

html - Effect image on hover with css -

i trying animated image on hover. result want have similar 1 : see here ( scroll see image "our team" ) so, want have background display information ( name, links) in theme can't achieve it. here code : <div class="row"> <div class="col-md-6"> <div class="picture"> <div class="photoapropos center-block"> <div class="info"> <img class="img-responsive img-circle" alt="name" src="<?= $url; ?>"/> <p>name</p> </div> </div> </div> </div> </div> and css : .picture { display: block; opacity: 1; } .photoapropos{ display: block; position: relative; width: 425px; height: 425px; -webkit-transition: 0.4s ease-in-out; -moz-transition: 0.4s ease-in-out; -o-transition: 0.4s ease-in-out; -ms-transition: 0.4s ease-in-out;...

python - A quick way to compute the average of multiple timeseries? -

i'm writing k-means algorithm in python numpy. distance-to-all-centroids part pretty optimized (compute matrix of centroids instead of each 1 separately), i'm struggling compute-new-centroid part. i'm copying data per centroid dataset compute mean. i think faster without copying. how do in python/numpy? code snippet: c_i in range(k): sub_data = np.zeros([n_per_c[c_i],data_width]) sub_data_i = 0 data_i in range(data_length): if label[data_i] == c_i: sub_data[sub_data_i,:] = data[data_i,:] sub_data_i += 1 c[c_i] = np.mean(sub_data, axis=0) c list of centroids have, data entire dataset, label list classlabels. i think following same code, without explicit intermediate array: for c_i in range(k): c[c_i] = np.mean(data[label == c_i, :], axis=0) getting rid of last loop tougher, should work: label_counts = np.bincount(label) label_sums = np.histogra...

osx - How to I make docker start as a service on OS X? -

i installed dockertoolbox 1.11.1 on mac os 10.11 , start docker via kinematic , if click docker cli wills start terminal docker running ( docker version returns info , success). still, if try same normal console fail detect docker , want have docker available in console window, starting @ login time, automatically or on demand. still, once started expect able use console. i guess part missing tutorials , find solution it. how can this? this docker machine for. docker instance running in virtual machine, , have set few environment variables connect it( docker_host , docker_tls_verify , docker_cert_path , docker_machine_name ) . if run eval $(docker-machine env [machine name]) set variables automatically assuming vm up. put line bash profile automatic setup. check out docs here https://docs.docker.com/machine/overview/ also, there native version of docker osx (currently in limited beta) removes need docker machine, in near future none of necessary.

scala - Set up sbt for use with HBase -

i'm trying work hbase spark/scala using sbt , followed instructions replaced version 1.2.1. however, seems machine cannot resolve dependencies. below .sbt/repositories file: [repositories] local sbt-releases-repo: http://repo.typesafe.com/typesafe/ivy-releases/, [organization]/[module]/(scala_[scalaversion]/)(sbt_[sbtversion]/)[revision]/[type]s/[artifact](-[classifier]).[ext] sbt-plugins-repo: http://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/, [organization]/[module]/(scala_[scalaversion]/)(sbt_[sbtversion]/)[revision]/[type]s/[artifact](-[classifier]).[ext] maven-central: http://repo1.maven.org/maven2/ concurrent-maven: http://conjars.org/repo/ i'm using intellij , tells me hbase still unresolved dependency , don't see hbase when type org.apache.hadoop. , should appear in list. am missing repo or resolver? i figured out: if can use 1 of chd or hdp versions, in case works out fine because use hdp, have add repos here . then in build....

c++ class library dynamic runtime allocation -

suppose i' have interface class class foo_if_t { }; , first library libfoo_orig.so class foo_t inherits foo_if_t , has following code: #include "foo_if.h" class foo_t : public foo_if_t{ private: int res; public: foo_t(){} virtual ~foo_t(){} }; and second library libfoo_mod.so class foo_t redefined follows: #include "foo_if.h" class foo_t : public foo_if_t{ private: int res[100]; public: foo_t() { (int i=0; i<100; i++) res[i] = i; } virtual ~foo_t(){} }; i create symlink libfoo.so --> libfoo_orig.so , compile following application #include "foo_orig.h" int main(){ foo_if_t *foo_if = new foo_t(); delete foo_if; } with g++ -ggdb -o0 test.cpp -o test -l. -lfoo (hence linking libfoo.so). at point change symlink target libfoo_mod.so , rerun code. result in following error: *** error in `./test': free(): invalid next size (fast): 0x0000000001ec9010 *** aborted...

servlets - captcha error on jsp -

i have captcha on jsp form , response enter in wrong condition never enter in wright 1 here jsp code: <%@ page import="net.tanesha.recaptcha.recaptcha" %> <%@ page import="net.tanesha.recaptcha.recaptchafactory" %> <form action="captchaverif" method="post" class="register modalreg" role="form"> <!-- captcha --> <div class="g-recaptcha" data- sitekey="6lcxqb8taaaaann08bywsrspvqjh_5feqpnxshin"></div> <!-- captcha --> <button value="reg" type="submit" class="btn btn-primary btn-lg-btn-block">s'inscrire</button> </form> and here servlet : string remoteaddr = request.getremoteaddr(); recaptchaimpl recaptcha = new recaptchaimpl(); recaptcha.setprivatekey("6lcxqb8taaaaakkxkr4uwte--l1vwgmqkwgf6mga"); string challenge = request.getparameter("...

c# - cmdlet write to console with out writing to pipeline -

is there way can have class extends cmdlet write powershell console out writing pipeline? i'm writing cmdlet write lot of objects pipeline (which people pipe cmdlet export-csv). problem if start writing info console picked well. e.g object 1 object 2 "i info message has been logged powershell via this.writeobjct object 3 if try , pipe cmdlet cmdlet i'll object 1,2, info message , 3. need pipes object 1,2 , 3. can point me in right direction? you should use writedebug method or writeverbose . read more on msdn in: adding user messages cmdlet

javascript - getting data from dynamically added form in angular -

i'm developing app using mean stack. i'm able add form elements dynamically cannot inserted data in ng-model. if put ng-model="something.something" every dynamically added form elements takes same data. wish take data in form of object inside array.i appreciate response. here html code: <div layout-gt-sm="row" ng-repeat="(key,aca) in vm.academic"> <md-input-container class="md-block" flex-gt-sm> <label>degree</label> <input name="degree" ng-model="vm.academic[key].degree"> </md-input-container> <md-input-container class="md-block" flex-gt-sm> <label>university/board</label> <input name="university" ng-model="vm.academic[key].university"> </md-input-container> ...

java - class path for jars within jars -

i have 1 application , using 1 jar called " a " internally refers classes jar called " b ", jar " b " refers classes jar " c ". how execute java application while setting class path a.jar , add classpath dependency of b.jar , c.jar in manifest file of a.jar. thanks in advance you can set class path in menifest.mf file of a.jar this class-path : dependency/b.jar dependency/c.jar where dependency folder contains b , c jars

kerberos - NFS V4 at FreeBSD hosted, both client and server, mounts OK but there is no read or write on the filesystem, reporting Input/output error -

i have mounted , used nfs version 4 having solaris server , freebsd client. problem when having freebsd server , freebsd client @ version 4. version 3 works excellent. i use freebsd nfs server since freebsd verson 4.5 (then having ibm aix clients). the problem: mounts ok, there no principals appear @ kerberos cache, , when trying read or write on mounted filesystem error: input/output error nfs/server-fqdn@realm , nfs/client-fqdn@realm principals created @ kerberos server , stored @ keytab files @ both sides. i issue tgt tickets kdc using above both sides root's kerberos cache. i start services properly: file /etc/rc.conf rpcbind_enable="yes" gssd_enable="yes" rpc_statd_enable="yes" rpc_lockd_enable="yes" mountd_enable="yes" nfsuserd_enable="yes" nfs_server_enable="yes" nfsv4_server_enable="yes" then start services @ client: rpcbind, gssd, nfsuserd, @ server above having exports file: ...

java - Dynamic Json Parsing Using Gson Android -

i have json mentioned below. { "product": [ { "classification": "abc", "abc": [ { "classification": "abc", "name": "abc new product one", "price": "10775.0000", }, { "classification": "abc", "name": "abc new product two", "price": "12725.0000", } ] }, { "classification": "def", "def": [ { "classification": "def", "name": "def product one", "price": "728.0000", }, { "classification": "def", "name": "def product two", "price": "1263.0000", }, ] ...

php - Symfony JsonResponse: Fetching each element of multidimensional array returned by symfony controller -

basically trying trying fetch each element array of "arrays" passed symfony controller when try fetch rows of table. controller working absolutely fine, , giving me output: [{"id":1,"name":"johnsonn's baby shampoo","dsc":"shampoo","pic":"572f8a02d59b3.jpg","company":4,"type":"baby products","price":150,"sold":null,"stock":200},{"id":2,"name":"johnson's soap","dsc":"baby soap","pic":"57303fc35f72c.jpg","company":4,"type":"baby products","price":52,"sold":null,"stock":1000}] and javascript fetching output following: <script> function fetchprod() { $.ajax({ url: "/show/prod", datatype: "json" }).success(function(data){ $(...

.net - creating pdf on server gives error : Unable to connect to the remote server -

i have code creating pdf dynamically. had used itextsharp, vs 2010, .net 4.0 every thing going fine , working on local. when have uploaded on secure server (https) gives error : unable connect remote server it working fine on server localhost when debugging. error occur when calling remotely other pc (from url). what may causes problem ?? update : i have checked code again.. , find 1 thing.. i had put image source : <img src='https://siteurl.com/pdf/11111111.png' alt='' /> that gives problem : have put static relative path why gives error ??? because in future have use same in many places ignoring itextsharp moment, try following code on production server, replacing url problem url. using(var w = new system.net.webclient()){ w.downloaddata(@"https://siteurl.com/pdf/11111111.png"); } if gives exception server having problem talking host specified. sometimes, nat/firewall rules have problems using external resolut...

plsql - Calling a stored proc from perl -

i running subroutine main script. print "parameter passed: $_[0]"; $connect_string = 'test/test@testdb'; $sqlplus_settings = ''; $task = ''; $result = qx { sqlplus $connect_string << eof $sqlplus_settings exec {pkgname.procedure($_[0], 'abc',$task); #exit; eof when getting called main script {sub($var)} , printing first line input parameter. procedure not getting executed. as mentioned user @choroba in comments above, best way imho use perl's dbi module. here example of calling stored procedure work oracle: $dbh->do("begin your_procedure; end;"); and here link started dbi module: perl dbi hth

asp.net - How to send List of objects to google execution api and handle it in google apps script -

in general want export data asp.net mvc application google sheets example list of people. i've set connection , authenticated app google account (trough oauth2) i'm trying send list of objects api , handle in script (by putting data in new file) , couldn't head around this. here sample code in app sends request. public async task<actionresult> sendtestdata() { var result = new authorizationcodemvcapp(this, new appflowmetadata()). authorizeasync(cancellationtoken.none).result; if (result.credential != null) { string scriptid = "my_script_id"; var service = new scriptservice(new baseclientservice.initializer { httpclientinitializer = result.credential, applicationname = "test" }); ilist<object> parameters = new list<object>(); var people= new list<person>(); // next i'm sele...