Tuesday, 15 February 2011

visual studio - ASP.Net Vs. ASP -



visual studio - ASP.Net Vs. ASP -

ten years ago or built little web site in asp. wrote in text editor , uploaded files web server. didn't programme web while , work in visual studio 2012 in c#, vb.net , asp.net. questions is, old asp worked in still viable alternative creating web sites? professional consider or has industry moved away it?

i inquire because big project going started year little company work for. looks going handed who's skill-set has never moved past old asp. not lot of programming, capable @ does. seems wrong me, don't know plenty industry outside little world create argument against it.

thanks.

i don't believe has kept sort of industry trends greenish field dev in classic asp. using classic asp closes off lot of avenues , makes life harder. seek finding classic asp developers? it's nightmare. there less , less resources available help develop. had same issues , took section on , implemented mvc , customers far happier. things free validation etc makes far improve apps. can tdd in mvc , not done in classic asp. routing, json, clean separation of concerns, loose coupling, modern orm availability, ide, many benefits of moving modern language.

you can write classic asp reasonably classic asp code have ever seen looks spaghetti.

asp.net visual-studio asp-classic

HIPAA 5010 to csv via XSLT - Loop Path issue? -



HIPAA 5010 to csv via XSLT - Loop Path issue? -

i attempting larn xlst extracting info edi 837/835 files. below place fields specified loop 2100 in cvs format, not fields loop 2110. stylesheet below homecoming fields loop 2110 not 2100. how combine loops homecoming fields both 2100 , 2110 in 1 stylesheet? have tried several options , have been unsuccessful returning fields in csv format. ideas? help appreciated. 835 test file id @ bottom.

<?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl" > <xsl:output method="text" indent="yes"/> <xsl:template match="interchange"> <xsl:apply-templates select="functiongroup/transaction/loop[@loopid='2000']/loop [@loopid='2100']"/> </xsl:template> <xsl:template match="loop[@loopid='2100'] "> <xsl:variable name="trans" select="../../."/> <xsl:variable name="payer" select="../../loop[@loopid='1000a']"/> <xsl:variable name="payee" select="../../loop[@loopid='1000b']"/> <xsl:variable name="payment" select="."/> <xsl:variable name="cas" select="../../loop[@loopid='2110']"/> <xsl:variable name="caxx" select="."/> <xsl:value-of select="$trans/bpr/bpr16"/> <xsl:value-of select="','"/> <xsl:value-of select="$caxx/n1/n102"/> <xsl:value-of select="','"/> <xsl:value-of select="$payee/n1/n102"/> <xsl:value-of select="','"/> <xsl:value-of select="$payee/n1/n104"/> <xsl:value-of select="','"/> <xsl:value-of select="$payment/clp/clp01"/> <xsl:value-of select="','"/> <xsl:value-of select="$payment/clp/clp02"/> <xsl:value-of select="','"/> <xsl:value-of select="$payment/clp/clp03"/> <xsl:value-of select="','"/> <xsl:value-of select="$payment/nm1[nm101='qc']/nm103"/> <xsl:value-of select="','"/> <xsl:value-of select="$payment/nm1[nm101='qc']/nm104"/> <xsl:value-of select="','"/> <xsl:value-of select="$cas/dtm[dtm01='472']/dtm02"/> <xsl:value-of select="','"/> <xsl:value-of select="$payment/cas[cas01='co']/cas01"/> <xsl:value-of select="','"/> <xsl:value-of select="$payment/cas[cas01='co']/cas02"/> <xsl:value-of select="','"/> <xsl:value-of select="$payment/cas[cas01='cr']/cas01"/> <xsl:value-of select="','"/> <xsl:value-of select="$payment/cas[cas01='cr']/cas02"/> <xsl:value-of select="','"/> <xsl:value-of select="$payment/cas[cas01='oa']/cas01"/> <xsl:value-of select="','"/> <xsl:value-of select="$payment/cas[cas01='oa']/cas02"/> <xsl:value-of select="','"/> <xsl:value-of select="$payment/cas[cas01='pi']/cas01"/> <xsl:value-of select="','"/> <xsl:value-of select="$payment/cas[cas01='pi']/cas02"/> <xsl:value-of select="','"/> <xsl:value-of select="$payment/cas[cas01='pr']/cas01"/> <xsl:value-of select="','"/> <xsl:value-of select="$payment/cas[cas01='pr']/cas02"/> <xsl:value-of select="','"/> <xsl:value-of select="$payment/ref[ref01='6r']/ref02"/> <xsl:value-of select="','"/> <xsl:value-of select="$cas/cas[cas01='pr']/cas02"/> <xsl:value-of select="','"/> <xsl:text>&#x0a;</xsl:text> </xsl:template> </xsl:stylesheet> ------------------------------------ <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl" > <xsl:output method="text" indent="yes"/> <xsl:template match="interchange"> <xsl:apply-templates select="functiongroup/transaction/loop[@loopid='2000']/loop [@loopid='2100']/loop[@loopid='2110']"/> </xsl:template> <xsl:template match="loop[@loopid='2110'] "> <xsl:variable name="trans" select="../../."/> <xsl:variable name="payer" select="../../loop[@loopid='1000a']"/> <xsl:variable name="payee" select="../../loop[@loopid='1000b']"/> <xsl:variable name="payment" select="."/> <xsl:variable name="cas" select="../../loop[@loopid='2110']"/> <xsl:variable name="caxx" select="."/> <xsl:value-of select="$trans/bpr/bpr16"/> <xsl:value-of select="','"/> <xsl:value-of select="$caxx/n1/n102"/> <xsl:value-of select="','"/> <xsl:value-of select="$payee/n1/n102"/> <xsl:value-of select="','"/> <xsl:value-of select="$payee/n1/n104"/> <xsl:value-of select="','"/> <xsl:value-of select="$payment/clp/clp01"/> <xsl:value-of select="','"/> <xsl:value-of select="$payment/clp/clp02"/> <xsl:value-of select="','"/> <xsl:value-of select="$payment/clp/clp03"/> <xsl:value-of select="','"/> <xsl:value-of select="$payment/nm1[nm101='qc']/nm103"/> <xsl:value-of select="','"/> <xsl:value-of select="$payment/nm1[nm101='qc']/nm104"/> <xsl:value-of select="','"/> <xsl:value-of select="$cas/dtm[dtm01='472']/dtm02"/> <xsl:value-of select="','"/> <xsl:value-of select="$payment/cas[cas01='co']/cas01"/> <xsl:value-of select="','"/> <xsl:value-of select="$payment/cas[cas01='co']/cas02"/> <xsl:value-of select="','"/> <xsl:value-of select="$payment/cas[cas01='cr']/cas01"/> <xsl:value-of select="','"/> <xsl:value-of select="$payment/cas[cas01='cr']/cas02"/> <xsl:value-of select="','"/> <xsl:value-of select="$payment/cas[cas01='oa']/cas01"/> <xsl:value-of select="','"/> <xsl:value-of select="$payment/cas[cas01='oa']/cas02"/> <xsl:value-of select="','"/> <xsl:value-of select="$payment/cas[cas01='pi']/cas01"/> <xsl:value-of select="','"/> <xsl:value-of select="$payment/cas[cas01='pi']/cas02"/> <xsl:value-of select="','"/> <xsl:value-of select="$payment/cas[cas01='pr']/cas01"/> <xsl:value-of select="','"/> <xsl:value-of select="$payment/cas[cas01='pr']/cas02"/> <xsl:value-of select="','"/> <xsl:value-of select="$payment/ref[ref01='6r']/ref02"/> <xsl:value-of select=",'"/> <xsl:value-of select="$cas/cas[cas01='pr']/cas02"/> <xsl:value-of select="','"/> <xsl:text>&#x0a;</xsl:text> </xsl:template> </xsl:stylesheet>

---------835 file

isa*00* *00* *zz*ashtb *zz*01017 *040315*1005*u*00401*004075123*0*p*:~ gs*hp*ashtb*01017*20040315*1005*1*x*004010x091a1~ st*835*07504123~ bpr*h*5.75*c*non************20040315~ trn*1*a04b001017.07504*1346000128~ dtm*405*20040308~ n1*pr*ashtabula county adamh bd~ n3*4817 state road suite 203~ n4*ashtabula*oh*44004~ n1*pe*lake area recovery center *fi*346608640~ n3*2801 c. court~ n4*ashtabula*oh*44004~ ref*pq*1017~ lx*1~ clp*444444*1*56.70*56.52*0*mc*0000000655555555*53~ nm1*qc*1*fudd*elmer*s***mi*1333333~ nm1*82*2*wecoverwy svcs*****fi*346608640~ ref*f8*a76b04054~ svc*hc:h0005:hf:h9*56.70*56.52**6~ dtm*472*20040205~ cas*co*42*0.18*0~ ref*6r*444444~ clp*999999*4*25.95*0*25.95*13*0000000555555555*11~ nm1*qc*1*sam*yosemite*a***mi*3333333~ nm1*82*2*acme agency*****fi*310626223~ ref*f8*h57b10401~ svc*zz:m2200:he*25.95*0**1~ dtm*472*20021224~ cas*cr*18*25.95*0~ cas*co*42*0*0~ ref*6r*999999~ clp*888888*4*162.13*0*162.13*mc*0000000456789123*11~ nm1*qc*1*squarepants*bob* ***mi*2222222~ nm1*82*2*bikini agency*****fi*310626223~ ref*f8*h57b10401~ svc*zz:m151000:f0*162.13*0**1.9~ dtm*472*20020920~ cas*co*29*162.13*0*42*0*0~ ref*6r*888888~ clp*111111*2*56.52*18.88*0*13*0000000644444444*53~ nm1*qc*1*leghorn*foghorn*p***mi*7777777~ nm1*82*2*chickenhawk svcs*****fi*346608640~ ref*f8*a76b04054~ svc*hc:h0005:hf:h9*56.52*18.88**6~ dtm*472*20031209~ cas*co*42*0*0~ cas*oa*23*37.64*0~ ref*6r*111111~ clp*121212*4*56.52*0*0*13*0000000646464640*53~ nm1*qc*1*explorer*dora****mi*1717171~ nm1*82*2*swiper agency*****fi*346608640~ ref*f8*a76b04054~ svc*hc:h0005:hf:h9*56.52*0**6~ dtm*472*20031202~ cas*co*42*0*0~ cas*oa*23*57.6*0*23*-1.08*0~ ref*6r*121212~ clp*333333*1*74.61*59.69*14.92*13*0000000688888888*55~ nm1*qc*1*bear*yogi* ***mi*2222222~ nm1*82*2*jellystone svcs*****fi*346608640~ ref*f8*a76b04054~ svc*zz:a0230:hf*74.61*59.69**1~ dtm*472*20040203~ cas*pr*2*14.92*0~ cas*co*42*0*0~ ref*6r*333333~ clp*777777*25*136.9*0*0*13*0000000622222222*53~ nm1*qc*1*bird*tweety*m***mi*4444444~ nm1*82*2*granny agency*****fi*340716747~ ref*f8*a76b03293~ svc*hc:h0015:hf:99:h9*136.9*0**1~ dtm*472*20030911~ cas*pi*104*136.72*0~ cas*co*42*0.18*0~ ref*6r*777777~ clp*123456*22*-42.58*-42.58*0*13*0000000657575757*11~ nm1*qc*1*simpson*homer* ***mi*8787888~ nm1*82*2*doh group*****fi*310626223~ ref*f8*a57b04033~ svc*hc:h0036:gt:uk*-42.58*-42.58**-2~ dtm*472*20040102~ cas*cr*141*0*0*42*0*0*22*0*0~ cas*oa*141*0*0~ ref*6r*123456~ clp*090909*22*-86.76*-86.76*0*mc*0000000648484848*53~ nm1*qc*1*duck*daffy*w***mi*1245849~ nm1*82*2*abthsolute help*****fi*346608640~ ref*f8*a76b04054~ svc*hc:h0004:hf:h9*-86.76*-86.76**-4~ dtm*150*20040210~ dtm*151*20040211~ cas*cr*22*0*0*42*0*0~ cas*oa*22*0*0~ ref*6r*090909~ amt*au*86.76~ qty*ne*53~ lq*he*ma92~ plb*123456*19960930*cv:9876514*-1.27~ se*97*07504123~ ge*1*1~ iea*1*004075123~

