Posts

Showing posts from July, 2012

java - How to work with woocommerce API in android without using PHP codes -

i'm developing app android woocommerce online shop. want work woocommerce api , authenticate http . searched on web , of programmers using php codes connect woocommerce api , gson php code. way gson woocommerce api directly in android code? i'm using android studio. tnx there's no reason can't contact wc api directly android without needing go through php. return json object regardless of language use contact it. the better question "why other programmers use php it?" , there 2 potential reasons it. the first reason they're developing php platform they're never sending response onto android system they'd ever using php. the second reason it's easier update php platform update android one. if find in situation need change how api calls work can't guarantee android platforms updated in time (because can never guarantee that) can easier have android contact own server passes call onto wc api. for example of second scenari...

configuration - configuring AEM dispatcher 6.2 CSRF filters -

i trying follow instruction on adobe checklist, there no examples on how configure filter or test works. looking insight , example of how should work on dispatcher. the dispatcher checklist /0084 { /type "allow" /path "/libs/granite/csrf/token.json" /extension '(json)' } i assume correct have no way of verifying. no idea how can create filter for: creating filter allow csrf-token header appreciate in advance this should work you: /filter { ... /0084 { /type "allow" /glob "get /libs/granite/csrf/token.json*" } }

Django: can't override get_FOO_display() -

i have field called status . want pluralize status, write def get_status_display(self): return dict(status_choices).get(self.status) + 's' in template write {{ object.get_status_display }} function not invoked. what doing wrong?

android - How to get authenticated users from firebase database? -

i'm creating app using firebase messaging service. messaging working fine, wish make happen between 2 users. i believe need provide authentication each user search connections(their friends via social network connections or mail ids). i managed create google+ authentication in app using auth.google_sign_in_api , appinvite.api, connecting other users in firebase had no clue, went through these links udacity tutorial , codelabs tutorial , firebase guides . (the tutorials explained same thing , every 1 authenticated using email provider, , not via google+ signin. , matter fact when tried google+ signin via these procedures, didnt work, email provider working.) anyways email provider me of still don't have clue how connect 2 users thriugh firebase. connected 2 users, showing in firebase authentication console how connect 2 user 1 one? any clues?? to make connection between 2 users in social network, typically 1 of them has enter "secret" details...

Java merge same numbers via multiplication in an array with Recursive -

