Posts

apache - PHP Soap issue while content length is larger -

we have developed soap based webservice post data third party webservice. accepts 4 params. in 1 of parameters accepts xml string no size limit restriction put in place. the webservice works fine in local environment running on php 5.2 , apache2. works content length long 10 mb. in staging server running nginx , php fpm.we have updated max post size , max upload filesize in php.ini , client_max_body param in nginx.conf allow upto 50 mb. but webservice client keeps on loading in staging environment. gives 502 timeout , gives soap error. can me understand issue here?

knockout.js - KnockoutJS Changes Model to Controller -

i have dropdownbox binded videmodel foreach <td> <input class='required' type="text" data-bind="value: muhasebekodu" id="muhasebekodu" /></td> <td> <select data-bind="options: gidertipleri, value: selectedoptionvalue" onchange="setcodefield(this.value);" id="muhcodes" name="muhcodess"></select></td> and model this var self = null; var viewmodel = null; $(document).ready(function () { var giderlers = json.parse(document.getelementbyid('contentplaceholder1_hdnoutgoingtypes').value); var selectedgider = document.getelementbyid('contentplaceholder1_hdnoutgoingtypesselected').value; var odemetipleri = json.parse(document.getelementbyid('contentplaceholder1_hdnfirmpaymenttypes').value); var selectedodemetipi = document.getelementb...

java - Get more than One value and display it -

i checking 'n' number of servers every minute, if servers down mail triggered user server name down. issue facing if more 1 server down getting 1 server name down. how name of servers down. obj = dataaccess.getservers(); //getting status , links of servers mailserver sender = new mailserver(from,password); list<string> downserver = new arraylist(); (map<string, string> objs : obj) { //iterating each server serverstatus = objs.get("status"); if (serverstatus.equals("down")) { servername = objs.get("name"); statusserver=objs.get("status"); } downserver.add(servername); if(!(servername.equals(null))){ sender.sendmail("server status",downserver.get(i),from,to) } without checking reasonability of code or trying improve anything, code should little more following (at least) come clo...

javascript - Complete OpenIDConnect auth when requesting via Ajax -

the normal openidconnect server works like: you go a.com/secure-resource you 302 server your browser handles , sends identity server you login there it sends a.com via post you logged in on a.com , a.com/secure-resource on browser. however have scenario i'm trying solve need help. the user logged in on idserver the user logged in on a.com the user not logged in on b.com we need send ajax call web server b.com (from domain a.com ) b.com configured use openidconnect. but because request b.com via ajax, user cannot redirected idserver. (all in response 302 ) we can go ahead , handle 302 via ajax (i'm still not sure whether work, security-wise). but is there scenario in identityserver/openidconnect designed these situations? with identityserver in scenario setup server b.com use bearer token authentication, need use access token provided a.com in headers of ajax call $.ajax({ url: 'http://b.com', headers: { ...

c# - Replace text in MailItem Body -

i've added ribbon button in outlook explorer, creates new email selected email when clicked. works fine using mailitem.copy method. need replace text in message body different value. the problem email html/richtext formatted email , contain text formatting and/or pictures. , replacing text value in body property loses text formatting , pictures. so code below no good newmailitem.body = newmailitem.body.replace("old value", "new value"); and i've tried loading html , rtf value devexpress richeditcontrol , used richeditcontrol.document.replaceall method try , replace text occurrences. devexpress richeditcontrol changes/formats rtf / html value differently , causes message wrong when html / rtf set in mailitem. i've tried replacing text getting reference word document (see code below). doesn't work either. inspector inspector = newmailitem.getinspector; if (inspector.iswordmail()) { microsoft.office.interop.word.document worddocument...

Where does a browser event's timeStamp come from in Javascript? -

event objects passed event handler callbacks contain event.timestamp of when event occurred, timestamp produced? bubbles underlying os, or generated browser? i'm interested in gauging reliability of timestamp , recognise later timestamp produced less accurate it's be. also, way in timestamp produced vary between platforms , browser implementations? thanks. according dom4 specification §4.2 , it's assigned when event created (you have scroll down bit): the timestamp attribute must return value initialized to. when event created attribute must initialized number of milliseconds have passed since 00:00:00 utc on 1 january 1970, ignoring leap seconds. which leads question of: when event created? can think of 3 times might done: when os notifies browser when javascript main ui thread next able anything when javascript main ui thread dispatch task related event using snippet below, @ least click event, seems vary browser: chrome seems assi...

c++ - Synchronization mode in mutex protected block -

http://www.boost.org/doc/libs/1_58_0/doc/html/atomic/usage_examples.html in "singleton double-checked locking pattern" example of above boost examples, memory_order_consume second load of _instance , memory_order_release store of _instance necessary? thought scoped_lock has acquire , release semantics , first load of _instance has synchronization mode memory_order_consume. under assumption boost primitives used here support same functionality std counterparts, second load not require memory_order_consume since guaranteed synchronized store/release based on acquire/release semantics of mutex , right that. perhaps, use of memory_order_consume based on false assumption load/relaxed may float across mutex/acquire barrier, not possible per mutex guarantees , such memory_order_relaxed fine. the store/release on other hand absolutely necessary because synchronizes first load/consume not protected mutex .

ios - Determining maximum font size for UITextView -

is possible determine maximum font size uitextview keeps texts inside without cropping, while containing text set , constant. note : i'm using custom fonts, , swift. you can calculate height of content .then resize frame. cgsize strsize= [textview.text sizewithfont:[uifont systemfontofsize:17.0] constrainedtosize:cgsizemake(290.0,99999.0)]; frame.size.height = strsize.height

Need information on SQL Injection in ASP.Net MVC 4 -

Image
i have report generated ibm appscanner tool. scanned mvc application , on urls gave me high alerts. i'm trying figure out how perform parameter manipulation on page above information provided in report find issue. example of link on above report based : localhost:46887/myproject/country/edit/1 as rule of thumb: aways cast values (provided through request) concrete type using in application logic. if using orm/odm access data storage recieve built in sql injection protection :). tool may examins the query string , assumes injection possible.

java - Gridview not scrolling: Android -

<?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <textview android:layout_width="fill_parent" android:layout_height="wrap_content" android:id="@+id/textviewselectalbum" android:layout_margintop="16dp" android:textsize="16dp" android:textcolor="@color/link_text_material_dark" android:text="select album" /> <spinner android:id="@+id/spinnerselectalbum" android:layout_width="wrap_content" android:background="@color/link_text_material_dark" android:layout_margintop="12dp" android:popupbackground="@color...

imagemagick - what is best way to rotate an image using php or convert command? -

what best way rotate image using php or convert command? use php function imagerotate http://php.net/manual/en/function.imagerotate.php example: <?php // file , rotation $filename = 'test.jpg'; $degrees = 180; // content type header('content-type: image/jpeg'); // load $source = imagecreatefromjpeg($filename); // rotate $rotate = imagerotate($source, $degrees, 0); // output imagejpeg($rotate); // free memory imagedestroy($source); imagedestroy($rotate); ?>

python - Django custom command error: unrecognized arguments -

i'm trying create command similar createsuperuser take 2 arguments (username , password) its working fine in django 1.7 not in 1.8. (i'm using python3.4) this code wrote myapp/management/commands/createmysuperuser.py from django.core.management.base import basecommand, commanderror django.contrib.auth.models import user class command(basecommand): = 'create super user' def handle(self, *args, **options): if len(args) != 2: raise commanderror('need 2 arguments username , password') username, password = args u, created = user.objects.get_or_create(username=username) if created: u.is_superuser = true u.is_staff = true u.set_password(password) u.save() else: raise commanderror("user '%s' exist" % username) return "password changed user '%s'" % u.username and when try run command $ ...

JavaScript Multidimensional Array - Object Linking -

i working javascript multidimensional array. here scenario:- i have educational institution user can take classes subject. subjects not fixed vary. there exam day suppose there php lang faculty enter subject name student name , marks. if student enrolled himself more 1 subject marks listed in same row. for example mr. anand has enrolled php , html , mr. deep has enrolled himself php only. additionally want show minimum , maximum marks well. so on result day result card name\subject | php | html | java -------------------------------------- anand | 80 | 60 | -- deep | 70 | -- | -- sachin | 55 | 56 | 45 on ... | -- | -- | 80 -------------------------------------- min marks | 70 | 56 | 45 max mark | 80 | 60 | 80 i have created multidimensional array unable reproduce code per visual. think doing wrong. below code have created of :- var data = [ ["html", [{ "...

css3 - Styling HTML5 Progress Element as Circle/Pie -

html5 introduced new "progress" element default rendered progress bar (thermometer). a basic example is: <progress max="100" value="85"></progress> i have been experimenting variety of progress circle options using javascript, , have been impressed pure css approaches discussed here: css progress circle i interested know if has applied css "progress" element provide pie/clock/circle rendering rather linear display? edit/addendum: "meter" element quite similar "progress" provides low/high range...i mention more might stumble upon post in future , want apply similar technique html5 meter element.

javascript - How to add css to dynamically created tables -

html <div class="wrapper"> <div class="profile"> <div id='entrydata'></div> </div> </div> javascript <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> <script> $(function() { var dmjson = "data.json"; $.getjson(dmjson, function(data) { $.each(data.records, function(i, f) { var $table = "<table border=5><tbody><tr>" + "<td>" + f.clue + "</td></tr>" + "<tr><td>" + f.answer + "</td></tr>" + "<tr><td>" + f.status + "</td></tr>" + "<tr><td> " + f.views + "</td></tr>" + "</tbody>&nbsp;&nbsp;&nbsp;</table>" $("#entrydata...

jquery - I am trying to swipe my images in an image gallery.i am trying to do this on this site.( http://klaret.dk/ ) But my swipe function doesnt work -

i trying swipe images in image gallery.i trying on site.( http://klaret.dk/ ) swipe function doesnt work. here code using.i have added jquery library aswell jquery mobile ui library. still doesnt work $(document).on("pagecreate", function(){ alert("here"); //alert($('.fs_gallery_wrapper').html()) $(".fs_slide").on("swipe", function() { alert("hello"); }); }); i did , worked. awesome. <script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script> <script type="text/javascript"> $(document).on("swipeleft",'.fs_gallery_wrapper', function(){ //alert("here"); nextslide(); }); $(document).on("swiperight",'.fs_gallery_wrapper', function(){ //alert("here"); prevslide(); }); </scri...

c# - Inconsistent Accessibility -

i have taken simple interface public interface ibinaryhelper { tobinary converttobinary(string pathbinary); } i trying access in class below it public class apihelper : ibinaryhelper { private readonly restclient _client; public tobinary converttobinary(string pathbinary) { tobinary binary = null; var request = new restrequest("sampleapi/converttobinary/{pathbinary}", method.get) { requestformat = dataformat.json }; request.addparameter("pathbinary", pathbinary, parametertype.urlsegment); var response = _client.execute<tobinary>(request); binary = response.data; return binary; } } now when build it, error getting error inconsisten accessibility: return type apihelper.tobinary less accessible method apihelper.apihelper.converttobinary(string) @ converttobinary method both in interface , in class you returning object of type tobinary public method on public class....

Translate PDF file using Google Translate API -

Image
i want use google translate in project. completed formalities google. have api key me. key can translate word javascript. how translate pdf file can in google translate site? found 1 thing this: http://translate.google.com/translate?hl=fr&sl=auto&tl=en&u=http://www.example.com/pdf.pdf but here cannot use key, result takes time translate. want use key , translate pdf file. please me out. approach this: 1. 1 html page have. 2. 1 browse button pdf 3. upload file 4. transalte pdf google api , show in html page. i searched pdf translate did not find anything. please me out. tl:dr : use headless browser render pdf google's pdf translation service. pdf complex format , can include many components text. translate describe solution easy 1 more advanced. translate raw text if need translation without visual output, can extract text , give google translate. since did not provide information on project (language, environment, ...) redirect thread o...

html - Place a div along border edge of div -

Image
in web application, wanted place small div along border edge of div this: this code: <div style="border:1px solid black; height:1em; width:10em;"> <div style="border:1px solid black; display:inline-block; height:10em; width:10em;"> along edge </div> </div> how can done? following way can it. make main div position:relative , along edge div position:absolute main div. , give top , right sub div. .main{ border:2px solid; position:relative; width:400px; height:150px; top:50px; } .sub{ border:1px solid; position:absolute; right:10px; top:-10px; z-index:99; background-color: #fff; } <div class="main"> main div <div class="sub"> along edge </div> </div> hope helps.

PHP Split string with exception -

i have string need split out : 3,1,'2015,05,14,11,18,0', 99 i want split 3 1 '2015,05,14,11,18,0' 99 how php ? one of comments (@tuananh in particular) said csv parser , little bit of trial, fgetcsv work too, you'll got have temporary file holds simple string, unlink after operation. just set enclosure single quotes when parser breaks up, gets whole string enclosed single quotes. $string = "3,1,'2015,05,14,11,18,0', 99"; file_put_contents('temp.csv', $string); // create temporary file $fh = fopen('temp.csv', 'r'); // open $line = fgetcsv($fh, strlen($string) + 1, ',', "'"); // set enclosure single quotes fclose($fh); unlink('temp.csv'); // remove temp file print_r($line); // array ( [0] => 3 [1] => 1 [2] => 2015,05,14,11,18,0 [3] => 99 ) // echo implode("\n", $line); sidenote: if indeed csv file, use fgetcsv whole thing. edit: @deceze said use...