Posts

Showing posts from January, 2013

javascript - TinyMCE stops working after parent element is removed from and re-inserted into the DOM -

i have tinymce instance running inside div, in list of sortable div elements. after container div get's removed , re-inserted in dom, tinymce still showing stops working. i'm not entirely sure happening there, there way reactivate this? i'm using tinymce 4.0. i think after removed div, attached handlers of div removed. when reinserted dom, time relative handlers not attached div, perhahps tinymce not working so. think need re-assign relative handlers div when reinserted dom.

ios - Repeat UILocalNotification on Specific day -

i need set uilocalnotification, need take hour , minute datepicker , need set specific date ( : monday ) , repeat on every monday. i have 2 question : first 1 ; possible show "day names" "sunday" on date section of date picker? second question ; correct codes if want set specific date local notification ? thank answers , here code below ; -(ibaction) alarmbutton:(id)sender { nsdateformatter *dateformatter = [[nsdateformatter alloc]init]; dateformatter.timezone = [nstimezone defaulttimezone]; dateformatter.timestyle = nsdateformattershortstyle; dateformatter.datestyle = nsdateformattershortstyle; nsstring *datetimestring = [dateformatter stringfromdate: datetimepickerset1.date]; nslog ( @"alarm set :%@" , datetimestring); [self schedulelocalnotificationwithdate1: datetimepickerset1.date]; } -(void)schedulelocalnotificationwithdate1:(nsdate *)firedate { uilocalnotification *notification = [[uilocalnotification alloc] init]; notificati...

Prestashop payment module override -

i have 1 problem regarding module override. have created custom payment module learning purpose , want change cart amount total placed order. $this->module->validateorder gives error amount. there way override validateorder function of paymentmodulecore class ? you can create own class , override function, example : class mypaymentmodule extends paymentmodule { public function validateorder($id_cart, $id_order_state, $amount_paid, $payment_method = 'unknown', $message = null, $extra_vars = array(), $currency_special = null, $dont_touch_amount = false, $secure_key = false, shop $shop = null) { // code } } and module extends mypaymentmodule, not paymentmodule.

spring - No bean named springSecurityFilterChain is defined -

i need integrate spring security small application built spring 3.1.1, following this tutorial @ point 3.2.1, got error trace: gen 31, 2014 3:08:41 pm org.apache.catalina.core.standardcontext filterstart grave: exception starting filter springsecurityfilterchain org.springframework.beans.factory.nosuchbeandefinitionexception: no bean named 'springsecurityfilterchain' defined @ org.springframework.beans.factory.support.defaultlistablebeanfactory.getbeandefinition(defaultlistablebeanfactory.java:529) @ org.springframework.beans.factory.support.abstractbeanfactory.getmergedlocalbeandefinition(abstractbeanfactory.java:1095) @ org.springframework.beans.factory.support.abstractbeanfactory.dogetbean(abstractbeanfactory.java:277) @ org.springframework.beans.factory.support.abstractbeanfactory.getbean(abstractbeanfactory.java:197) @ org.springframework.context.support.abstractapplicationcontext.getbean(abstractapplicationcontext.java:1097) @ org.springfr...

javascript - JS - construct an event -

i'm reading code example , i'm wondering last line means: function simulateclick() { var event = new mouseevent('click', { 'view': window, 'bubbles': true, 'cancelable': true }); var cb = document.getelementbyid('checkbox'); var canceled = !cb.dispatchevent(event); it means canceled assigned false if cb.dispatchevent(event) returns truthy (i.e. false , 0 , '' , null , undefined or nan ) , vice-versa.

printing - PrintDocument1_PrintPage vb.net -

i've tried print document many rows in datagridview , want print continously having next page data not including 1st page gives me same 1st page heres code : dim integer private sub printdocument1_printpage(byval sender system.object, byval e system.drawing.printing.printpageeventargs) handles printdocument1.printpage = + 1 dim bm new bitmap(me.panel2.width, me.panel2.height) panel2.drawtobitmap(bm, new rectangle(0, 0, me.panel2.width, me.panel2.height)) e.graphics.drawimage(bm, 0, 0) if (i = 1) e.hasmorepages = true else e.hasmorepages = false dim aps new pagesetupdialog aps.document = printdocument1 end sub can me in kind of problem sorry wrong grammar thanks what doing screen print see get. if want stay way, need advance rows on grid see different records. what should printdocument print out looks document instead of picture.

stored procedures - How long will a temporary MEMORY table persist if I don't drop it (MySQL) -

i'm using recursive stored procedure in mysql generate temporary table called id_list , must use results of procedure in follow select query, can't drop temporary table within procedure... begin; /* generates temporary table of id's */ call fetch_inheritance_groups('abc123',0); /* uses results of sproc in */ select a.user_id usr_relationships r inner join usr_accts on a.user_id = r.user_id r.group_id = 'abc123' or r.group_id in (select * id_list) group r.user_id; commit; when calling procedure, first value top id of branch want, , second tier procedure uses during recursions. prior recursive loop checks if tier = 0 , if runs: drop temporary table if exists id_list; create temporary table if not exists id_list (iid char(32) not null) engine=memory; so question is: if don't drop temporary memory table @ end of procedure, or within transaction, how long table persist in memory? automatically dropped once session ends, or remain in me...

c# - SolrNet OR query -

i trying query records parentid = thread or dataid = thread. query keeps timing out on me. there wrong query below? var test = solr.query(new solrquerybyfield("parentid", thread) || (new solrquerybyfield("dataid", thread))); i not expert in solr.net have used 1 project. can suggest try couple of things. first go solr admin , try executing query: (parentid:"thread") or (dataid:"thread") if result , not timing out, can use same string in solr.net like: string strquery = "(parentid:\"thread\") or (dataid:\"thread\")"; // or use * contains instead of double quotes var query = new solrquery(strquery); sortorder sortorder = new sortorder("parentid"); var solrqueryresult = solr.query(query, new queryoptions { rows = 100, //max rows returned start = 0, orderby = new[] { sortorder }, //if want ordered result }); var list = solrqueryr...

performance - What's making this program slow to process? (C++) -

#include <iostream> #include <vector> using namespace std; int main() { vector< int > number; bool numbersarecorrect = false; int input; while( cin >> input ) number.push_back( input ); vector< int > unique_number( number.size(), 0 ); vector< int > repeated( number.size(), 1 ); for( int = 0; < number.size(); i++ ) { for( int j = + 1; j < number.size() + 1; j++ ) { if( number[ ] != 0 && number[ ] == number[ j ] ) { repeated[ ]++; unique_number[ ] = number[ ]; } else unique_number[ ] = number[ ]; if( j == number.size() ) { for( int z = 0; z < number.size(); z++ ) { if( number[ z ] == unique_number[ ] ) number[ z ] = 0; } } } } fo...

How to force bootstrap 3 to load a view regardless of device size detected -

bootstrap 3 not support blackberry devices, menus won't work, links broken. have several sites done using bootstrap 3 , need solution. i able force bootstrap use small[tablet] or medium[desktop] views when blackberry device detected. is there way can done? it seems may want use black art of user agent sniffing. check blackberry browser, , use media queries achieve you're looking for.

android - No matching function for std::find() in eclipse. Works fine in XCode -

i"m running eclipse head scratcher. have trying check see if string in std::vector called multiplayername. call if (std::find(multiplayernames.begin(), multiplayernames.end(), username) == multiplayernames.end()) { //blah blah } to it, works find in xcode, gives me no matching function call 'find(std::vector<std::basic_string<char> >::iterator, std::vector<std::basic_string<char> >::iterator, std::string&) error in eclipse. assume issue how have eclipse set up. currently, have app_stl := gnustl_static in application.mk , i'm using ndk8b both xcode , eclipse. else need fix working? you'll need include header declares std::find #include <algorithm>

oracle - Validate Column values while insert in PL/SQL -

i have following example create table test ( c1 nvarchar(50) not null, c2 number, c3 date); insert test(c1,c2,c3) select (v1,v2,v3)from emp ; i want add validations not insert null values c1, not insert string c2, insert dates only c3. any idea in pl/sql ? thanks there no need table definition, oracle throw error if try insert "wrong" data. i have spotted should use select statement without parantheses: insert test (ca, c2, c3) select v1, v2, v3 emp; maybe , want insert records fit table constraints. in case can use dbms_errlog along log errors into clause. the records don't fit criterias inserted in table further review. see this sql fiddle .

c# - XNA Unexpected ')' Effect Compiler -

my xna hlsl compiler keeps telling have unexpected ')' @ end of subtraction. pixelshader: float3 lightdir = normalize(lightdirection); float3 viewdir = normalize(input.view); float3 normal = input.normal; float diff = saturate(dot(input.normal, lightdir)); float3 reflect = normalize(2 * diff * normal - lightdir); float specular = pow(saturate(dot(reflect, viewdir)), specularintensity); return tex2d(colormapsampler, input.texcoord) * diffuseintensity * diffusecolor * diff + specularcolor * specular); sometimes though randomly works there after @ spot "bugs" again. return tex2d(colormapsampler, input.texcoord) * diffuseintensity * diffusecolor * diff + specularcolor * specular); that's 1 opening brace , 2 closing braces; 1 of these should removed. i'm guessing it's first one?

javascript - Show new line instead of \n -

Image
i experimenting html5's new localstorage , far have been in capturing content (text) inputted onto form , storing in localstorage. my problem starts when person comes page, want localstorage values loaded correct input on form. i doing success, users see following: but them see text without double quotes , new lines characters, them see: hi how you just inputted originally. how can achieve this? appreciated. to set value of text area, using following: $(document).ready(function() { alltextareasonpage.each(function(index, entry) { var idoftextarea = $(this).attr('id'); if (pagelocalstorage.get(idoftextarea)) { $(this).val(pagelocalstorage.get(idoftextarea)); } }); }); looks me string being stored json... $(this).val(json.parse(pagelocalstorage.get(idoftextarea))); should solve it, should cause...

git - How do I get a list of all remote branches that I create -

the command git branch -a produces list of on 250 branches. i'd know mine can verify they're merged production , delete remotes. is there git command show me remote branches created? easier if branches created still in local repo, got new computer local repo lost. don't have branches locally, nor have complete reflog. assuming branches created last commit performed (is correct case?), here small python script wrote solve problem: #!/usr/bin/python import subprocess remotes_output = subprocess.check_output("git branch -r".split()) remotes = remotes_output.split()[2:] author_cmd = lambda b: "git log -1 --pretty=format:'%%an' %s" % b branch_name in remotes: print '%s : %s' % (branch_name, subprocess.check_output(author_cmd(branch_name).split())) it takes names of remote branches, removes first entry mapping head , prints out authors - in sense written above. now, copy script file , grep output in shell: python t...

c++ - boost signal-slot generalisation -

i searching way implement this, using boost class genboost{ boost::signal<void(void)> m_signal; std::function<void (bool)> m_function public: void setsignal(boost::signal<void(void)> sigarg) { m_signal = sigarg; } void setfunction(std::function<void (bool)> &functionarg) { m_function = functionarg; m_signal.connect(boost::bind(&gebboost::onsignal,this,_1)); } void onsignal(){ //do } }; how can achieved. signal copying not possible!? i not 100% sure of intent, assuming onsignal() not need interact m_signal (and need 1 connection m_signal ), appears can decouple m_signal class entirely. example, if not want body of 'onsignal()' called until 'm_function' has been set, like: class genboost{ std::function<void (bool)> m_function; boost::signals::scoped_conection m_connection; public: void setsignal(boost::signal<void(void)>...

fortran90 - Fortran 90 and MPI error -

i writing small program understand mpi (mpich implementation) , fortran 90. unfortunately code not running when executed "-np 2". this code: program main use mpi implicit none integer :: ierr, npe, mynpe integer :: istatus(mpi_status_size) real :: aa call mpi_init(ierr) call mpi_comm_size(mpi_comm_world, npe, ierr) call mpi_comm_rank(mpi_comm_world, mynpe, ierr) if (mynpe == 0) read(*,*) aa call mpi_send(aa, 1, mpi_real, 1, 99, mpi_comm_world, ierr) else if (mynpe == 1) call mpi_recv(aa, 1, mpi_real, 0, 99, mpi_comm_world, istatus, ierr) write(*,*) "ho ricevuto il numero ", aa end if call mpi_finalize(ierr) end program i compiling mpif90 mpi_2.f90 -o output , when execute mpirun -np 2 output following error: at line 14 of file mpi_2.f90 (unit = 5, file = 'stdin') fortran runtime error: end of file the shell still waits input , if insert number (e.g. 11) fol...

web services - User defined log files for SOAP requests and Responses in Websphere 8 -

i have soap based web services running in websphere 8. since have trace.log, have webservices request , response xml. trying log different file apart trace.log. to precise, if service helloworldservice. log soap requests in service_helloworld.log. have defined appenders , loggers in log 4j already. looking way configure websphere redirect webservices traces file. i still write interceptor, trying in websphere configs. please help i don't know if still have problem... had same 1 , fix implementing generichandler interceps request/response. take look: http://www.ibm.com/developerworks/websphere/library/techarticles/0511_phung-lu/0511_phung-lu.html

json - Performance impact of instanced objects in Javascript -

i have application calculates , stores data in following way (obviously case here has been simplified, in reality there many more properties in inner object): var processeddata = []; sourcedata.foreach(function (d) { processeddata.push({ a: geta(d), b: getb(d), c: getc(d) }); }, this); function dostuff(row) { // stuff } the number of objects created here can high (thousands), performance fine current approach in wider context think improve code readability , testability if moved more defined object format: var row = function (a, b, c) { this.a = a; this.b = b; this.c = c; this.dostuff = function () { // stuff } }; var processeddata = []; sourcedata.foreach(function (d) { processeddata.push(new row( geta(d), getb(d), getc(d) )); }, this); there 2 elements i'm worried here, 1 performance/memory cost of constructing instanced object new. second memory cost of including function in ob...

osx - Is it possible to view git diffs using a GUI side-by-side tool on Mac? -

i hate visualizing diffs using default unix diff tool. possible view git diffs using gui tool nicely display local , remote side-by-side, similar how possible set mergetool diffmerge , when git mergetool myfile.txt it pops diffmerge gui easier visualization , merging? using osx. you use opendiff . command line tool opens gui of filemerge . you instruct git use automatically git-mergetool with: git config --global merge.tool opendiff if want git-difftool well: git config --global diff.tool opendiff and disable prompting every file with: git config --global difftool.prompt false for more details type: git config , search / different options. p.s. if don't have opendiff installed install developer tools xcode: https://developer.apple.com/library/mac/documentation/darwin/reference/manpages/man1/opendiff.1.html update : in recent versions of xcode, filemerge bundled xcode. cannot install filemerge standalone program. opendiff still in co...

Compile NGINX with Visual Studio -

i have 2 questions regarding nginx: is there 1 had compile nginx visual studio? want create vs9 project compiling nginx. it's veritable need, there way compile nginx lib or dll? i finished building visual studio 2010 project nginx. process wasn't entirely straight-forward, attempt detail i've learned. several-hour several day process, depending on experience. step 1: must first follow guide building nginx on windows . not builds nginx, creates .c , .h files use when creating visual studio project. won't work without these files. (for more information, see here .) if less experienced unix me, guide above leaves unanswered questions. i'll first flesh out guide tips of own, , later, tell more creating project visual studio. part i: compiling nginx windows using msys first, follow steps given above. install msys, strawberry perl, mercurial, , download pcre, zlib, , openssl libraries. follow these steps: 1) open command prompt administrator. ...

ruby - Removing a Hash -

this question has answer here: optional argument after splat argument 6 answers so works, except 1 problem, comes under method calculate. i'm using tdd program , telling me works except when calculate passed (0,3,5) inserts 5 options, when should default addition , add numbers 0, 3, 5 since options part blank. how make options deleted, or passed true if there nothing there code passes without add: true or subtract: true? def add(*numbers) numbers.inject(0) { |sum, number| sum + number } end def subtract(number1,*additionalnums) number1-add(*additionalnums) end def calculate(*addsubtract, options) result = add(*addsubtract) if options[:add] result = subtract(*addsubtract) if options [:subtract] result = calculate.delete(-1) if options.is_a?(symbol) result end you use named parameters (aka 'keyword arguments'), introduced in ruby 2...

swing - Runtime exec launch application in background java -

when run following code, notepad getting launched in background instead of foreground runtime rt = runtime.getruntime(); try { rt.exec("notepad.exe"); } catch (ioexception ex) { } example: from java desktop application, trying launch "notepad.exe". notepad getting launched behind application. i see notepad should appear in foreground. could please me resolve it? the following open both files , executables (.exe): java 1.6 , above: try { desktop.getdesktop().open(new file("notepad.exe")); } catch (exception e) { e.printstacktrace(); } java 1.5 , under, without external library (windows only): try { runtime.getruntime().exec("cmd /c \"notepad.exe\""); } catch (exception e) { e.printstacktrace(); } i tested 1.5 solution opening excel files not opening executable files, i'm guessing work to.

POST value becomes empty when inserted in MYSQL string, PHP -

i sending values ajax post php file: know getting them because can see values sent in console: table=menu&colid=mid&id=2&colname=status&value=1 but strange reason when insert them query string: "update ".$_post['table']." set ".$_post['colname']." = ".$_post['value']." ".$_post['colid']." = ".$_post['id']; value empty when value = 1!!! update menu set status = '' mid = '2' i solved problem changing variable name value val, has experienced similar? value keyword or reserved word? any thoughts? thanks this sql update menu set status = '' mid = '2' doesn't reflect doing in php. line: "update ".$_post['table']." set ".$_post['colname']." = ".$_post['value']." ".$_post['colid']." = ".$_post['id']; otherwise should read: ...

ajax - live update google charts php+js -

i have candlestick chart drawn googlecarts api. can't live updating it. next code html part of chart visualisation: <script type='text/javascript'> function drawv(){ var = $.ajax({ url: "_ajax3.php", datatype:"html", async: false }).responsetext; console.log(a); var data = google.visualization.arraytodatatable([a],true); options = { chartarea:{ left: 55, top: 40, width: 760, height: 210 }, candlestick:{ fallingcolor:{ fill: "#41a6ef", stroke: "#41a6ef", strokewidth: 1 }, risingcolor:{ fill: "#f01717", stroke: "#f01717", strokewidth: 1 }, hollowisrising: true }, series: {0: {type: "candlesticks"}, 1: {type: "line", targetaxisindex:1, color:"#91d6ff"}}, legend:"none" }; chart = new google.visualization.combochart(docum...

javascript - Update ViewModel using Custom Bindings KnockoutJS -

so have spa developed using this sample . the sample shows list of todo in table this <section id="lists" data-bind="foreach: todolists, visible: todolists().length > 0"> <table width="100%" style="margin-top: 20px;" class="table-main"> <thead> <tr class="b-table-line"> <th>select</th> <th>title</th> <th>artist</th> </tr> </thead> <tbody data-bind="foreach: todos"> <tr> <td> <input type="checkbox" data-bind="checked: isdone" /></td> <td> <input class="todoiteminput" type="text" data-bind="value: title, disable: isdone, bluronenter: true, updateontitle:true, click: $root.clearerrormessage" /> </td> <td> <input class="todoiteminput...

c# - Using SIMD in a CLR C++ library -

c# , visual basic , .net clr excellent development environments user interfaces , line-of-business applications, etc. however, i've been writing lot of code execution timings go around o(n^3): n > 1000 , , in couple of places, higher that. these loops read 1 large array, little math , make 5 or 6 tests, , write result second array of identical size. most of code ported intel fortran programs, in order bring them 64-bit world. i've noted without auto-vectorization of code, execution times slower. .net has no support use of simd operations found on every intel processor sold today. since functions written in tight algorithm can ported skilled programmer, thought asking programmer port code c++ clr library might approach. is possible c++ library auto-vectorized , presents clr interface c#/vb program call? if no, workarounds exist? com interface 1 such workaround? if yes, form have take? sure, no problem. c++/cli class library project gives way write m...

c# - Can creating indexes on MongoDB collections in a replica set be done programmatically? -

i've seen instructions creating indexes on replica sets in mongodb here . looks involved , requires mongo shell. there easier way and/or can done using c# mongodb driver? as can see in docs , there 4 possible stages both primaries , secondaries: build index in background on primary. build index stop 1 secondary restart program mongod the first 2 can using driver, because mongod up. use ensureindex right parameters. for next 2 can't use driver can still programmatically in command prompt: var stop = process.start("mongod", "--shutdown"); var standalone = process.start("mongod", "--port 47017"); var replicated = process.start("mongod", "--port 27017 --replset rs0");

machine learning - Decision tree with high cardinality attribute -

i want learn decision tree having reasonable discrete target attribute 5 possible different values. however, there discrete high cardinality input attributes (1000s of different possible string values) wonder if makes sense include them. there policy maximum cardinality should when including attribute train decision tree? there no maximum cardinality, no. of course, omit values not appear in data. you have use rdf implementation handles multi-label categorical features directly rather converts them series of binary indicator features. for categorical feature n values there 2^n - 2 possible decision rules on feature, many consider long way. heuristic have used compute entropy of target when divide data n categorical feature values. order values entropy , evaluate n-2 rules considering prefixes of list.

css - Cant get the pseudo class before to work -

so here's i'm trying do, i want add top background strip(of height 30px) how stackoverflow has using pseudo class before. know can done without i'm interested know if can accomplished using :before pseudo class. here's code, <div class="container"> //other divs </div> and here's css i'm using, .container:before { content: " "; background-image:url(../images/head-bg.jpg); background-repeat:repeat-x; min-height:30px; } i read somewhere content: " "; needs added pseudo class work i've added nothing in quotes. i've tried removing background code css , adding text within content quotes , works. however, when add code background doesn't. i'll grateful if point out mistake doing this. thanks time. you should set width of .container whatever need be. should use height instead of min-height . :before , :after pseudo elements display:inline default, in order height , width ap...

javascript - Mouseup to cancel all event under Mousedown -

i trying implement div resize code using jquery . see here . for moves per mouse movement. codes here: $('#top-left').mousedown(function(){ event.stoppropagation(); $(document).mousemove(function(event){ var current_width=$(".active").width(); var current_height=$(".active").height(); var position = $(".active").position(); var new_width=current_width+(position.left-event.pagex); temp=$("#mouse").html(); $("#mouse").html(temp+"<br />new_width= "+new_width); $(".active").css({top:event.pagey+"px"}); //$(".active").css({width:new_width+"px"}); }); }); $('#top-left').mouseup(function(){ event.stoppropagation(); }); i want when mouseup called, events registered current div.active gets removed. please let me know if not clear. check jsfiddle here . if want div.acti...

android - How to hook/monitor network calls made by integrated third party libraries? -

we working on ad mediation project requires integrating arbitrary number of third party libraries larger framework. libraries have common behavior of contacting external server , returning valid android layout or failing, can assume no knowledge or control on internal functions. the server interaction carried out third-party library opaque standpoint of framework/app initiates call sequence. potentially allows library implemented access , transmit sensitive information based on permissions of app. the objective calling process able capture http request being made integrated library @ framework/app level before passed out network. ideal case ability process , potentially block request. alternative find way log requests , provide feedback actionable analysis. i'm not finding helpful in docs or searching forums. possible in android? you think second helper-app without permissions, takes 3rd-party libs plugins. main-app communicates via aidl helper-app. 3rd-party lib...

xml - XSL: how to convert this 004 to just 4 -

i have xml looks following: <vteam id="004">visiting team</vteam> i attempting retrieve value 4 using following in xslt (1.0): <xsl:apply-templates select="number(vteam/@id)"/> this giving me compilation error. what's right way of going it? you can this... <xsl:value-of select="number(vteam/@id)"/> or, depending on else doing, this... <xsl:apply-templates select="vteam"/> <xsl:template match="vteam"> <xsl:value-of select="number(@id)"/> </xsl:template> (of course, xsl:apply-templates have inside separate template)

Ruby Gem ActiveAdmin Install Error -

i trying install activeadmin gem following error. running commandline harsha@harshamv:~$ gem install activeadmin error: while executing gem ... (gem::dependencyresolutionerror) conflicting dependencies arel (~> 2.0.2) , arel (~> 4.0.0) activated arel-4.0.0 via: arel-4.0.0 (~> 4.0.0), activerecord-4.0.0.rc2 (= 4.0.0.rc2), rails-4.0.0.rc2 (< 4, >= 3.0.0), activeadmin-0.6.3 (= 0.6.3) instead of (~> 2.0.2) via: meta_search-1.0.0 (~> 1.0), activeadmin-0.6.3 (= 0.6.3) if using rails 4, need use >= 1.0.0.pre version of activeadmin. best way of doing right is: gem 'activeadmin', github: 'gregbell/active_admin' in gemfile.

amazon web services - SNS GetEndpointAttributes & Publish to Endpoint not available in .Net SDK -

i using v2.5.26.2, runtime version v2.0.50727 of aws sdk .net , noticed getendpointattributes calls not available sns client, nor can target endpoint arn in publish request message. the documentation api, getendpointattributes method ,for sns indicates should able both of things. i tired asking question on aws support forums figure out why call not available have yet receive reply more week later. i tried several web searches problem no avail. is limitation of .net sdk or perhaps limitation of version using? if so, there workaround make either of these calls. edit: code samples requested (although not show since objects not getting recognized getendpointattributes so according amazon documentation getendpointattributes first need create class derives virtual class getendpointattributes so. using system; using system.collections.generic; using system.linq; using system.text; using amazon.simplenotificationservice; using amazon.simplenotificationservice.model; na...

javascript - How to use json_encode correctly? -

i'm trying display family tree. tool i'm using called javascript basic primitives. here can find more info it: http://www.basicprimitives.com/index.php?option=com_content&view=article&id=1&itemid=4&lang=en function displays every leaf of tree: /** * displayleaf * displays leaves of family tree current individual , relatives */ function displayleaf($type, $individualid, $name, $dates, $gender, $bio, $avatar, $username, $relationships, $relationshipdates) { ?> var individualid = <?php echo json_encode($individualid); ?>, name = <?php echo json_encode($name); ?>, dates = <?php echo json_encode($dates); ?>, gender = <?php echo json_encode($gender); ?>, bio = <?php echo json_encode($bio); ?>, avatar = <?php echo json_encode($avatar); ?>, username = <?php echo json_encode($username); ?>, relationships = <?php echo json_encode($relationships); ?...

javascript - How to convert object array into 2d array of parent child hierarchy? -

using declaration multidimensional object (shown below) can make attacksource of label type " inside " contain multiple children e.g "dos","login abuse" var data = [ { "attacksource": 43, "attacktype": 60, "at":"dos","label": "inisde" }, { "attacksource": 29, "attacktype": 40, "at":"login abuse","label": "outside" } ]; what have tried using js as var data = [ [{"attacksource": 43,"label":"inside"}], [ {"attacktype": 13,"label":"dos"}, {"attacktype": 13,"label":"virus"} ] ]; is correct assignment task? thanks what want json . it's not clear whether you're talking transforming existing json or building 1 scrat...

c# - Action for form tag not rendering correctly in IE10 -

we have older website (written in c#.net 2.0) uses master page (site.master). has form until point has worked on browsers. however, in ie10, when hit submit, resource not found error message. when did view page source on form, saw form tag being rendered such: <form name="aspnetform" method="post" action="/web/web/maillist.aspx" id="aspnetform"> in other browsers, correctly renders as: <form name="aspnetform" method="post" action="web/maillist.aspx" id="aspnetform"> i'm @ loss explain why duplicating folder name. has else dealt issue? thanks eta: have little more information. seems due compatibility mode in ie10. in our company, have defaulted "on". if mess little button in upper-right corner, can submit. need find way override this. i have run in past , found adding leading / action prevent duplication seeing. your other option force ie out of compatib...

xmlstarlet: How to conditionally add missing element (upsert) -

using xmlstarlet, want add property list, <document> <properties> <property>...</property> <property>...</property> <!-- add this! --> </properties> </document> which easy, except "properties" tag optional , may missing in original document, in case "properties" tag needs conditionally created. the ed subcommand doesn't have conditionals, there no nice way, think insert new properties element , delete if turns out "extra" (i.e. not first): xmlstarlet ed \ -s /document -t elem -n properties -v '' \ -d '/document/properties[position() != 1]' \ -s /document/properties -t elem -n property -v 'new property value' \ doc.xml otherwise, check first sel , use shell conditionals decide whether insertion needed.

java - How to export the results of ListDataProvider to excel in GWT -

i using listdataprovider handle data in celltable , want export int listdataprovider excel sheet. using https://code.google.com/p/gwt-table-to-excel/ plugin, export item in table wants export in data provider. how can or if there other method export result in excel sheet. how changing table page size. celltable has "constructs table given page size". http://www.gwtproject.org/javadoc/latest/com/google/gwt/user/cellview/client/celltable.html

sql - Need a query to count number of times a customer visits each region -

i have table has account_number field , region field, looks this: account_number ... region 12345678 region1 12345667 region2 i need count number of times account number visits each region, output like: account_number ... nbr_visits ... region 12345678 3 region 4 45678923 6 region 2 so, account number can occur multiple times if customer visits different regions in same month. isn't way have set up, 3rd party requiring format , i'm not sure best way go it. i'm using ms access 2010. select account_number,region,count(*) nbr_visits mytable group account_number,region

ruby on rails - Docusign Not Generating Multiple Embedded Recipient Views -

i using docusign rest api, through gem rails . have 2 recipients, , need both of them sign document. it should work this: generate envelope borrower(s) info passing envelope. display embedded document signing. return custom url/action if there signer, it should reload iframe ask second signers signature, same template signed instead breaks when reloads iframe 2nd signer. generates envelope, second signer unique id, email etc. when create recipient view, returns nil. how signer 1 sign, load second signer right after, custom fields filled both times? def deliver(signing_borrower) client = docusignrest::client.new hashdata = { status: 'sent', template_id: my_id signers: [ { embedded: true, name: signing_borrower.name, email: signing_borrower_email, role_name: if (signing_borrower==borrower) 'borrower' else 'co-borrower' end } ] } generate_liabilit...

node.js - Using and populating (real) DBRef arrays with Mongoose / mongoose-dbref -

mongoose doesn't appear support mongo dbrefs. apparently released "dbref" support plain references (no ability reference documents different collections). i've managed craft schema allows me hold array of objectid references , populate them, great parts of schema, extremely convenient if use proper dbrefs create array lets me refer documents number of collections. luckily(?) there's module can monkey patch dbref support mongoose: https://github.com/goulash1971/mongoose-dbref unluckily, can't make sense of documents. best can tell there no ability use dbrefs in array (there 'fetch' method dereference, takes single dbref); 'populate' doesn't seem patched fill in dbrefs, , can't tell how i'm supposed assign dbref given source document [collection.items.push(?????)]. from internet, appears can assign object of form { $id: document._id, $ref: 'collection' } -- when logging result, appears have "taken" dbref d...

php - Laravel 4 & Sentry 2 extending the sentry class -

having issues trying extend sentry class in sentry 2. here have done , trying do: created new facade: namespace pusers; use illuminate\support\facades\facade; class adsentryfacade extends facade { /** * registered name of component. * * @return string */ protected static function getfacadeaccessor() { return 'pusers\adsentry'; } } extedned sentry class(all use namespaces there removed clean in post). there lot more trying working @ point: namespace pusers; class adsentry extends \cartalyst\sentry\sentry { public function authenticate(array $credentials, $remember = false, $aduser = false) { return (string)$this->throttleprovider->isenabled(); } } inside of app.php changed alias from: 'sentry' => 'cartalyst\sentry\facades\laravel\sentry' to 'sentry' => 'pusers\adsentryfacade' the problem: when use alias nothing except actual sentry cl...

javascript - Having function as argument in setInterval -

i'm trying pass function setinterval function. doesn't seem working code. right code below works @ first, how pass function parameters when calling setinterval function? //works here ajaxupdateone(function(countone,counttwo) { var itemcount = countone; var totalcount = counttwo; console.log(itemcount); console.log(totalcount); }); //does not work here. var myvar = ajaxupdateone(function(countone,counttwo) { var itemcount = countone; var totalcount = counttwo; console.log(itemcount); console.log(totalcount); }); setinterval(myvar,8000); while code posted partial, , not clear ajaxupdateone() does, assuming calls $.ajax() , updates page based on response results. however, able pass parameters function called later in setinterval() , following construct can used: var deferredupdate = function(countone, counttwo) { return function() { ajaxupdateone(countone, counttwo); } } setinterval(deferredupdate(42,3), 8000); setinterval...

ios - UIImage imageOrientation always reads opposite of way a picture is actually taken -

i encountering strange issue image.imageorientation appear opposite of way picture taken. example, when hold iphone 5 upright take picture, resulting image.imageorientation says "landscape", , verse versa. here code taking picture, , checking image's orientation: if ([mediatype isequaltostring:(nsstring *)kuttypeimage]){ //a photo taken self.imagetakenorselected = [info objectforkey:uiimagepickercontrolleroriginalimage]; if (self.imagetakenorselected.imageorientation == uiimageorientationup) { nslog(@"!------portrait"); } else if (self.imagetakenorselected.imageorientation == uiimageorientationleft || self.imagetakenorselected.imageorientation == uiimageorientationright) { nslog(@"!------landscape"); } nslog(@"self.imagetaken width: %f, , height %f", self.imagetakenorselected.size.width, self.imagetakenorselected.size.height); } for example, when ...