looking @ 2 stylesheets, differences xsl:apply-templates

<xsl:apply-templates select="functiongroup/transaction/loop[@loopid='2000']/loop [@loopid='2100']"/>

and respective template match

<xsl:template match="loop[@loopid='2100'] ">

in both cases "2100" , "2110" differ.

to allow first xslt manage both "2100" , "2110" records, replace existing single xsl:apply-templates these:

<xsl:apply-templates select="functiongroup/transaction/loop[@loopid='2000']/loop[@loopid='2100']"/> <xsl:apply-templates select="functiongroup/transaction/loop[@loopid='2000']/loop[@loopid='2110']"/>

then, alter template match this, share template

<xsl:template match="loop[@loopid='2100' or @loopid='2110'] ">

try (abridged) xslt, combines 2 xslt stylesheets one

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl"> <xsl:output method="text" indent="yes"/> <xsl:template match="interchange"> <xsl:apply-templates select="functiongroup/transaction/loop[@loopid='2000']/loop[@loopid='2100']"/> <xsl:apply-templates select="functiongroup/transaction/loop[@loopid='2000']/loop[@loopid='2110']"/> </xsl:template> <xsl:template match="loop[@loopid='2100' or @loopid='2110'] "> <xsl:variable name="trans" select="../../."/> <xsl:variable name="caxx" select="."/> <xsl:value-of select="$trans/bpr/bpr16"/> <xsl:value-of select="','"/> <xsl:value-of select="$caxx/n1/n102"/> <xsl:text>&#x0a;</xsl:text> </xsl:template> </xsl:stylesheet>

loops xslt export-to-csv edi hipaa

asking about Javascript remoting in Salesforce -



asking about Javascript remoting in Salesforce -

i trying utilize javascript remoting in salesforce. have textbox input city name find. first time clicked search button got right result when clicked on time got many duplicated columns. don't know have gone wrong. please help me. here code:

controller class:

global sharing class accountremoter { public static list<account> business relationship { get; set; } public accountremoter() { } @remoteaction global static list<account> getaccount(string cityname) { business relationship = [select id, name, city__c, recordtypeid, recordtype.name business relationship city__c = :cityname]; homecoming account; } }

visual page:

<apex:page controller="accountremoter"> <apex:includescript value="{!$resource.knockout}"/> <apex:includescript value="{!urlfor($resource.kendo, '/js/jquery.min.js')}"/> <script type="text/javascript"> var vm = function () { var self = this; self.items = ko.observablearray(); self.columnnames = ko.computed(function () { if (self.items().length === 0) homecoming []; var props = []; var obj = self.items()[0]; (var name in obj) props.push(name); homecoming props; }); }; function getremoteaccount() { var cityname = document.getelementbyid('acctsearch').value; visualforce.remoting.manager.invokeaction( '{!$remoteaction.accountremoter.getaccount}', cityname, function(result, event){ if (event.status) { var vm = new vm(); ko.applybindings(vm); //vm.items.removeall(); (var = 0; < result.length; i++){ vm.items.push({ 'name': result[i].name, 'city': result[i].city__c }); } } else if (event.type === 'exception') { document.getelementbyid("responseerrors").innerhtml = event.message + "<br/>\n<pre>" + event.where + "</pre>"; } else { document.getelementbyid("responseerrors").innerhtml = event.message; } }, {escape: true} ); } </script> <input id="acctsearch" type="text"/> <button onclick="getremoteaccount()">search</button> <div id="responseerrors"></div> <div id="dv"> <table style="float:left;" id="mytable"> <thead > <tr data-bind="foreach: columnnames" > <th> <span data-bind="text: $data"></span> </th> </tr> </thead> <tbody data-bind="foreach: items"> <tr data-bind="foreach: $parent.columnnames"> <td data-bind="text: $parent[$data]"></td> </tr> </tbody> </table> </div> </apex:page>

try self.items.removeall(); before applybindings()

javascript salesforce remoting

javascript - Unable to input data in to mysql from cloned forms? -



javascript - Unable to input data in to mysql from cloned forms? -

i using cloned form reference http://tristandenyer.com/using-jquery-to-duplicate-a-section-of-a-form-maintaining-accessibility/ . trying come in cloned forms in mysql. sorry newbie. pasting code below. kind of sure error in accessing multidimensional array php. in php code right trying print info screen. gives ample error messages. html code:

<form action="<?php $_server['php_self']?>" method="post" id="sign-up_area" role="form"> <label class="label_ttl control-label" for="title">title:</label> <div class="form-group"> <select class="select_ttl form-control" name="form[0][0]" id="title"> <option value="" selected="selected" disabled="disabled">select title</option> <option value="dr.">dr.</option> <option value="mr.">mr.</option> <option value="mrs.">mrs.</option> <option value="ms.">ms.</option> <option value="sir">sir</option> </select> </div> <!-- text input--> <div class="form-group"> <label class="label_fn control-label" for="first_name">first name:</label> <input id="first_name" name="form[0][1]" type="text" placeholder="" class="input_fn form-control" required> <p class="help-block">this field required.</p> </div> <!-- text input--> <div class="form-group"> <label class="label_ln control-label" for="last_name">last name:</label> <input id="last_name" name="form[0][2]" type="text" placeholder="" class="input_ln form-control"> </div> <div class="form-group"> <label class="label_email control-label" for="email_address">email:</label> <input id="email_address" name="form[0][3]" type="text" placeholder="example@example.com" class="input_email form-control"> </div> <!-- prepended text--> <label class="label_twt control-label" for="institution">enter establishment / organization:</label> <div class="input-group form-group"> <input id="twitter_handle" name="form[0][4]" class="input_twt form-control" placeholder="" type="text"> </div> <!-- text input--> </div><!-- end #entry1 --> <!-- button (double) --> <p> <button type="button" id="btnadd" name="btnadd" class="btn btn-info">add section</button> <button type="button" id="btndel" name="btndel" class="btn btn-danger">remove section above</button> </p> <!-- button --> <p> <button id="submit_button" name="submit_button" class="btn btn-primary">submit</button> </p> </fieldset> </form>

this php code:

if(isset($_post['form'])){ echo "reaching else"; $food=$_post['form']; for($i=0; $i<4; $i++){ for($j=0; $j<3; $j++){ $car=array($food[$i][$j]=>array($food[$i][$j])); //echo $car; } }

this javascript code:

$(function () { $('#btnadd').click(function () { var num = $('.clonedinput').length, // checks see how many "duplicatable" input fields have newnum = new number(num + 1), // numeric id of new input field beingness added, increasing 1 each time newelem = $('#entry' + num).clone().attr('id', 'entry' + newnum).fadein('slow'); // create new element via clone(), , manipulate it's id using newnum value /* manipulate name/id values of input within new, cloned element below examples of forms elements can clone, not ones. there 2 basic structures below: 1 h2, , 1 form elements. create more, can re-create 1 form elements , update classes label , input. maintain in mind .val() method clears element when gets cloned. radio , checkboxes need .val([]) instead of .val(''). */ // h2 - section newelem.find('.heading-reference').attr('id', 'id' + newnum + '_reference').attr('name', 'id' + newnum + '_reference').html('co-pi #' + newnum); // title - select newelem.find('.label_ttl').attr('for', 'id' + newnum); newelem.find('.select_ttl').attr('id', 'id' + newnum).attr('name', 'id' + newnum).val(''); // first name - text newelem.find('.label_fn').attr('for', 'id' + newnum); newelem.find('.input_fn').attr('id', 'id' + newnum).attr('name', 'id' + newnum).val(''); // lastly name - text newelem.find('.label_ln').attr('for', 'id' + newnum); newelem.find('.input_ln').attr('id', 'id' + newnum).attr('name', 'id' + newnum).val(''); // skate - radio , upload file // newelem.find('.label_vitae').attr('for', 'id' + newnum + '_uploadfile'); // newelem.find('.btn-primary').attr('id', 'id' + newnum + '_uploadfile').attr('name', 'id' + newnum + '_uploadfile').val([]); // email - text newelem.find('.label_email').attr('for', 'id' + newnum); newelem.find('.input_email').attr('id', 'id' + newnum).attr('name', 'id' + newnum).val(''); // twitter handle (for bootstrap demo) - append , text newelem.find('.label_twt').attr('for', 'id' + newnum); newelem.find('.input_twt').attr('id', 'id' + newnum).attr('name', 'id' + newnum).val(''); // insert new element after lastly "duplicatable" input field $('#entry' + num).after(newelem); $('#id' + newnum + '_title').focus(); // enable "remove" button. shows 1 time have duplicated section. $('#btndel').attr('disabled', false); // right can add together 4 sections, total of 5. alter '5' below max number of sections want allow. if (newnum == 5) $('#btnadd').attr('disabled', true).prop('value', "you've reached limit"); // value here updates text in 'add' button when limit reached }); $('#btndel').click(function () { // confirmation dialog box. works on desktop browsers , iphone. if (confirm("are sure wish remove section? cannot undone.")) { var num = $('.clonedinput').length; // how many "duplicatable" input fields have $('#entry' + num).slideup('slow', function () {$(this).remove(); // if 1 element remains, disable "remove" button if (num -1 === 1) $('#btndel').attr('disabled', true); // enable "add" button $('#btnadd').attr('disabled', false).prop('value', "add section");}); } homecoming false; // removes lastly section added }); // enable "add" button $('#btnadd').attr('disabled', false); // disable "remove" button $('#btndel').attr('disabled', true); });

i'm not on computer right now, looking on code ever start form?

<form action="<?php echo $_server['php_self']; ?>" method="post">

if not, may causing problem.

javascript php jquery mysql

if statement - Compare a single row with a column and extract the value from another column on the same row in Excel -



if statement - Compare a single row with a column and extract the value from another column on the same row in Excel -

so i'm looking formula or this:

i have 4 columns. b c d.

i have column (a) multiple values can have duplicates.

a1: a2: a3: b a4: c a5: c

i want compare each row column (b) has 1 of each value. b1 = a, b2 = b etc. value want extract column "d" in column "c". if a1 equals in column b, want extract value in column c on same row, column d.

so in d1 want value c1. in d2 want value c1 well. in d3 want value c2.

this seems work:

=vlookup(a1:a5,b1:c5,2,0)

entered array formula in d1:d5 using ctrl+shift+enter.

result:

excel if-statement

javascript - How to Bind data from Razor to Knockout? -



javascript - How to Bind data from Razor to Knockout? -

i using knockout js , mvc.

how bind info @ razor view databind in ko.

i tried doing did not homecoming @ controller.

what trying accomplish here razorview renders rows in step3(view).i want bind these rows knockout can pass info step4(view).

is there improve way??

view:

<tbody data-bind="foreach:apprtable"> @for (int = 0; < userwrinfo.count; i++) { <tr> <td style="text-align: center"> <button type="button" class="btn btn-primary" data-bind="click: $root.submit.bind($data,'@i')">start</button> </td> <td style="text-align: center" data-bind="value: appropriation">@userwrinfo[i].appropriationnumber</td> <td style="text-align: center" data-bind="value: prioritydate">@userwrinfo[i].prioritydate.tostring("mm/dd/yyyy")</td> <td style="text-align: center" data-bind="value: location">@userwrinfo[i].sect @userwrinfo[i].township @userwrinfo[i].range@userwrinfo[i].rangedirectionid</td> <td style="text-align: center" data-bind="value: source">@userwrinfo[i].source</td> @if (userwrinfo.count == userowner.count) { <td style="text-align: center" data-bind="value: owner">@userowner[i].tostring()</td> } else { <td style="text-align: center" data-bind="value: owner"></td> } <td style="text-align: center" data-bind="value: use">@userwrinfo[i].usedescription</td> <td style="text-align: center" data-bind="value: startedby"></td> <td style="text-align: center" data-bind="value: requiredreporting">@userwrinfo[i].isannualreportrequired</td> </tr> } </tbody>

js:

function rowdata(appropriation, prioritydate, location, source, owner, use, startedby, requiredreporting) { var self = this; self.appropriation = ko.observable(appropriation); self.prioritydate = ko.observable(prioritydate); self.location = ko.observable(location); self.source = ko.observable(source); self.owner = ko.observable(owner); self.use = ko.observable(use); self.startedby = ko.observable(startedby); self.requiredreporting = ko.observable(requiredreporting); } function step3viewmodel() { var self = this; self.apprtable = ko.observablearray(); self.apprtable.push(rowdata()); self.submit = function (buttonid) { var apprdata = ko.tojson(self.apprtable()); $.post("/step/step4", { "ad": apprdata }, function (data) { }, 'json'); } } ko.applybindings(new step3viewmodel());

you're creating single element observable array calling rowdata constructor, you're not passing parameters in.

self.apprtable = ko.observablearray([new rowdata()]);

the function definition requires lot of parameters

function rowdata(appropriation, prioritydate, location, source, owner, use, startedby, requiredreporting)

you're not putting info observables.

javascript asp.net-mvc asp.net-mvc-4 razor knockout.js

jquery - Change text from tag to one from a different div -



jquery - Change text from <h1> tag to one from a different div -

i'm trying alter text within tag 1 selected element list.

this list:

this corresponding html (just part of it)

<div class="categories"> <div class="cats"><a id="categoriabtn995" class="button" href="#categorytitle" title="button">línea blanca</a></div> <br> <div class="cats"><a id="categoriabtn996" class="button" href="#categorytitle" title="button">desarrollo de software</a></div> <br> <div class="cats down"><a id="categoriabtn998" class="button" href="#categorytitle" title="button">esteticas - belleza</a></div> <br> <div class="cats"><a id="categoriabtn999" class="button" href="#categorytitle" title="button">publicidad</a></div> <br> </div>

under div, have section want set info elements.

first, need alter title simple tag:

<h1 id="categorytitulo">change this</h1>

it should alter text element class="down"

this how toggle class:

$(document).ready(function () { $('a.button').click(function () { $('.down').toggleclass("down"); $(this.parentelement).toggleclass("down"); }); });

and i'm trying right now:

$('a.button').click(function () { $('h1#categorytitulo').text( $('.down').text()); });

i tried place in jsfiddle , reason works there, not on site. hope guys can help me figure out method accomplish this.

this i'm trying achieve: http://jsfiddle.net/2maft/ not working me.

you need alter a#categoriabtn run off of class not id. like;

$('a[class$="button"]').click(function(){ $("#categorytitulo').html('whatever want here'); });

i don't know you're getting classname of downwards or else, should work on whatever want

jquery html

c# - convert 32bpp Bitmap to 16bpp (Grayscale) -



c# - convert 32bpp Bitmap to 16bpp (Grayscale) -

this question has reply here:

how convert pixel formats? 32bpprgb 16bpp grayscale in c# 2 answers

i'm creating bitmap in c# image object.

the bitmap 32bpp, how can transform 16bpp?

bitmap image_bmp; system.drawing.image tmp = (system.drawing.image)img.renderimage(0); //renderimage creates object of tyoe system.drawing.image image_bmp = new bitmap(tmp);

if run quick search on google can find number of first-class color grayscale formulas. take next from wikipedia example:

y' = 0.2126 r' + 0.7152 g' + 0.0722 b'

with in mind general process in .net going be:

create new image of right dimensions 16bpp grayscale use "lockbits" on original image , new image , loop on each pixel unlock both images, save new image file

rather going these steps farther found few other questions stack , around web delve details more. see:

set individual pixels in .net format16bppgrayscale image how convert pixel formats? 32bpprgb 16bpp grayscale in c# http://social.msdn.microsoft.com/forums/vstudio/en-us/10252c05-c4b6-49dc-b2a3-4c1396e2c3ab/writing-a-16bit-grayscale-image?forum=csharpgeneral

best of luck!

note - i'm assuming using gdi+. steps similar windows imaging component (wic) classes , syntax radically different.

c# bitmap pixel

timer - Batch file to logoff between specific times -



timer - Batch file to logoff between specific times -

i want create batch file log off after hr has passed , want reset @ noon , midnight (ex. on computer 1 hour, logged off, have wait until 12 on) have timer script (below) i'm not sure how create time check , of -thanks

echo. echo have 1 hour...begin timeout /t 3600 /nobreak>nul echo. echo (code here) echo. pause >nul

hmm interesting lol. seek , utilize if command

:lol timeout /t 20 /nobreak >nul if %time% gtr 12:00:00 ( goto logoff ) if %time% lss 12:00:00 ( goto lol ) :logoff shutdown -l

this won't work 100% correctly, thought :p seek using set command translate 12:00:00 number 12 utilize if command.

batch-file timer

How to - Spring MVC and Spring-Data-Rest controllers with CodaHale-Metrics -



How to - Spring MVC and Spring-Data-Rest controllers with CodaHale-Metrics -

how can 1 inject coda hale metrics using spring aop and/or using http://www.ryantenney.com/metrics-spring/ library. there examples out there?

i figured out. great if of features in http://www.ryantenney.com/metrics-spring/ documented :) hey, that's why open source.

<metrics:annotation-driven metric-registry="metrics" /> <!-- monitoring controller --> <beans:bean id="monitoringinterceptor" class="com.ryantenney.metrics.spring.timedmethodinterceptor"> <beans:constructor-arg ref="metrics"/> <beans:constructor-arg> <beans:value type="java.lang.class">org.myapp.controller.mycontroller</beans:value> </beans:constructor-arg> </beans:bean> <aop:config> <!-- name of class or interface --> <aop:pointcut id="monitoringpointcut" expression="execution(* org.myapp.controller.mycontroller..*(..))"/> <aop:advisor advice-ref="monitoringinterceptor" pointcut-ref="monitoringpointcut"/> </aop:config>

spring-mvc spring-aop metrics spring-data-rest codahale-metrics

r - What is a way to manage paths to local files outside a git repository without clutter from conflicts from differing paths on collaborators' machines? -



r - What is a way to manage paths to local files outside a git repository without clutter from conflicts from differing paths on collaborators' machines? -

i regularly collaborate on big info analysis projects using git , statistical software such r. because datasets big , may alter upon re-download, not maintain these in repository. while design final versions of scripts develop utilize command line arguments read paths raw datasets, it's easier test , debug straight reading files r environment. develop, therefore, end lines such as

something = read.raw.file("path/to/file/on/my/machine") #something = read.raw.file("path/to/file/on/collaborators/machine") #something = read.raw.file("path/to/file/on/other/collaborators/machine")

cluttering code.

there must improve way. i've tried adding file each script reads before running, such

proj-config.local path.to.raw.file.1 = "/path/to/file/on/my/machine"

and adding .gitignore, "heavyweight" workaround given how much time takes, , it's not obvious collaborators 1 doing or should, or might name or locate file differently (since it's ignored) shared line of code reads file ends wrong, etc. etc.

is there improve way manage local outside-repo paths/references?

ps didn't notice addressing issue in of these related quetions:

workflow statistical analysis , study writing project organization r what best practices utilize programming in r? how combine "revision control" "workflow" r? how software development compare statistical programming/analysis? essential skills of info scientist ensuring reproducibility in r environment r , version command solo info analyst

a solution i've been using build in concept of search path can used locate files. in 1 particular application, i've built-in ability override search path environment variable, similar path variable commonly used.

i wrote function, findfileinpath (below) search supplied path , homecoming found. takes in path vector , allows separate pieces character os typically does.

you utilize this: (as illustration only)

datasearchpath = c( "path/to/file/on/my/machine", "path/to/file/on/collaborators/machine", "path/to/file/on/other/collaborators/machine", sys.getenv('datasearchpath') ) datafilename = "data_file.csv" datapathname = findfileinpath(datafilename, path=datasearchpath)[1] # take first 1 if (is.na(datapathname)) { stop(paste("cannot find info file", datafilename), call.=false) } ...

i utilize locate files source, locate configuration files, info sets, etc. have multiple different paths, of them exposed in environment or various configuration files, others internal. works pretty well.

in illustration above, datasearchpath environment variable can set (outside of r) colon-separated series of paths search.

my implementation of findfileinpath defaults searching system's path environment variable, separated colon character. (this won't applicable windows. utilize on mac , linux.)

#' findfileinpath: locates files searching supplied paths #' #' @param filename character: name of file search #' #' @param path character: path search, either vector, or optionally #' separated \code{sep}. #' #' @param sep character: separator character used split \code{path} #' multiple components. #' findfileinpath = function(filename, path=c('.',sys.getenv('path')), sep=':') { # list potential files, , homecoming exist. files = data.frame(name=file.path(unlist(strsplit(path, sep)), filename), stringsasfactors=false) files$exist = file.exists(files$name) files[files$exist==true,1] }

r git version-control path collaboration

html - Interact with DIV under another DIVs margin on the phone -



html - Interact with DIV under another DIVs margin on the phone -

i want build simple web-app displays map , list. list should on map, , should scrollable. map should remain @ same position, these 2 items deed layers.

i managed build purely html/css , works on computer, not on phone (iphone).

my code following:

<style> html { width: 100%; height: 100%; } .map { background-color: yellow; height: 100%; width: 100%; position: absolute; top: 0; left: 0; z-index: 0; } .list { height: 2000px; width: 100%; background-color: blue; position: relative; margin-top: 200px; z-index: 1; color: white; } .layer { height: 100%; width: 100%; overflow: scroll; -webkit-overflow-scrolling: touch; } </style> <body> <div class="map"> map </div> <div class="layer"> <div class="list"><a href="#"> list </div> </div> </body>

i can interact map when scroll downwards list on computer, not on phone. when add together css-property pointer-events: none; layer-div, can't click on links in (naturally). when alter margin-top list-div top: 200px doesn't work (on phone).

i created jsfiddle that.

edit made image google maps app. can see, drawer can drawn bottom top, map stays in place, both deed 2 layers.

what looking this:

<body> <div class="map"> map </div> <div class="list"> list<br>list<br>list<br>list<br>list<br>list<br>list<br>list<br>list<br>list<br>list </div>

css:

html { width: 100%; height: 100%; } .map { background-color: yellow; position: absolute; top: 0; left: 0; bottom:0; right:0; z-index: 1; } .list { position:fixed; background-color: blue; top: 200px; bottom:0; left:20px; right:20px; z-index: 2; color: white; overflow-y: scroll; -webkit-overflow-scrolling: touch; }

http://jsfiddle.net/j8g6a/1/

html css mobile web-applications mobile-application

AWS iam create new user returning html instead of xml response android -



AWS iam create new user returning html instead of xml response android -

i creating new user through android app programatically using amazon web-service. here code(asynctask):

private class s3registernewuser extends asynctask<string, void, string> { progressdialog dialog; string email; public s3registernewuser(string email) { // todo auto-generated constructor stub this.email=email; } protected void onpreexecute() { dialog = new progressdialog(s3uploaderactivity.this); dialog.setmessage(s3uploaderactivity.this .getstring(r.string.plswait)); dialog.setcancelable(false); dialog.show(); } protected string doinbackground(string ...strings) { seek { httpclient httpclient = new defaulthttpclient(); httppost httppost = new httppost(constants.register); //url[0] string result = ""; boolean result_recvd = false; boolean ifallset = false; // sparser = new parsingclass(); seek { // add together info list<namevaluepair> namevaluepairs = new arraylist<namevaluepair>(2); namevaluepairs.add(new basicnamevaluepair("username",email)); namevaluepairs.add(new basicnamevaluepair("path","/")); namevaluepairs.add(new basicnamevaluepair("version","2010-05-08")); httppost.setentity(new urlencodedformentity(namevaluepairs)); // execute http post request /*httpresponse response = httpclient.execute(httppost); httpentity entity = response.getentity(); = entity.getcontent(); binddatatolisting(is);*/ httpresponse resp = httpclient.execute(httppost); httpentity ent = resp.getentity(); ist = ent.getcontent(); result = getstringfrominputstream(ist); if(!result.contains("result")) { toast.maketext(s3uploaderactivity.this, "no connection or info not received server", toast.length_short).show(); //result = "<?xml version=\"1.0\" encoding=\"utf-8\"?><xml><result>0</result><message>"+constants.noconnection+"</message></xml>"; result_recvd = false; }else{ /** result has been received server contains atleast 'result' tag * helps know if info beingness fetched server or not.*/ result_recvd = true; } // ifallset = binddatatolisting(result, result_recvd); if(!result.contains("result")){ toast.maketext(s3uploaderactivity.this, "no connection or info not received server", toast.length_short).show(); } //result = convertstreamtostring(is); log.e("-- parseresultxml: ", ""+result); } grab (clientprotocolexception e) { e.printstacktrace(); } grab (ioexception e) { e.printstacktrace(); } } grab (amazonclientexception ace) { system.out.println("caught amazonclientexception, " + "which means client encountered " + "an internal error while trying communicate" + " s3, " + "such not beingness able access network."); system.out.println("error message: " + ace.getmessage()); } homecoming null; } protected void onpostexecute(string file_url) { dialog.dismiss(); } } /** convert input stream string * @param -supply input stream variable here */ private string getstringfrominputstream(inputstream is) { stringbuilder sb = new stringbuilder(); string line; seek { br = new bufferedreader(new inputstreamreader(is)); while ((line = br.readline()) != null) { sb.append(line); } } grab (ioexception e) { e.printstacktrace(); } { if (br != null ) { seek { br.close(); } grab (ioexception e) { e.printstacktrace(); } } } homecoming sb.tostring(); }

constants.register="https://iam.amazonaws.com/"

i next iam documentation.but instead of recieving xml result according documentation recieving html responses below:

06-20 15:05:55.856: e/-- parseresultxml:(665): <!doctype html><!--[if lt ie 7]><html class="no-js lt-ie10 lt-ie9 lt-ie8 lt-ie7 lang-en lang-en_us" lang="en-us" xmlns="http://www.w3.org/1999/xhtml" xmlns:og="http://ogp.me/ns#" xmlns:fb="http://www.facebook.com/2008/fbml"><![endif]--><!--[if ie 7]><html class="no-js lt-ie10 lt-ie9 lt-ie8 lang-en lang-en_us" lang="en-us" xmlns="http://www.w3.org/1999/xhtml" xmlns:og="http://ogp.me/ns#" xmlns:fb="http://www.facebook.com/2008/fbml"><![endif]--><!--[if ie 8]><html class="no-js lt-ie10 lt-ie9 lang-en lang-en_us" lang="en-us" xmlns="http://www.w3.org/1999/xhtml" xmlns:og="http://ogp.me/ns#" xmlns:fb="http://www.facebook.com/2008/fbml"><![endif]--><!--[if ie 9]><html class="no-js lt-ie10 lang-en lang-en_us" lang="en-us" xmlns="http://www.w3.org/1999/xhtml" xmlns:og="http://ogp.me/ns#" xmlns:fb="http://www.facebook.com/2008/fbml"><![endif]--><!--[if gt ie 9]><!--><html class="no-js lang-en lang-en_us" lang="en-us" xmlns="http://www.w3.org/1999/xhtml" xmlns:og="http://ogp.me/ns#" xmlns:fb="http://www.facebook.com/2008/fbml"> <!--<![endif]--> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <link rel="dns-prefetch" href="//a1.awsstatic.com" /> <link rel="dns-prefetch" href="//a0.awsstatic.com" /> <link rel="dns-prefetch" href="//d0.awsstatic.com" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>aws identity , access management (iam) in cloud</title> <meta http-equiv="x-ua-compatible" content="ie=edge,chrome=1" /> <link rel="icon" type="image/ico" href="//a1.awsstatic.com/images/site/favicon.ico" /> <link rel="shortcut icon" type="image/ico" href="//a1.awsstatic.com/images/site/favicon.ico" /> <link rel="apple-touch-icon" sizes="57x57" href="//a1.awsstatic.com/images/site/touch-icon-iphone-114-precomposed.png" /> <link rel="apple-touch-icon" sizes="72x72" href="//a1.awsstatic.com/images/site/touch-icon-ipad-144-precomposed.png" /> <link rel="apple-touch-icon" sizes="114x114" href="//a1.awsstatic.com/images/site/touch-icon-iphone-114-precomposed.png" /> <link rel="apple-touch-icon" sizes="144x144" href="//a1.awsstatic.com/images/site/touch-icon-ipad-144-precomposed.png" /> <meta property="og:title" content="aws identity , access management (iam) in cloud" /> <meta property="og:type" content="company" /> <meta property="og:url" content="//aws.amazon.com/iam/" /> <meta property="og:image" content="//a1.awsstatic.com/images/open-graph/opengraph.gif" /> <meta property="og:site_name" content="amazon web services, inc." /> <meta name="google-site-verification" content="xhghg81ulgiw-3eylgcf48sg28tbw5eh0bnuhgo_dru" /> <meta name="msvalidate.01" content="6f92e52a288e266e30c2797ecb5fccf3" /> <link rel="canonical" href="http://aws.amazon.com/iam/" /> <link rel="alternate" href="//aws.amazon.com/de/iam/" hreflang="de-de" /> <link rel="alternate" href="//aws.amazon.com/es/iam/" hreflang="es-es" /> <link rel="alternate" href="//aws.amazon.com/fr/iam/" hreflang="fr-fr" /> <link rel="alternate" href="//aws.amazon.com/jp/iam/" hreflang="ja-jp" /> <link rel="alternate" href="//aws.amazon.com/pt/iam/" hreflang="pt-br" /> <link rel="alternate" href="//aws.amazon.com/ko/iam/" hreflang="ko-kr" /> <link rel="alternate" href="//aws.amazon.com/cn/iam/" hreflang="zh-cn" /> <link rel="stylesheet" href="//a1.awsstatic.com/css/35/style.css" /> <!--[if lt ie 9]> <script src="//a1.awsstatic.com/js/35/jquery.1.9.js"></script> <![endif]--> <!--[if (gte ie 9) | (!ie)]><!--> <script src="//a1.awsstatic.com/js/35/jquery.2.0.js"></script> <!--<![endif]--> <script src="//a1.awsstatic.com/js/35/aws-target-mediator.js"></script> <script>aws.targetmediator.init();</script> <script src="//a1.awsstatic.com/js/35/modernizr.js"></script> <script> var require = { baseurl: "//a1.awsstatic.com/js/35/", paths: { "jquery": "jquery-amd" }, deps: ["scripts"], shim: { "scripts": ["jquery"], "forms": ["jquery"], "pricing-table": ["jquery"

if doing wrong or sending wrong parameters code must throw exception or stop.but why returning html file??what wrong doing here??

update

the aws sdk android seems bit lacking on getting started front end indeed - seems designed similar aws sdk java though (naturally):

there, every aws service has own service specific client, amazonidentitymanagementclient utilize case. given absent, seems aws sdk android doesn't back upwards iam directly, you'd need resort iam query api indeed (as mentioned on page), i.e. you'll need implement signing [of] aws api requests yourself, unfortunately.

initial answer

aws services in general , amazon iam in particular require signing [of] aws api requests, i.e. cannot phone call api endpoint, rather need aws security credentials generate digital signature each request before submitting api.

the request signing process bit complex though , varies between aws services, i'd highly recommend utilize aws sdk android instead, heavy lifting - applies other complexities in dealing aws btw., if can conceptually, i'd never utilize aws without sdk if there isn't specific reason (e.g. beingness on platform not supported 1 of many offical aws sdks yet).

android xml amazon-web-services amazon-s3 amazon-iam

java - Exception at the BufferedReader.reset() method -



java - Exception at the BufferedReader.reset() method -

i have hasnext() method reading file. returns true if it's not end of file. in method has exception.

exception information:

exception at: java.io.bufferedreader.reset(bufferedreader.java:497) typ: java.io.ioexception message: mark invalid

my hasnext() method:

@override public boolean hasnext() { seek { super.getsourceread().mark(1); if (super.getsourceread().read() < 0) { homecoming false; } getsourceread().reset(); homecoming true; } grab (ioexception e) { logger.exceptionoccurred(e); homecoming false; } grab (nullpointerexception e) { logger.exceptionoccurred(e); homecoming false; } }

well it's written in doc 1.5:

after reading this many characters, attempting reset stream may fail.

so in case says may fail after reading 1 character.

setting limit 2 puts in safe zone.

and create nagging style remark: hope have constant or fellow member limit somewhere in class (sorry had :) )

java file-io bufferedreader ioexception mark

Java code to reschedule a outlook calendar event? -



Java code to reschedule a outlook calendar event? -

package necc.util.mail; import java.text.simpledateformat; import java.util.calendar; import java.util.date; import java.util.properties; import javax.activation.mailcapcommandmap; import javax.activation.mimetypesfiletypemap; import javax.mail.bodypart; import javax.mail.message; import javax.mail.messagingexception; import javax.mail.multipart; import javax.mail.session; import javax.mail.transport; import javax.mail.internet.internetaddress; import javax.mail.internet.mimebodypart; import javax.mail.internet.mimemessage; import javax.mail.internet.mimemultipart; public class emailmeeting { private static bodypart buildhtmltextpart() throws messagingexception { mimebodypart descriptionpart = new mimebodypart(); // note: if content spcified beingness text/html, outlook // won't read correctly tables @ // , properties div:s. thus, seek avoid fancy // content string content = "<font face=\\\"verdana\\\">necc tms estimation</font>"; descriptionpart.setcontent(content, "text/html; charset=utf-8"); homecoming descriptionpart; } // define somewhere icalendar date format private static simpledateformat icalendardateformat = new simpledateformat( "yyyymmdd't'hhmm'00'"); private static bodypart buildcalendarpart() throws exception { bodypart calendarpart = new mimebodypart(); calendar cal = calendar.getinstance(); cal.add(calendar.day_of_month, 1); cal.set(calendar.minute, 0); date start = cal.gettime(); cal.add(calendar.hour_of_day, 1); date end = cal.gettime(); // check icalendar spec in order build more complicated meeting // request string calendarcontent = "begin:vcalendar\n" + "method:request\n" + "prodid: bcp - meeting\n" + "version:2.0\n" + "begin:vevent\n" + "dtstamp:" + icalendardateformat.format(start) + "\n" + "dtstart:" + icalendardateformat.format(start) + "\n" + "dtend:" + icalendardateformat.format(end) + "\n" + "summary:necc tms estimation\n" + "uid:324\n" + "attendee;role=req-participant;partstat=needs-action;rsvp=true:mailto:abc_m@company.com\n" + "organizer:mailto:xyz_m@company.com\n" + "location:conference room\n" + "description:how can finish in estimated pd's?\n" + "sequence:0\n" + "priority:5\n" + "class:public\n" + "status:confirmed\n" + "transp:opaque\n" + "begin:valarm\n" + "action:display\n" + "description:reminder\n" + "trigger;related=start:-pt00h15m00s\n" + "end:valarm\n" + "end:vevent\n" + "end:vcalendar"; calendarpart.addheader("content-class", "urn:content-classes:calendarmessage"); calendarpart.setcontent(calendarcontent, "text/calendar;method=cancel"); homecoming calendarpart; } /* @param args */ public static void main(string[] args) throws exception { string host = "abc.abc.com";// hostname of mail service server string = "xyz@company.com"; // net address string = "abc@company.com"; // net address properties prop = new properties(); prop.put("mail.host", host); session session = session.getdefaultinstance(prop, null); // register text/calendar mime type mimetypesfiletypemap mimetypes = (mimetypesfiletypemap) mimetypesfiletypemap .getdefaultfiletypemap(); mimetypes.addmimetypes("text/calendar ics ics"); // register handling of text/calendar mime type mailcapcommandmap mailcap = (mailcapcommandmap) mailcapcommandmap .getdefaultcommandmap(); mailcap.addmailcap("text/calendar;; x-java-content-handler=com.sun.mail.handlers.text_plain"); mimemessage message = new mimemessage(session); message.setfrom(new internetaddress(from)); message.setsubject("necc tms"); message.addrecipient(message.recipienttype.to, new internetaddress(to)); // create alternative multipart multipart multipart = new mimemultipart("alternative"); // part 1, html text bodypart messagebodypart = buildhtmltextpart(); multipart.addbodypart(messagebodypart); // add together part two, calendar bodypart calendarpart = buildcalendarpart(); multipart.addbodypart(calendarpart, 0); // set multipart in message message.setcontent(multipart); // send message transport transport = session.gettransport("smtp"); transport.connect(); transport.sendmessage(message, message.getallrecipients()); transport.close(); system.out.println("email sent"); } }

sample code create calendar event. want send reschedule calendar event scheduled calendar. other alternative tried send cancellation mail service , 1 time again send new calendar event. required send 2 different mail. there way can in single mail.

the key to:

keep same uid in initial request bump sequence (and dtstamp)

i noticed in code that, although correctly setting method:request in icalendar stream, content-type still indicates method=cancel.

java outlook icalendar

Need to read the values of a config file from a shell script -



Need to read the values of a config file from a shell script -

i have shell script , mutual configuration file generic path, username , other values stored. want value configuration file while running sh script.

example:

sample.conf pt_user_name=>xxxx pt_passwd=>junly@2014 jrnl_source_folder=>x/y/v pt_source_folder=>/x/y/r/g css_source_folder=>/home/d/g/h

now want thing in sh script.

cd $css_source_folder

this command within shell script should take me location d/g/h while script running.

is there way accomplish other grep , awk??

thanks rinu

if want read conf file everytime grep , cutting might help you,

suppose need value css_source_folder property prop1="css_source_folder" (i assuming know property name value want)

value_of_prop1=`grep $prop1 sample.conf| cutting -f2 -d "=" | cutting -f2 -d ">"`

like,

[db2inst2@pegdb2 ~]$ vi con.conf [db2inst2@pegdb2 ~]$ grep css_source_folder con.conf css_source_folder=>/home/d/g/h [db2inst2@pegdb2 ~]$ value=`grep css_source_folder con.conf | cutting -f2 -d "="` [db2inst2@pegdb2 ~]$ echo $value >/home/d/g/h [db2inst2@pegdb2 ~]$ value=`grep css_source_folder con.conf | cutting -f2 -d "=" | cutting -f2 -d ">"` [db2inst2@pegdb2 ~]$ echo $value /home/d/g/h

if want read properties @ once, apply loop , solve purpose

shell configuration-files

Compilation Error (Website Not Recognizing .NET 4.5) -



Compilation Error (Website Not Recognizing .NET 4.5) -

i trying website recognize new version of .net (4.5) can upgrade final version of dnn (7.2). have .net 4.5 installed when go iis settings, switch framework 4.5 (it says 4.0 bc version technically 4.03), , refresh local host error:

"compilation error

description: error occurred during compilation of resource required service request. please review next specific error details , modify source code appropriately.

compiler error message: cs1703: assembly same identity 'system.web.extensions, version=4.0.0.0, culture=neutral, publickeytoken=31bf3856ad364e35' has been imported. seek removing 1 of duplicate references.

[no relevant source lines]"

haven't found useful far on web regarding this. please help!

update: version referenced in web.config 3.5.0.0 issue?

your website needs configured utilize .net 4.0 .net 4.5 extension of version 4.0. depending on method utilize switch .net 2.0 .net 4.0, have replace references version 3.5 references version 4.0 in web.config.

compilation .net-4.5 dotnetnuke

sql - How to get duplicate values in all rows filtering by one column -



sql - How to get duplicate values in all rows filtering by one column -

here table looks like.

person date entry person1 05-20-14 142 person2 05-20-14 443 person1 05-21-14 248 person1 05-21-14 142

i need 2 things.

first number of times person made entry first time.

i tried doing these queries. problem need info per day.

that if query 05/21, need see output

"person1 1"

142 wont included because exists.

in query, filtering date already, not sure how go out , search in rest of dates values. here have.

select person, count(distinct entry) [table] date >= 05/21/2014 , date < 05/22/2014 grouping person order person.

this gives me

person1 2

both 248 , 142 considered here. how 142 entry made in previous dates. not @ nested queries.

thanks looking.

will solve problem or give thought how inner query should be?

select person, count(distinct entry) [table] date >= 05/21/2014 , date < 05/22/2014 , entry not in (select distinct entry [table] date <> 05/21/2014) grouping person order person.

in above query have added inner query distinct entry other dates

select distinct entry [table] date <> 05/21/2014

and have added status current result should not consider entries

and entry not in (select distinct entry [table] date <> 05/21/2014)

hope helps you.

sql sql-server-2012

c# - In MVC Folder name and view name are same,but first it enters into view -



c# - In MVC Folder name and view name are same,but first it enters into view -

i have mvc project url hostname/xxxx , have folder name called xxxx.

if come in url hostname/xxxx means straight go folder want go code controller

if don't have these in iis handler mappings need install mvc on server

c# asp.net .net asp.net-mvc c#-4.0

package - Loading official Google PHP API Client as a Composer require -



package - Loading official Google PHP API Client as a Composer require -

i writing library composer bundle requirues official php google api client. api client can found on github - versions on packagists forks , seems not updated often.

i having problem of adding official api client dependency of package. thoughts of doing wrong?

{ "name": "mechastorm/google-spreadsheet-extractor", "require": { "google/google-api-php-client": "dev-master" }, "require-dev": { "google/google-api-php-client": "dev-master", "phpunit/phpunit": "~4.0", "mockery/mockery": "~0.9" }, "minimum-stability" : "dev", "repositories": [ { "type": "vcs", "url": "https://github.com/google/google-api-php-client.git" } ], "autoload": { "psr-0" : { "mechastorm\\google-spreadsheet-extractor" : "src" } } }

the error is

your requirements not resolved installable set of packages. problem 1 - installation request mechastorm/google-spreadsheet-extractor dev-master -> satisfiable mechastorm/google-spreadsheet-extractor[dev-master]. - mechastorm/google-spreadsheet-extractor dev-master requires google/google-api-php-client dev-master -> no matching bundle found. potential causes: - typo in bundle name - bundle not available in stable-enough version according minimum-stability setting see <https://groups.google.com/d/topic/composer-dev/_g3aseiflrc/discussion> more details. read <http://getcomposer.org/doc/articles/troubleshooting.md> farther mutual problems.

here can see include google's php api can set line composer.json require block

"google/apiclient": "1.0.*@dev"

your solution should work too, should specify different version.

if utilize git repository composer should specify tag version number.

php package composer-php

javascript - Rails 4 ajax-request with form_tag -



javascript - Rails 4 ajax-request with form_tag -

i'm developing simple web-interface service, interracts database , has possibility filter items parameters. here illustration of code:

config/routes.rb

resources :list_items collection 'filter' end end

app/views/list_items/index.html.erb

<%= form_tag(filter_list_items_path, method: 'get') %> <%= text_field_tag(:some_parameter) %> <%= submit_tag 'filter', remote: true %> <% end %> <table> <%= render @list_items %> </table>

partial app/views/list_items/_list_item.erb

<tr class="<%= cycle('list_line_odd', 'list_line_even') %>" id="listelement"> <td><%= list_item.attributes[:path] %></td> </tr>

app/controllers/list_items_controller.rb

def filter @list_items ||= filter_items(params) #get @list_items array, according params respond_to |format| format.js end end

app/views/list_items/filter.js.erb

$('#listelement').html('<%= escape_javascript render(@list_items) %>');

when input info text_field , press 'filter' button, calls filter action in list_items controller. expect table content refreshed, instead of throws error actioncontroller::unknownformat.

p.s. when add together line format.html { redirect_to list_items_url } within respond_to block, doesn't throw errors , not apply filter.

i'm confused rails, please clarify i'm doing wrong. thanks

this happening because form submitting html format default format in rails, thats why format.html responding since returns html not javascript nil happens.

you getting unknownformat error because in action, accepting format.js in respond_to block.

to prepare this, seek changing form following:

<%= form_tag(filter_list_items_path(format: :js), method: 'get', remote: true) %> <%= text_field_tag(:some_parameter) %> <%= submit_tag 'filter' %> <% end %>

in above code telling rails explicitly submit form js format, generate route .js postfix, instead of putting remote indicator on submit button, right way have on form tag.

javascript ruby-on-rails ajax

VBA: Refer to Excel Undolist language independent -



VBA: Refer to Excel Undolist language independent -

i have used excel macro automatically pastes info values, undoing pasting , pasting value. code:

option explicit private sub workbook_sheetchange(byval sh object, byval target range) dim undolist string application.screenupdating = false application.enableevents = false on error goto whoa '~~> undo list capture lastly action performed user undolist = application.commandbars("standard").controls("&undo").list(1) '~~> check if lastly action not paste nor autofill if left(undolist, 5) <> "paste" , undolist <> "auto fill" _ goto letscontinue '~~> undo paste user did not clearing '~~> clipboard copied info still in memory application.undo if undolist = "auto fill" selection.copy '~~> pastespecial preserve formats on error resume next '~~> handle text info copied website target.select activesheet.pastespecial format:="text", _ link:=false, displayasicon:=false target.pastespecial paste:=xlpastevalues, operation:=xlnone, _ skipblanks:=false, transpose:=false on error goto 0 '~~> retain selection of pasted info union(target, selection).select letscontinue: application.screenupdating = true application.enableevents = true exit sub whoa: msgbox err.description resume letscontinue end sub

i using english language excel version works fine, when other users, e.g. have high german excel version paste something, procedure error in line:

undolist = application.commandbars("standard").controls("&undo").list(1)

i guess undo command named differently in german. there way define undo list independent of language user using?

use control's id number instead.

debug.print application.commandbars("standard").controls("&undo").id => 128 debug.print application.commandbars("standard").findcontrol(id:=128).caption => &undo

excel-vba

jsp - Make chart title as capitalize -



jsp - Make chart title as capitalize -

how create title first letter capital , rest of them in lower case , create font italc

string snametitle=request.getparameter("name"); snametitle=name.replace("_"," "); jfreechart chart = chartfactory.createxylinechart("reflectance graph "+snametitle,"wavelength(nm)","reflectance(%)",xydataset,plotorientation.vertical, false, false,false);

any 1 sugesst me create titleof jfree chart hyptis suavalovens

you can utilize javascript function this:

string.prototype.capitalize = function() { homecoming this.replace(/(?:^|\s)\s/g, function(a) { homecoming a.touppercase(); }); };

usage:

var name = 'andi sholihin'; var name_caps = name.capitalize(); alert(name_caps);

output :

andi sholihin

more info : capitalize words in string

jsp jfreechart

php - Gmail application displays font size and color wrong -



php - Gmail application displays font size and color wrong -

i have php/html code tables. looks ok in yahoo, gmail etc looks messed weird greenish colors , wrong varying font sizes when opened in gmail application on mobile phone only. thought how can fixed? link below consists of 2 screenshots. 1 on left how looks on email accounts including gmail. , 1 on right how looks on gmail application on iphone. link screenshot

many in advance. code below:

<?php // fixes encoding uf8 function fixencoding($in_str) { $cur_encoding = mb_detect_encoding($in_str) ; if($cur_encoding == "utf-8" && mb_check_encoding($in_str,"utf-8")) homecoming $in_str; else homecoming utf8_encode($in_str); } // fixencoding ?> <?php require_once('class.phpmailer.php'); //include("class.smtp.php"); // optional, gets called within class.phpmailer.php if not loaded $mail = new phpmailer(); $body = '<html><body>'; $body .= '<table rules="all" style="border-color: #fff; font-family: arial; width:595px; height:108px; font-size:115%; background-color:#ffffff;" cellpadding="10">'; $body .= "<tr><td style='text-align: center; text-align: middle; vertical-align: middle; vertical-align: center'> <img style='border: 0px solid ; 'src='http://www.magentastorage.co.uk/mobile/images/emailheader.jpg'></a> </td></tr>"; $body .= '</table>'; $body .= '<table rules="all" style="border-color: #fff; font-family: arial; width:595px; font-size:115%; background-color:#ffffff;" cellpadding="10"; position:relative; left:"20">'; $body .= "<tr><td style= 'padding-left:21px;'>dear " .$_get["name"] ."," . "</td></tr>"; $body .= "<tr><td style= 'padding-left:21px;'>thank visiting our website , contacting storage requirements. below summary of storage quotation: </td></tr>"; $body .= "<tr> <td style='text-align: left; font-family: arial; vertical-align: left;'> <img style='border: 0px solid ; ' src='http://www.magentastorage.co.uk/mobile/images/emailrequirements.png'> </td></tr>"; $body .= '</table>'; $body .= '<table rules="all" style="border-color: #fff; font-family: arial; width:470px; font-size:115%; background-color:#ffffff;" cellpadding="10">'; $body .= "<tr>"; $body .= "<td style= 'padding-left:21px;'>unit size:</td>"; $body .= "<td>"; $body .= $_get["unitsize"]; $body .= "</td>"; $body .= "<td></td>"; $body .= "</tr>"; $body .= '</table>'; $body .= '<table rules="all" style="border-color: #fff; font-family: arial; width:595px; font-size:115%; background-color:#ffffff;" cellpadding="10">'; $body .= "<tr> <td style='text-align: left; font-family: arial; vertical-align: left;'> <img style='border: 0px solid ; ' src='http://www.magentastorage.co.uk/mobile/images/emailquotation.png'> </td></tr>"; $body .= "<tr><td style= 'padding-left:21px;'>" ."weekly rental is" ." " ."&pound;" .$_get["price"] ." " ."</td> </tr>"; $body .= "<tr><td style= 'padding-left:21px;'>this quote includes vat, insurance cover to" ." " ."£" .$_get["insurance"] ." " ."and padlock secure storage unit</td></tr>"; $body .= "<tr><td style= 'padding-left:21px;'>" ."<strong>" ."**4 weeks free storage**" ."</strong>" ."</td>"; $body .= "<tr><td style= 'padding-left:21px;'>simply pay 4 weeks storage when move in , we'll give 4 weeks storage free!</td></tr>"; $body .= "<tr><td style= 'padding-left:21px;'>kind regards, </td></tr>"; $body .= "<tr><td style= 'padding-left:21px;'>store manager </td></tr>"; $body .= "</table>"; $body .= "</body></html>";

i'm not knowledgeable plenty php give tips, see quite few things wrong static html bits.

<td style='text-align: center; text-align: middle; vertical-align: middle; vertical-align: center'>

here, you've set vertical align twice. vertical-align: center isn't valid , should removed. add together min-width:595px style declaration.

<table rules="all" style="border-color: #fff; font-family: arial; width:595px; font-size:115%; background-color:#ffffff;" cellpadding="10"; position:relative; left:"20">

instead of border-color: #fff, create entire border. border: 3px solid #ffffff. have position:relative; left:"20" outside of style declaration, should moved. also, you'll need add together unit left value , remove semi-colon in cellpadding="10";.

<td style='text-align: left; font-family: arial; vertical-align: left;'>

you cannot set vertical align left.

also, when working in email, best utilize full, 6-character hex code. border: 0px solid can replaced border: 0. suggest using absolute font sizes, rather relative percentages.

once again, don't know how solid php is, seeing how there's quite few mistakes in html/css, suggest getting sorted out , email may behave bit nicer.

php css table gmail html-email

android - Google Map showing Blank -



android - Google Map showing Blank -

i have developed application have google map functionality utilize new google play services library when launch google map activity showing map blank wrong code

my manifest file xml

<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.apa" android:versioncode="1" android:versionname="1.0"> <uses-sdk android:minsdkversion="9" android:targetsdkversion="18" /> <permission android:name="com.example.apa.permission.maps_receive" android:protectionlevel="signature" /> <uses-permission android:name="android.permission.internet" /> <uses-permission android:name="android.permission.access_network_state" /> <uses-permission android:name="android.permission.write_external_storage" /> <uses-permission android:name="com.google.android.providers.gsf.permission.read_gservices" /> <uses-permission android:name="android.permission.access_coarse_location" /> <uses-permission android:name="android.permission.access_fine_location" /> <uses-permission android:name="android.permission.access_wifi_state" /> <uses-permission android:name="android.permission.internet" /> <uses-permission android:name="android.permission.write_external_storage" /> <uses-permission android:name="android.permission.access_network_state" /> <uses-permission android:name="android.permission.access_wifi_state" /> <uses-permission android:name="android.permission.access_coarse_location" /> <uses-permission android:name="android.permission.access_fine_location" /> <uses-feature android:glesversion="0x00020000" android:required="true" /> <uses-library android:name="com.google.android.maps" /> <application android:debuggable="false" android:allowbackup="true" android:icon="@drawable/app_icon" android:label="@string/app_name" android:theme="@style/theme.appcompat.light"> <activity android:name="***************" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.main" /> <category android:name="android.intent.category.launcher" /> </intent-filter> </activity> <activity android:name="*****.*****.***.viewonmap" android:label="@string/title_activity_view_on_map" /> <meta-data android:name="com.google.android.maps.v2.api_key" android:value=*********************************" /> <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" /> </application>

layout file

<?xml version="1.0" encoding="utf-8"?> <fragment xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/map" android:layout_width="fill_parent" android:layout_height="fill_parent" class="com.google.android.gms.maps.supportmapfragment" android:name="com.google.android.gms.maps.mapfragment" />

activity file

protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_view_on_map); global.startappad.loadad(); getsupportactionbar().setdisplayhomeasupenabled(true); fm = (supportmapfragment) getsupportfragmentmanager().findfragmentbyid(r.id.map); }

logcat error

google maps android api﹕ failed load map. error contacting google servers. authentication issue (but due network errors).

check api key carefully check sha key carefully you should connected net using wifi before first time using google map , wait 2-3 min till download map info etc. next time no need connected net if u want search location must connected net using wifi .

android google-maps google-maps-api-2

Emacs can't find gofmt in go-mode -



Emacs can't find gofmt in go-mode -

i'm trying utilize emacs golang programming. downloaded go-mode bundle , installed it. .emacs is:

(require 'go-mode)

when i'm opening *.go files, go-mode enables correctly. can't save *.go files because when i'm trying save *.go files i'm getting error in minibuffer says

gofmtprogram not found.

golang installed (version 1.3), gofmt works terminal.

how can solve problem?

thank you.

make sure have gofmt in path. (echo $path) check, if can't run gofmt in shell, emacs won't well.

gofmt on setup in $gobin/gofmt, think can in 1 of $gopath/bin.

if have in path, chances have emacs configuration sets path. alter needed.

if installed via packet manager, chances gofmt somewhere else. (i think brew puts in /usr/local/bin)

small tip when happen , need save: switch text-mode (m-x text-mode).

emacs go

c# - Info menu upon Hold for Windows phone -



c# - Info menu upon Hold for Windows phone -

is possible create kind of info menu when button has triggered event hold. i've looked bit contextmenu, not close automatically when stop holding. want popup, or similar thing shows kind of info when button event hold pressed, , closes when no more "holded". possible , in case should use?

i guess solution utilize popup say. when hold event fired show popup using position of finger. when user releases screen manipulation ended event should fired, can utilize boolean check if hold event or not.

if hold event close popup, or delete it, if need remove memory.

c# xaml button windows-phone-8

java - hashCode and compareTo for non-standard equals -



java - hashCode and compareTo for non-standard equals -

given next implementation of equals:

public class test implements comparable<test> { private int x, y; @override public boolean equals(object obj) { if (obj instanceof test) { test other = (test) obj; homecoming x == other.x || y == other.y; } homecoming false; } @override public int hashcode() { //implementation? } @override public int compareto(test o) { //implementation? } }

what correct/most performant implementation of hashcode , compareto? please note - equals uses or, not and

equals() method used determine equality of 2 objects.

when equality, should adhere next properties,

reflexive: always, = a. in java, a.equals(a) should true.

symmetric: if = b, b = a. in java, if a.equals(b) true, b.equals(a) should true.

transitive: if = b , b = c, = c. in java, if a.equals(b) , b.equals(c) true, a.equals(c) should true.

your equals() doesnot face upwards rules.

moreover according javadoc - recommended (though not required) natural orderings consistent equals. because sorted sets (and sorted maps) without explicit comparators behave "strangely" when used elements (or keys) natural ordering inconsistent equals. may face problem using implementation of equals() while natural sorting

good approach overriding equals method in java

do check -- if yes homecoming true. do null check -- if yes homecoming false. do instanceof check type cast object compare individual attribute starting numeric attribute because comparing numeric attribute fast , utilize short circuit operator combining checks. if first field not match, don't seek match rest of attribute , homecoming false.

java

sql - If...ELSE with subquery in MySQL -



sql - If...ELSE with subquery in MySQL -

in table 'chat':

i delete messages if have been deleted both sender recipient. if, however, user first delete message, should recorded under "deleted_by" user id (until sec user deletes message).

for message #3 , user #1 query so:

if (select deleted_by chat id=3) <> '1' , (select deleted_by chat id=3) <> '0' delete chat id=3 else update chat set deleted_by=1 id=3 end if

this should delete message #3, instead error. can help me create according sqlfiddle work?

thank you!

a subquery isn't needed. instead, can delete row if other user has marked deleted , if still exists, mark deleted:

delete chat id = 3 , deleted_by <> 0; update chat set deleted_by = 4 id = 3;

mysql sql if-statement subquery

Print multiple lines with variables in a single print() statement in Python -



Print multiple lines with variables in a single print() statement in Python -

is possible (using python 3):

le = "\n" var1 = 2 var2 = 5 print("information"+le "-----------"+le "variable1: {}".format(var1)+le "variable2: {}".format(var2)+le )

yes. take @ docs.

general example:

var1 = 2 var2 = 5 print("information", "------------", "variable1: {}".format(var1), "variable2: {}".format(var2), sep='\n')

python python-3.x

Android Backbutton Pressed Return to Two Activities -



Android Backbutton Pressed Return to Two Activities -

this may sounds simple, bewildered it. have searched not found solution.

my question is: how homecoming 2 activities when button pressed? this: allow me have activities a, b , c (a -> b -> c). want accomplish when on activity c , press button, should homecoming me activity a. when on b , press back, should homecoming me too.

it may implemented project many activities, assume don't need set class name of return, should recorded automatically android. how accomplish this?

thank you

a possible solution calling startactivityforresult() activity b, on callback of created activity c, previous activity b gets finished well. callback function called onactivityresult(), , in that, want phone call finish().

example:

activityb:

intent = new intent(this, activityc.class); startactivityforresult(i, 0); ... @override protected void onactivityresult(int requestcode, int resultcode, intent data) { this.finish(); }

activityc:

//do stuff

this way, when press (or phone call finish()) in activityc, phone call on activityb's onactivityresult() function, , end them both.

android

windows - c# - Validating expired domain credentials across the forest -



windows - c# - Validating expired domain credentials across the forest -

there a few questions inquire how validate active directory domain questions. however, not believe deal adequately multi-domain scenarios across forest. starters, both suggest definitive way perform advertisement authentication in c# .net 3.5+ should this:

bool isvalid = false; using(var ctx = new principalcontext(contexttype.domain, "foo.com")) { // verify user exists first var lookedup = userprincipal.findbyidentity(ctx, "myuser"); if (lookedup != null) { // validate credentials isvalid = pc.validatecredentials("myuser", "mypassword"); } }

this , when user want authenticate belongs foo.com. however, there subtle unexpected differences in case of user belonging kid domain, password expired. (i have got principalcontext find user in kid domain 2 different ways: (a) setting domain argument "foo.com:3268"; (b) adding container argument w/ base of operations dn of kid domain: new principalcontext(contexttype.domain, "foo.com", "dc=child,dc=foo,dc=com"). problem describe below occurs in both scenarios.)

if user belongs foo.com, , has expired password, validatecredentials returns true (at to the lowest degree on windows 7 i'm testing; i've seen others behavior different in windows 2003). however, if user belongs child.foo.com , password expired, validatecredentials returns false.

it pretty of import me able distinguish between "valid password expired" , "invalid password". if entered password right expired, want able redirect them "change password" screen. however, if password entered totally wrong, considered leakage of info forwards them alter password screen.

the way forwards see utilize ldap interface advertisement , seek parse status messages sends figure out underlying error code. sounds neither fun nor wise.

can provide reason behavior when dealing subdomains within same forest? can provide solution trying accomplish here?

so issue here appears .net tries what's called fast concurrent ldap bind ad. that's super lightweight mechanism , google seems indicate perhaps bypasses expiry check. didn't validate this, but, assuming it's true...

i think options here either a) binding (look @ ldapconnection class , associated flags) or b) p/invoke logonuser. may need dig in figure out passwory expiry status if phone call fails i'm not sure if either of tell it's expired or isn't reason failure.

c# windows authentication active-directory

scripting - Press button in application using perl -



scripting - Press button in application using perl -

how command application using perl script. 1 time application opened, how can press button on gui of application. eg:- after opening idm, want add together new download. doing how press "add url button"

please help

i have no thought idm is, don't tell or platform you're on. automate applications on windows utilize win32::guitest, x11 -> x11::guitest. documentatoin each links pages explaing theory, code samples , tutorials.

perl scripting automation

Paypal REST AVS/CV2 codes -



Paypal REST AVS/CV2 codes -

i'm using paypal rest api via rest-api-sdk-java , would inquire whether possible avs/cvv match results in response (or error object).

i did couple of tests (with sandbox , negative testing turned on) according https://developer.paypal.com/docs/classic/lifecycle/sb_error-conditions/ (parts "testing avs errors" , "testing cvv code"):

payment request billing address street "123 avs_a street" results in internal_service_error:

{ "name": "internal_service_error", "debug_id": "baf56174e98c8", "message": "an internal service error has occurred", "information_link": "https://developer.paypal.com/webapps/developer/docs/api/#internal_service_error" }

the same payment request billing address street "123 avs_m street" results in successful sale.

is internal_service_error expected error in such scenario (avs_a) ? there way how "raw avs code" instead of internal_service_error or credit_card_rejected?

my request payload:

{ "intent": "sale", "payer": { "payment_method": "credit_card", "funding_instruments": [ { "credit_card": { "number": "4446283280247004", "type": "visa", "expire_month": 11, "expire_year": 2018, "cvv2": "888", "first_name": "susan", "last_name": "wagner", "billing_address": { "line1": "123 avs_a street", "line2": "billing address line 2", "city": "london", "country_code": "gb", "postal_code": "w1t 2bu", "state": "", "phone": "12345" } } } ] }, "transactions": [ { "amount": { "currency": "gbp", "total": "3.55", "details": { "shipping": "0.00", "subtotal": "3.55", "tax": "0.00" } }, "description": "t-shirt xyz" } ] }

and 1 more question: possible utilize advanced fraud management filters on sandbox environment? i'm using pro test business relationship still can't utilize filters (nothing happens when click "upgrade now" button):

https://www.sandbox.paypal.com/uk/cgi-bin/webscr?cmd=_rc-manage

looking @ debug id, test did work - sort of -

internal sandbox api error 10555 - filter decline

--> https://developer.paypal.com/webapps/developer/docs/classic/api/errorcodes/

the transaction declined because of merchant risk filter avs. specifically, merchant has set filter decline transactions when avs returns partial match.

so you've enabled avs fraud management filter on sandbox account.

obviously, there should proper error message , not internal service error, looks error hasn't been mapped yet.

will follow pp devs study & prepare ;)

as avs / cvv response within rest - there doesn't seem way retrieve avs/cvv response of issuing bank yet.

paypal paypal-sandbox

angularjs - ng controller having '/' seperator Angular JS -



angularjs - ng controller having '/' seperator Angular JS -

i new angularjs programming. today reading interview questions on angiular js , find ng-controller having '/' , names not aware . mean. please help me.

question how initialize select box options on page load in angular js ?

answer : initialize work help of "ng-init"

<div ng-controller="myapps/mydashboard/myaccount" ng-switch on="!!myaccounts" ng- init="loadmydataydata()">

thanks in advance.

afaik, doesn't mean special. it's name of controller, happens contain slashes:

app.controller("the/name/you/want", function($scope) { ...));

angularjs angularjs-directive angularjs-scope

c++ - Something like a nested mutex but more generic? -



c++ - Something like a nested mutex but more generic? -

i working on project file must saved after operations have been performed on class's fellow member objects. want save file after 1 operation, need not save until after batch of operations have been performed.

my thought utilize class works recursive mutex. except instead of locking , unlocking mutex, want class phone call method (in case, save file) when lastly instance of class in stack falls out of scope.

implementing class not problem, feels generic problem can't find in boost or stl. there pre-existing standard solution problem, or need roll own class it? if so, approach right one, or there improve way solve problem?

below simple implementation of kind of behavior looking for. print "hello world!" twice though doitonce() beingness called 11 times. utilize genericguard pulling recognized standard rather sticking own implementation in code base. possible?

#include <iostream> void noop (void) { } void helloworld (void) { std::cout << "hello world!" << std::endl; } // imagine generic implementation like... template <void (*initfunc)(), void (*destructfunc)()> class genericguard { int & _i; public: genericguard (int & i) : _i(i) { if (_i++ == 0) { initfunc(); } } ~genericguard () { if (--_i == 0) { destructfunc(); } } }; int helloworldcounter; // utilize mill class in real-world? typedef genericguard<noop, helloworld> helloworldguard; void dosomethingonce (void) { helloworldguard g (helloworldcounter); // } void doittentimes (void) { helloworldguard g (helloworldcounter); (int = 0; < 10; ++i) { dosomethingonce(); } } int main (void) { dosomethingonce(); doittentimes(); homecoming 0; }

you can utilize shared_ptr custom deleter function.

stl (since c++11): http://en.cppreference.com/w/cpp/memory/shared_ptr/shared_ptr boost: http://www.boost.org/doc/libs/1_55_0/libs/smart_ptr/shared_ptr.htm#deleter_constructor

example :

#include <memory> #include <iostream> void helloworld(void *) { std::cout << "hello world!" << std::endl; } class mill { public: static std::shared_ptr<void> get_instance() { static std::weak_ptr<void> ref; if (ref.expired()) { std::shared_ptr<void> sp{nullptr, helloworld}; ref = sp; homecoming sp; } homecoming ref.lock(); } }; void dosomethingonce (void) { std::shared_ptr<void> g = factory::get_instance(); // } void doittentimes (void) { std::shared_ptr<void> g = factory::get_instance(); (int = 0; < 10; ++i) { dosomethingonce(); } } int main(void) { dosomethingonce(); doittentimes(); homecoming 0; }

c++ boost stl

SQL - Cannot get JOIN do what I want -



SQL - Cannot get JOIN do what I want -

i have 3 tables: tab1 having client id, start date , end date tab2 having type 1 transaction data: client id, transaction date, transaction amount tab3 having type 2 transaction data: client id, transaction date, transaction amount

i want have table next columns: col1: player_id col2: sum of transaction amount tab2 (type 1 transaction) occurred between associated start date , end date tab1 col3: sum of transaction amount tab3 (type 2 transaction) occurred between associated start date , end date tab1

i got work if bring together tab1 , tab2 joining 2 tables on player id , using:

sum(case when (transaction date >= start date , transaction date <= end date) transaction amount else 0 end)

but when bring together tab3 on player id, previous sum gives me different , much higher (and wrong) values. i'm sure i'm making mistakes on cartesian product i'm creating,

instead of bring together tab3 tried subquery on tab3, netezza sql did not allowed me that...

i have no thought how prepare it...

**update after comments***

this query i'm trying run:

select lm.player_id, /*sales before limit starts */ sum(case when (dt.cal_day_dt<=lm.hit_time , dt.cal_day_dt>lm.hit_time-14) .sales_amount else 0 end) sales_before14, /*sales before limit starts - command grouping */ (select sum(amount_won) ia_player_winners transaction_time<=lm.hit_time , transaction_time>lm.hit_time-14) sales_before14_control ( select player_id, min(hit_time) hit_time, re_enable_date, limits ia_player_spending_limits limit_type='w' grouping player_id, re_enable_date, limits ) lm bring together ia_player_sales_hourly s on lm.player_id = s.player_id bring together ia_dates dt on s.date_key = dt.date_key bring together ia_products pr on s.product_key = pr.product_key lm.hit_time >='2014-03-25' , lm.re_enable_date<='2014-05-24' grouping lm.player_id, lm.re_enable_date, lm.limits order lm.player_id;

i error: "relation 'lm' not exist"

when tried eliminate reference lm, got new error: "sub-select uses un-grouped attribute "rss".#hit_time#0xa69fca4 outer query"

you need 2 separate queries similar structure, 1 tab2 , 1 tab3 (or 2 subqueries, or 2 or 3 views, depending on sql dialect allows), because tab2 , tab3 unrelated; cannot bring together them in sensible way.

what happens in tests is, probably, bring together of 3 tables repeats rows in tab2 each row in tab3 having same customer_id , vice versa, summing multiple copies of each transaction.

sql join