i wanna write method merges same values within array via multiplication. wanna recursive. sequence of numbers should merged, if there similar numbers withing it. example if have numbers 1, 2, 5, 5, 4, should become "1 2 25 4" or 5, 5, 5, 6 becomes ”125 6”. can help? this approach utilizes divide , conquer, , should run in o(n log n). package edu.gwu.seas.cs6212.hw3; import java.util.arraylist; import java.util.list; import java.util.map; import java.util.iterator; import java.util.map.entry; import java.util.treemap; public class tester { public static void main(string [] args){ system.out.println("merging 1, 2, 5, 5, 4: "); int [] originalarray = {1, 2, 5, 5, 4}; int [] mergedarray = mergesequences(originalarray); stringbuilder sb = new stringbuilder(); for(int element : mergedarray){ sb.append(element); sb.append(","); } sb.deletecharat(sb.length()-1); ...

Getting error in while controller expression in Jmeter -

i getting exception in while controller using jmeter-maven-plugin. expression: ${__javascript("${type}" != "reports" && ${counter} < 300;)} error - jmeter.functions.javascript: error processing javascript: ["${type}" != "reports" && ${counter} < 100;] org.mozilla.javascript.evaluatorexception: missing ; before statement (<cmd>#1 there nothing wrong while controller expression. given see ${type} , ${counter} in log instead of real values type , counter variables not set double check way you're setting variables , verify values using debug sampler , view results tree listener combination. see how debug apache jmeter script article more information on jmeter tests troubleshooting.

angular - How to inject FirebaseApp in Angular2 service to use firebase.storage() with AngularFire2 -

i'm using angularfire2 version 2.0.0-beta.6 i wrote database.service angularfire injection (see extract database service code). it's ok usage. but i'd integrate usage of firebase storage() api. can't inject firebaseapp in constructor's service use in component : constructor( @inject(firebaseapp) private firebaseapp: any) {} extract of database service : import { injectable } '@angular/core'; import { angularfire, firebaseapp, firebaselistobservable } 'angularfire2'; @injectable() export class databaseservice { constructor(private af: angularfire) { this.init(); } ... service function } some help, please. laurent

BizTalk map functoid vs BizTalk map xslt -

i using biztalk map , inside biztalk map using table looping, table extractor, scripting, looping functoids. the same can achieved in biztalk map referencing xslt. so performance wise, method better using biztalk map or biztalk map referencing xslt. in fact, visual biztalk map created biztalk mapper, xslt. functoids libraries/functions may either xslt or inline c# code. 1 way can check right click .btm map , click 'validate'. in output window, see link xslt file. performance tricky xslt. can write xslt in way or in way it's not meant used. pretty basic mapping, performance differences there, pretty minor (if @ all). dijkgraaf says: way check this, test it. if current implementation gives performance issues, try writing purely xslt, optimized either way. try taking different approaches/techniques. in general, recommend writing xslt instead of using mapper, let's honest: personal preference. wrote blog post on this, check out here: https://pvandenhe...

html - Prestashop address form no longer displays state or post/zip code -

as title suggests, having problem regarding address form. second website build using prestashop platform , first encounter problem. i have set country address format follows (same previous website): firstname lastname company vat_number address1 address2 city postcode country:name phone phone_mobile however, on frontend/ frontoffice displays as: firstname lastname company vat_number address1 address2 country:name phone phone_mobile now may confused here , believe address format related invoicing , database records, might looking in wrong place configuration. this major problem use addon/plugin allows link specific postcodes zones/states, no carriers display seems postcode field/value not taken account.

maven - Resize image from pom.xml -

at moment i'm working on maven project , i'm filling list of developers , contributors in pom.xml. in addition name, email , role of developer/contributor want add image of person. in order write: <developer> ... <properties> <picurl>url_to_image</picurl> </properties> </developer> but unfortunately picture url big. question is: possible somehow resize it? maybe there properties ? this not manage within pom. if possible resize , re-upload images update urls.

c# - Can't delete or rename original file after resizing -

this function return resized , centered image, , execute calling url thumb.aspx?image=test.jpg&width=100&height=50 problem after execution , i can't rename or delete original file server. <%@ import namespace="system.drawing" %> <script language="c#" runat="server"> void page_load(object sender, eventargs e) { try { response.cache.varybyparams["image;width;height;needtofill"] = true; response.contenttype = "image/jpeg"; system.collections.hashtable imageoutputformatstable = new system.collections.hashtable(); imageoutputformatstable.add(system.drawing.imaging.imageformat.gif.guid, system.drawing.imaging.imageformat.gif); imageoutputformatstable.add(system.drawing.imaging.imageformat.jpeg.guid, system.drawing.imaging.imageformat.jpeg); imageoutputformatstable.add(system.drawing.imaging.imageformat.bmp.guid, system.drawing.imaging.imageformat.gi...

json - Querying JsonPath subnode -

considering following node { "list": [ { "property": [ { id: "1" }, { id: "2" } ] } } i'd consider list property.id = 1 , return list nodes. tried with: $.list[?(@.property[*].id=='1')] but id doesn't work. then tried with: $.list[*].property[?(@.id=='1')] this work, need return list, , not property value any help?

unity3d - Simple Unity5 LAN game, server updating clients are not -

i making simple lan game bearings in unity networking. supposed when player clicks on square in grid, changes blue. issue when lan host clicks on square, updates locally , doesn't update clients. when client clicks on square, updates locally , lan host gets updated, other clients not updated. of grid pieces have network identity attached them any ideas? heres code: using unityengine; using system.collections; using unityengine.networking; public class player_paint : networkbehaviour { [syncvar]gameobject syncgridpiece; gameobject gridpiece; void update () { paint(); transmitgridcolours(); } void paint(){ if(islocalplayer && input.getmousebuttondown(0)){ raycasthit2d hit = physics2d.raycast(camera.main.screentoworldpoint(input.mouseposition), vector2.zero); if(hit.collider != null){ print(gameobject.find ...

python - Is there a security risk to serve Django admin page on regular http rather than Https? -

i finished first experience django on real application , running on apache2. since newbie wondering if right have admin page served on http? is https better solution? how of risk experiencing not having run on https? you can better understand here django security

Hide/Show nicEdit using buttons -

i have following nicedit: <div class="col-xs-6 col-sm-6 col-md-6 col-lg-6"> <script type="text/javascript" src="../nicedit.js"></script> <script type="text/javascript"> bklib.ondomloaded(function() { niceditors.alltextareas() }); </script> <h4 style="text-align:center;">generate job overview</h4> <p> within overview, please make note of necessary information, conditions, expectations , etc better assist freelancer review. </p> <textarea id="createjob" name="area3" class="col-xs-8 col-sm-8 col-md-8 col-lg-8" style="width: 100%; height: 50%;"> html <b>content</b> <i>default</i> in textarea </textarea> <button type="submit" class="btn btn-primary" onclick="edittexteditor()" style="background-color:#006...

angular - How to listen to children elements events in a directive? -

since there no template, what's best way listen child elements event in directive? possible hostlistener ? if not, there other way? there's similar question: how listen child event parent directive in angular2 , suggested approach not solve problem, directive , child element aren't in same template (directive on host). cheers! edit #1 this how i'm doing (there has better way): first injecting elementref directive: constructor(private elview: elementref) {} then binding jquery (or plain js): $(this.elview.nativeelement) .on('drag', '#childid', this.slide.bind(this)) if event want listen native dom event bubbles, can use @hostlistener() @hostlistener('click', ['$event']) handleclick(event) { // handle event } if outputs of child components, can query them , subscribe outputs @contentchildren(childcomponent) children:querylist<childcomponent>; ngaftercontentinit() { this.children.toarray().forea...

arrays - Javascript : ask an explanation -

here's full code: function longestword(sen) { // use regex match function searches string // pattern , returns array of strings finds // in our case pattern define below returns words // characters through z , 0 through 9, stripping away punctuation // e.g. "hello$% ##all" becomes [hello, all] var arr = sen.match(/[a-z0-9]+/gi); // array sort function takes function parameter // used compare each element in array // next element in array var sorted = arr.sort(function(a, b) { return b.length - a.length; }); // array contains words in original // string in order longest shortest length // return first element return sorted[0]; }longestword("the $$$longest# word coderbyte"); but need explain part : var sorted = arr.sort(function(a, b) { return b.length - a.length; }); i understand how function , sort works, kinda mixed , brain crashed. , can give me simple alternative solve problem >> longest word,...

Unknown error using fprintf in matlab script -

ther's script i'm using extract radar data , in final lines of code it's giving me error: error using fprintf function not defined cell' inputs. tell me where's error or rid of it? thank much here's code: %% ecriture des résultats savefile = strcat(debut(1:13),'_',fin(1:13),'_mean_bv.csv'); % nom et extension du fichier sauvé pathname = strcat(pwd,'\time-series_extracted\',savefile); % emplacement du fichier sauvé % écriture des têtes de colonnes (id des fichiers de la série temporelle définie. fileid = fopen(pathname,'w'); fprintf(fileid,'%s\r\n',header); fclose(fileid); % écriture supplémentaire de la matrice générale. dlmwrite(pathname,mean_bv,'-append','delimiter',';'); toc

android - NDK-STACK stack frame not useful -

ndk-stack give output: build fingerprint: 'intel/inet_alc5651_64/inet_alc5651:5.1.1/lmy47v/inet-soft0504291459:userdebug/release-keys' pid: 30534, tid: 30557, name: glthread 2273 >>> xxx <<< signal 11 (sigsegv), code 1 (segv_maperr), fault addr 0x18 stack frame #00 pc 001a26a3 [anon:mem_0x20000000] stack frame #01 pc 0000302f [anon:mem_0x10002002] it not obvious. not find error memory address. why output above ?

php - Instagram api pagination object is coming blank ( empty ) in live mode -

we facing major issue on instagram api calling section using php (codeigniter 3). first of want tell our app in in live mode , sure of . pagination url object coming blank after 20 images , have tried different ways using count parameter on section , next_max_id , next_min_id in vain. please suggest new way section. can not use javascript on section according our requirements. some of small example below how e call api , using. https://api.instagram.com/v1/users/self/media/recent/?access_token=3963420514.440235f.df3a5b4f9d6546cb9512ffd0a13ae62f&count=13 https://api.instagram.com/v1/users/3963420514/media/recent ? thank in advance. i checked api response has pagination data just use pagination.next_url next set of 13 posts via api, tried it, worked api above. if not can maually add &max_id={value of pagination.next_max_id} api next set of posts

javascript - After script Geocoder form is empty -

i have 2 fields results, 1 field input: address. after clicking on button, convert() being called. it checks googleapi longitude , latitude of given address , sets (normally hidden) 2 fields found values. after form submits, throws out values being set. split moment, before submits takes place, see fields being set right values, , after submit values gone. its hard explain how know that, because html it's being handled sort of asp-solution, remembers values of field , holds on it. in example, if remove submit button , replace non submit element, after click script works , fields being set. so why, values of field not being submitted server? again, values set first, , than, form being sumbitted. best regards, simon <script type="text/javascript" src="http://maps.google.com/maps/api/js?key=aizasybw2vzup4f6ykbp-bdoneuedgpfhv8mpfm"></script> <script type="text/javascript"> function convert(){ var geocoder = new google....

javascript - WebSocketException: "I/O operation has been aborted" -

trying implement basic websockets channel javscript client , asp.net server. client code goes: function connect() { var ws = new websocket("ws://" + window.location.host + "/callback.aspx"); ws.onmessage = function (a) { alert("message"); }; ws.onopen = function (a) { alert("open"); }; ws.onerror = function (a) { alert("error"); }; } callback.aspx basic asp.net web page, , goes: protected void page_load(object sender, eventargs e) { if (httpcontext.current.iswebsocketrequest) { httpcontext.current.acceptwebsocketrequest(socketproc); } } private static async task socketproc(aspnetwebsocketcontext a) { try { arraysegment<byte> buffer = new arraysegment<byte>(new byte[1024]); while (true) { websocketreceiveresult res = await a.websocket.receiveasync(buffer, cancellationtoken.none); if (a.websocket.state != websocketstate.open)...

How to copy textbox value in a word document into a textbox in a different word document with VBA (MS Word 2003) -

hopefully easy question. i have 2 word documents (ms word 2003), each document has text box object. upon pressing command button, want text in text box in 1 document ("reference_text.docx") go text box of document. below shows code trying use in event when command button pushed. trying have text box (txtlocation_analysis) populated text in "txtlocation_analysis_1", in reference_text.docx file. dim objword word.application dim wd word.document set wd = objword.documents.open("c:\users\tim\desktop\reference_text.docx") thisdocument.txtlocation_analysis.text = '(want call "txtlocation_analysis_1.text" wd document) let me know if makes sense - , if can provided please :) hugh did try thisdocument.txtlocation_analysis.text = "txtlocation_analysis_1.text" ' or thisdocument.txtlocation_analysis.text = wd.txtlocation_analysis_1.text ' b sorry, wording it's still not clear me think want either (...

javascript - How can I send my json to my view with node js -

i have previous question take here . i can login spotify , playlists of user loged in. want send these playlists (they in json) view of html page or ... this code looks like: app.get('/playlists', function(req, res) { var state = generaterandomstring(16); res.cookie(statekey, state); var scope = 'playlist-read-private'; var options = { url:"https://api.spotify.com/v1/me/playlists", headers:{ 'authorization': "bearer " + token, 'response_type': 'code', 'client_id': client_id, 'scope': scope, 'state': state }, json:true }; request.get(options, function(error, req, body){ console.log(body); //here want send json view res.send(body); }); }); the problem code " res.send(body); " url: localhost:8888/playlists , in page see json. send view can chose info show. can me this? thanks in advance in case, can use...

android - Background image causing lag and frame skipping -

i have simple layout in want background image. first tried put background image through xml there lag. so followed set image through asynctask still no luck. image of 1131 x 1800 resolution , size 369kb. i/choreographer: skipped 33 frames! application may doing work on main thread. i/choreographer: skipped 37 frames! application may doing work on main thread. i/choreographer: skipped 34 frames! application may doing work on main thread. i/choreographer: skipped 34 frames! application may doing work on main thread. i/choreographer: skipped 34 frames! application may doing work on main thread. java file public class mainactivity extends flights{ @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); new loaddrawable().execute(); } private class loaddrawable extends asynctask<drawable, void, drawable> { @override protected drawable doinbackground(drawable... p...

regex - Regular expression to match a line containing only the list of words -

looking regular expression match given list of words in strings the regular expression pattern match strings containing boy or apple in below list of strings [apple, boy, apple, boy] [boy, boy, boy, boy] [apple, boy, boy, boy] to match [apple, boy, apple, boy] [apple, boy, boy, boy] try if works: (?=.*apple)(?=.*boy).*

excel - How to generate a CSV for a given range on a click of form button? -

i generating csv using form button. button click code looks this: with activesheet lfnum = freefile sfname = mypath & myfilename open sfname output lfnum each rrow in range(range("a1"), range("h1").end(xldown)).rows each rcell in rrow.cells soutput = soutput & cstr(rcell.value) & sdelim = + 1 next rcell soutput = left(soutput, len(soutput) - len(sdelim)) print #lfnum, soutput soutput = "" next rrow close lfnum this code takes sometime generate csv file 1 million records in columns a:h. how can make faster? , how exit form once complete?

asp.net - Current windowsidentity same as currentrequest user identity with windows authentication -

i have weird issue windows authentication. have asp.net webforms application in have single folder uses windows authentication. folder correctly configured windows authentication in iis. application uses .net impersonation via web.config. when navigate page in folder using windows authentication the: system.web.httpcontext.current.user.identity.name returns name of user doing request (this expected) system.security.principal.windowsidentifier.getcurrent.name returns name of user under application runs (this expected) now have been working on new version of our product long time. , find out behavior has changed. when perform same test again both httpcontext user name , principal.windowsidentity.getcurrent return name of user performing request. we have checked relevant code , cannot seem find difference has behavior. converted application .net 4.0 .net 4.5.2 in new version, however, when convert old version .net 4.5.2, behavior stays correct (the 2 properties show different...

R - Converting a Function to String -

i working on function behave similar reduce pass in function , dispatch on arguments. here simple example demonstrate working on. fun <- function(f){ switch(f, `+` = "addition", stop("undefined") ) } fun(`+`) now won't work stands because switch requires character or numeric expr . don't know how convert function f passed fun string . one approach capture input , deparse call. fun <- function(f){ switch(deparse(substitute(f)), `+` = "addition", stop("undefined") ) } fun(`+`) #[1] "addition"

c# - Select entities with multiple and nested levels without using Include -

i have following entity: public class item { public int id { get; set; } public int? parentid { get; set; } public item parent { get; set; } public list<item> children { get; set; } public double propertya { get; set; } public double propertyb { get; set; } ... } now want query database , retrieve data of nested children. achieve using eager loading include() : var allitems = dbcontext.items .include(x => children) .tolist(); but instead of eager loading, want following projection: public class projection { public int id { get; set; } public list<projection> children { get; set; } public double propertya { get; set; } } is possible retrieve desired data single select? using entity framework 6.1.3. edit: have tried far. don't know how tell ef map child projection same way parents. an unhandled exception of type 'system.notsupportedexception' occurred in...

powershell - Tail a log file and if match trigger an actrion -

i using following line of code return recent line of log via powershell get-content -path c:\folder\thisisalog.log -tail 1 -wait | {$_ -match "remote_http"} this works correctly , write console each time log matches "remote_http" logged. however run script when returned. far have tried add variable , check if null no luck , have tried using if statements no success. trying both of these script runs indefinitely no output console or triigers. i think may -wait causing issue. just it get-content -path c:\folder\thisisalog.log -tail 1 -wait | % {if ($_ -match "remote_http") {write-host "run code here"}} or directly where get-content -path c:\folder\thisisalog.log -tail 1 -wait | {if ($_ -match "remote_http") {write-host "run code here"}}

Any Idea how to do Session based authentication in laravel 5.3 using vue js and vue router -

my biggest problem authentication my head aches because im using api fetch , send data server using vue so ive tried doing login thing auth middleware kept saying unauthorized logged in so whats problem authentication , how can implement session based authentication? if you're using laravel api, you'll want token-based authentication. main idea use 'api' guard (which uses tokenguard class), instead of default 'web' guard (you can change in congif/auth.php ). way laravel bearer token in authorization header in each request. this decent walk through started, though i'm sure there many other blog posts , tutorials out there. edit: not sure if helpful, here's example using automated test. in modelfactory, have user model api_token attribute set random (and unique) string of 60 characters. simple test make sure can retrieve list of users: /** @test */ public function user_index_endpoint_returns_list_of_users() { $user = facto...

php - Makes preg_grep keep and not reorder the arrays keys after each execution -

i'm trying clean email database imported excel table. there's plenty of bad characters, , 2 or 3 emails in same cell. dont want use direct database solution posted here ( t-sql: checking email format ), because double check eye before excluding it. 1) first got of emails weren't shaped. transformed them on array. note i'm in laravel ecosystem. $contato = db::select("select * emailstable outro_email not regexp '^[a-za-z0-9][a-za-z0-9._-]*[a-za-z0-9]@[a-za-z0-9][a-za-z0-9._-]*[a-za-z0-9]\.[a-za-z]{2,4}$'"); $email_array = json_decode(json_encode($email_database_as_object), true); 2) those, eliminated records not have @ symbol on (empty, null, random phrases), excluding them original array: $corretor = preg_grep("/@/i", array_column($email_array, "email"), preg_grep_invert); foreach ($corretor $key => $value) { $email_array = array_except($email_array, array($key)); } but biggest problem when i'm tr...

java - Convert *.XLSX to .XLS using apache poi -

i have requirement convert *.xlsx (just single sheet image) *.xls. , insert sheet workbook. idea? i use apache poi 3.9, poi-ooxml-3.8, poi-ooxml-schemas-3.9.jar, dom4j-1.6.jar, xmlbeans-2.6.0.jar, nextreports-engine-6.2.jar. and code (it doesn't work): import java.io.fileinputstream; import java.io.filenotfoundexception; import java.io.fileoutputstream; import java.io.ioexception; import java.util.arraylist; import java.util.iterator; import java.util.list; import java.util.set; import java.util.treeset; import java.util.logging.level; import java.util.logging.logger; import org.apache.poi.hssf.usermodel.hssfcell; import org.apache.poi.hssf.usermodel.hssfclientanchor; import org.apache.poi.hssf.usermodel.hssfpatriarch; import org.apache.poi.hssf.usermodel.hssfpicture; import org.apache.poi.hssf.usermodel.hssfpicturedata; import org.apache.poi.hssf.usermodel.hssfrow; import org.apache.poi.hssf.usermodel.hssfshape; import org.apache.poi.hssf.usermodel.hssfsheet; im...

Can an Android-App-Restricted API key be used for Google Distance Matrix? -

Image
i enabled google distance matrix api , restricted key android apps because sending http queries android app receive json response: without restriction, works , expected result. when it's restricted (with package name , sha1) failure message in json object "request_denied" status saying: this ip, site or mobile application not authorized use api key. request received ip address [ip_addr], empty referer. from other posts understand distance matrix api must used server key , in new google console there's no option server key ; create key , choose restriction above. firebase console creates server key , can use in android app without restriction. so how restrict key using distance matrix api android app? please note android app restriction valid google maps android api v2 , google maps places android. web services (e.g. distance matrix api) not work restriction. the restrictions work api keys web services ip restrictions. it supposed web s...

kubernetes - Using Weave's Kubenetes YAML file, how can I ensure that Weave uses the local interface? -

i try install kubernetes ⁠⁠⁠⁠kubeadm ⁠⁠⁠⁠. moreover, install pod network with kubectl apply -f https://git.io/weave-kube as recommended on http://kubernetes.io/docs/admin/addons/ when click on “weave net”. works, have 2 interface cards per node: 1 internet , 1 lan between nodes. how can assure weave uses interface lan? on each node, own /etc/hostname should resolve internal ip through entry in /etc/hosts . way, kubernetes uses internal network inter-node communication default.

c# - Checkbox and Radio button problems with asp.net core -

i trying develop online examination tool work. have class defines exam contains list of questions, class question contains list of answers, , class answer. have view model pulls out list of questions , passes view array of ints hold value of answer each question. in view, loop through questions, , in each question loop through each possible answer. multiple choice, easy. use: <input asp-for="selectedanswer[q]" type="radio" value="@a" />@model.questions[q].answers[a].answertext this works great, passes selectedanswer int array the controller on submit , can whatever want it. problem comes down if question requires checkboxlist multiple right answers. cant use same int array post answer, hought creating second bool array each of checkboxes in question , send back. works 1 question each new question overrides bool array on postback. what trying figure out how have different types of questions can displayed on single page, , sent controller whe...

Submitting a form at 3 different times using PHP -

sorry if not clear, ill try best make clear possible. i'v got 2 php files, 1 file called " form.php " has form, , other 1 called " submit.php " action form. there field called " how many times: " has options( 1,2,3 ), , field called " every: " has options( 1 minute, 3 minutes, 5 minutes ) the idea when user select (3 times) , (5 minutes), form submit once every 5 minutes , stop when done submitting 3 times. is cron job way it? if how? thank in advance! there several simple solutions problem. simplest way 1 single cronjob , 1 database. for database recommend sqlite,it faster implement mysql because there no setup , easy handle. the database handles data needed run operation, things like: " how many times: " , " every: ". , cronjob runs every minute check forms need sent. of course database needs handle "extra" information work: id of form job info saved in form counter keep ho...

Reading Xml file in PySpark via Hadoop Streaming -

i'm trying adapt code here scala version pyspark version. here's code i'm using: conf = sparkconf().setappname("parse xml file") sc = sparkcontext(conf = conf) sqlcontext = hivecontext(sc) sc._jsc.hadoopconfiguration().set('stream.recordreader.class', 'org.apache.hadoop.streaming.streamxmlrecordreader') sc._jsc.hadoopconfiguration().set('stream.recordreader.begin', '<page>') sc._jsc.hadoopconfiguration().set('stream.recordreader.end', '</page>') xml_sdf = sc.newapihadoopfile(xml_data_path, 'org.apache.hadoop.streaming.streaminputformat', 'org.apache.hadoop.io.text', 'org.apache.hadoop.io.text') print("found {0} records.".format(wiki_xml_sdf.count())) sc.stop() error i'm getting is: py4j.protocol.py4jjava...

javascript - CKEditor Is Minifying Source -

i've installed ckeditor try edit custom data pages on website, , contrary behavior of ckeditor far, it's minifying html no matter when entering source editing area, undesirable. so input of: <ul> <li> <a href="blahblahblah">something</a> </li> </ul> will if edit in source mode, or if save db: <ul><li><a href="blahblahblah">something</a></li></ul> i have tried several configuration options related html output writer in docs, none of them seem affect this, , default behavior in examples on ckeditor site doesn't this. alas, can't reinstall our instance of ckeditor because it's got custom stuff in used elsewhere on site, need configure option this. does know how tell source editing area not minify source/output?

azure - Document DB - ETag Optimistic Concurrency with Session Consistency -

Image
if have documentdb database session consistency, guarantees there concurrent writes of same document using etags? example, , b operating in different sessions: read:a - etag:1 read:b - etag:1 write:a - etag:1 (match, etag = 2) write:b - etag:1 ? the assumption write:b fails since etag 2, haven't found explicit documentation on guarantee there documentdb reads etag value on server, in, could read secondary replica etag still 1, , let write:b still go through ? this question session guarantee on documentdb discusses issue in comments, not seem come conclusion. web documentation from faq https://docs.microsoft.com/en-us/azure/documentdb/documentdb-faq from example source (implies, not state, holds true @ consistency levels?) https://github.com/azure/azure-documentdb-dotnet/blob/master/samples/code-samples/documentmanagement/program.cs : documentdb team member here. confirming larry's reply conditional writes etags enforced consistency levels. w...

c# - Can I change the database when using selenium? -

i have main project database (and corresponding connection string in web.config). furthermore, test project separate test database (and corresponding connection string in app.config of test project). use test database tests. when run selenium tests iisexpress server uses "main connection string" in web.config instead of "test connection string" in app.config. there anyway tell controller is running in test mode , use different connection string? i using following setup selenium , iis running: _iisprocess = new process { startinfo = { filename = ....iis express\iisexpress.exe, arguments = $"/path:\"{_applicationpath}\" /port:{_iisport}" } }; _iisprocess.start(); chromedriver = new chromedriver(); perhaps can pass variable iis start, can use change connection string when opening database connection? i tried use global variable, not work test , selenium instance runn...

.net - SonarQube Scanner IllegalArgumentException -

after running sonarqube scanner 2.2.0.24 got error message below not @ all. running with d:sonar.log.level=trace flag. any tip on one? \sonarqube.scanner.msbuild.exe end 1>d:\tb\logs\sonar.end.log.20161711.txt 19:20:53.674 error: error during sonarqube scanner execution java.lang.illegalargumentexception: start pointer [line=3, lineoffset=0] should before end pointer [line=3, lineoffset=0] @ org.sonar.api.internal.google.common.base.preconditions.checkargument (preconditions.java:145) @ org.sonar.api.batch.fs.internal.defaultinputfile.newrangevalidpointer s(defaultinputfile.java:254) @ org.sonar.api.batch.fs.internal.defaultinputfile.newrange(defaultinpu tfile.java:238) @ org.sonarsource.dotnet.shared.plugins.abstractsensor$sarifparsercallb ackimplementation.onissue(abstractsensor.java:144) @ org.sonarsource.dotnet.shared.sarif.sarifparser01and04.handleanalysis targetelement(sarifparser01and04.java:109)...