Posts

Showing posts from January, 2011

ios - SNS Push Notification Service Multi threading Publish API to publish 100,000 messages in 2 seconds -

i reading following blogpost ( https://aws.amazon.com/blogs/aws/push-notifications-to-mobile-devices-using-amazon-sns/ ) sns , states can "send messages directly specific device calling publish function device’s arn. can scale handle millions of users storing endpoint arns in amazon dynamodb , using multi-threaded code on server." i'm having issues understanding how can scale 1 million users. each call taking 500-800ms me. way many parallel connections if wanted send notification million users in 10 second span. my goal able hit 100,000 users push notif using publish api using device arn directly (not topics) in 2 seconds. have suggestions @ how achieve this? thanks, matt if want send same message clients benefit subscribing "consumers" same sns topic. way need send 1 message , sns automatically fanout it's subscribers. from sns faq q: there limits number of topics or number of subscribers per topic? by default, sns offers 10 mill

javascript - API Cluster - Using Custom Group Config for Default Endpoint -

i'm using api cluster library. when try create multiple endpoint group sometime might want use default endpoint pattern config options can different. scenario: if don't mention 'endpoint' in group value should taken default 'endpoint' pattern please have @ code click here this 1 of limitation in api cluster 1.0.5 js library. because api cluster 1.0.5 expect addanother / defaults method parameter requires below 3 options mandatory. name config endpoints defaults / addanother method creates endpoint groups, each group independent try below problem. apicluster .defaults({ name: 'mydefault', config: { 'employee': 'emp', 'details': 'defaultdetails', 'timesheet': 'timesheet' }, endpoints: { "empdetails": "_employee_/_details_/:empid/profile" } }) .addanother({ name: 'v1', config: {

php - Issues with ungreedy match -

in php, i'm matching text here http://pastebin.com/pfjegqpd following regex: preg_match('#(.*(?s))(particella |particelle |p\.|part\.|p |part |mappale |mapp\.|mapp |n\.|\*) *(\d+[\d /\p{pd}]*)($|.{0,20}(?s)(graffati|particella |particelle |p\.|.*part\.|p |part |mappale |mapp\.|mapp |n\.|subalterno |subalterni |sub\.|s\.|sub |s |\bcat\b|\bcategoria\b|\brendita\b|\bvani\b|\bconsistenza\b|\br\.c\.\b))#i', $txt, $matches, preg_offset_capture, $offset) with $offset = 944 , i'm getting following output in $matches . i expected match 1184 matches 4 instead. tried (?su) no luck. $matches = array(6) { [0]=> array(2) { [0]=> string(59) "* 1184 sub.702, vioolo san vincenzo n.4, piano t, categoria" [1]=> int(1226) } [1]=> array(2) { [0]=> string(36) "* 1184 sub.702, vioolo san vincenzo " [1]=> int(1226) } [2]=> array(2) { [0]=> string(2) "n." [1]=>

java - Jframe form in netbean -

a>>> package ja7; import javax.swing.jframe; /** * * @author lalit kumar */ public class gframe extends javax.swing.jframe { /** * creates new form gframe */ public gframe() { initcomponents(); } /** * method called within constructor initialize form. * warning: not modify code. content of method * regenerated form editor. */ @suppresswarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="generated code"> private void initcomponents() { jbutton1 = new javax.swing.jbutton(); jbutton2 = new javax.swing.jbutton(); jtextfield1 = new javax.swing.jtextfield(); jtextfield2 = new javax.swing.jtextfield(); setdefaultcloseoperation(javax.swing.windowconstants.exit_on_close); settitle("try magic"); setresizable(false); jbutton1.settext("cal");

java - Getting null pointer when calling web serive developed in the .net using web service client -

i consuming web service developed in .net. platform ibm rad,websphere 7 , jax rpc. i write codeto call service, getting below null pointer exception. client code: // string // endpoint="https://pilot.id3global.com/id3gws/id3global.svc/soap11_noauth"; // string endpoint="basichttpbinding_globalauthenticatestub"; // globalauthentication globalauth =new globalauthentication(); long l = new long("0"); // globalauth.setprofileid("4a6eaf41-f9a9-44f0-9700-81aa43004dab"); // globalauth.setprofileversion(l); globalprofileidversion profileidversion = new globalprofileidversion(); profileidversion.setid("4a6eaf41-f9a9-44f0-9700-81aa43004dab"); profileidversion.setversion(l); globalinputdata iinputdata = new globalinputdata(); globalpersonal personal = new globalpersonal(); globalpersonaldetails personaldetails = new globalpersonaldetails(); personaldet

magento search not showing single product on manufactuer list page -

magneto search not showing single product on manufacturer list page, redirecting product on product page. i don't want redirect it, notable find ta redirect code. using search landing page show listing of brand vise product thanks in advance

swift - Remove visual appearance of "Adjust image when focused" in tvOS -

i have uicollectionviewcell fullsize image (constrains: 0,0,0,0). i added optional image (a 'watched image') above full screen image. works. due fact there 'zoom effect' if cell focused, have enable adjust image when focused attribute. both images resizes wished. the problem is, feature adds grey shadow layer 'watched' label not good. thats why need feature of resizing without visual appearance of it. is possible? in storyboard, try move 'watched image' in same level collection view comes after collection view in view hierarchy. should place optional view on top of collection view cell , avoid shadow falling on top of it.

xslt - How to make changes in xsl to get distinct values in xsl -

am getting duplicates in list, wanted make distinct . workflow type ( <xsl:for-each select="//bonaire/rbs/workflowtypelist"> <xsl:if test="@bsslookuptypeid=//bonaire/request/@type_bsslookuptypeid"> <xsl:value-of select="@typename"/> </xsl:if> </xsl:for-each> ) that can done in one-liner using distinct-values() , predicate expression ( [...] ) : <xsl:for-each select="distinct-values(//bonaire/rbs/workflowtypelist[@bsslookuptypeid=//bonaire/request/@type_bsslookuptypeid]/@typename)"> <xsl:value-of select="."/> </xsl:for-each>

c++ - MSI built in VS2015/Win10 4mb smaller than VS2010/Win 7 -

as title says, msi built in vs 2015 whole 4mb smaller msi built in vs 2010 . in addition file size difference, win10 installer seems able installed on win 8+, giving missing dll error on win7. i've tried searching number of phrases, can't find relates question. can shed light on this? ideas appreciated. can provide more information, i'm not sure you'd need, let me know if need more info. a few comments of explanation: msi files not built scratch - based on schema msi file that's used starting point. if 2 vs editions use different schemas you'll see different msi files, if support old stuff deleted. msi files sparse files, not continuous data streams. if mechanism updating database (which msi files are) different file structure may different, less unused space in it. msi files contain data other files. there binary files containing bitmaps, calls detect net framework, c++ dlls call managed custom actions, kinds of things may different between 2

actionscript 3 - Using action script 3 with flash builder 4.7 when i try to load image of dimension 16000 X 16000, not able to upload -

i found below problem in action script 3. using action script 3 flash builder 4.7 when try load image of dimension 16000 x 16000 using below code crash app , not able show image. image size 4.6 mb , image dimension 16000 x 16000 (width x height) when try other image having dimension 10000 x 3000 (width x height) work var maploader:loader=new loader(); var loaderinfo:loaderinfo=maploader.contentloaderinfo; loaderinfo.addeventlistener(event.complete, function(event:event):void { var image:image=new image(); image.source=maploader.content; image.width=image.source.width * 0.6; image.height=image.source.height * 0.6; image.smooth=true; } }); loaderinfo.addeventlistener(ioerrorevent.io_error,function(e:ioerrorevent):void { //some code }); maploader.load(new urlrequest(mapsrc)); please me ,

C read and thread safety (linux) -

what happen if call read (or write , or both) in 2 different thread, on same file descriptor (lets says interested local file, , it's socket file descriptor), without using explicitly synchronization mechanism? read , write syscall, so, on single core cpu, it's unlucky 2 read executed "at same time". multiple cores... what linux kernel do? and let's bit more general : behavior same other kernels (like bsds) ? edit : according close documentation , should sure file descriptor isn't used syscall in other thread. seams explicit synchronization required before closing file descriptor (and so, around read/write if thread may call still running). any system level (syscall) file descriptor access thread safe in mainstream unix-like oses. though depending on age not signal safe. if call read , write , accept or similar on file descriptor 2 different tasks kernel's internal locking mechanism resolve contention. for reads each byte may rea

ios - How to release testflight beta version to external users? -

Image
having submitted beta version of ios app trough itunes connect , testflight internal users, , selected testing external users, displays "waiting beta app verification" (from internal users) , don't know how release app external user. (see pict enclosed). did worked on past version don't know how ... times, upload internal users, approval them (but don't know how). need re-test submit app quickly, welcome ! note : apple displays on old itune connect versions, , don't see can done. see here apple says : upload build app. see uploading build app. add app description , test build. step optional releasing builds internal testers, required when submitting app beta app review external testing. see add metadata prerelease app. distribute app internal testers. submit app beta app review, , distribute external users. you need have every build reviewed apple distribution external testers.

java - Sending javamail using Office365 mail template -

i want send mail java application using javamail through office 365, able do. now requirement need send mail using template created in office 365 account. moreover need add customized data on mail template(like mail merge), not able do. can send mail through javamail using created mail template? if please me how it? thanks.

how to load js with jquery load method -

i've tried use jquery load method load javascript: <div id="update"></div> <script type="text/javascript"> $('#update').load('find.html .themes', function(data) { $(this).find('.themes').css({"width":"100%", "margin":"auto"}); }); </script> my file find.html: <div class="themes"> <script> document.write('this test'); </script> </div> please can show me how load javascript? if don't have things in find.html div can access elements directly: <script type="text/javascript"> $('#update').load('find.html', function(data) { $(this).find('.themes').css({ "width": "100%", "margin": "auto" }); }); </script>

sql - exclude some data from a table SSRS -

Image
i want exclude weekend , holiday table: for example in picture exclude date 19.01. , 10.01 table or should show 0 in 10.01.2016. this code: select * ( select intervaldate datum, tsystem.name name, sum(case when name = 'maschine 1' units else 0 end) maschine1, sum(case when name = 'maschine 2' units else 0 end) maschine2, sum(case when name = 'maschine 3' units else 0 end) maschine3, count inner join tsystem on count.systemid = tsystem.id intervaldate between @startdatetime , @enddatetime , tsystem.name in ('m101','m102','m103','m104','m105','m107','m109','m110', 'm111', 'm113', 'm114', 'm115') group intervaldate, tsystem.name ) s i think best approach create table in database , store weekend , holidays dates use table filter query. something this: select * ( select intervaldate datum, tsystem.name name, sum

javascript - Detect whether a page is entered through history.back -

when return previous page through history.back(), page not newly loaded. instead, displayed left. efficient , avoids dribbling in of images. however, want run function when page entered via history.back() synchronise page calling history.back(). there event firing in called page when entered in way [i.e. history.back()]? note: have hack using setinterval polls re-entry, think ugly. tried popstate did not fire. you can use https://github.com/browserstate/history.js/ especially history.adapter.bind(window,'statechange',function() it fires on every state change ('back' well).

javascript - How to enhance a server side generated page with Aurelia.io? -

i'm writing app parts spa , pages generated on server side seo. i've chosen aurelia.io framework , use enhance method enable custom elements on pages. can't find best way use aurelia specific template directives , interpolation on server side page. let's start exemple. all of pages contains dynamic header. header custom element named my-cool-header . header load authentified user , display name, or, if no user authentified, link signin displayed. body of page generated on server side , cached. so, we'll have : <html> <body> <my-cool-header> <img src="logo.png"> <div show.bind="user">${user.name}</div> <div show.bind="!user"><a href="/signin">sign-in</a></div> </my-cool-header> <div>cachabled content</div> </body> </html> then, header defined : import {userservice} &#

javascript - Change HTML page's url & its content -

i trying change content of html page when action on widget taken. code: function widget(newurl) { var server_url = "127.0.0.1:8000"; var oldhtml = document.documentelement.innerhtml; $.post(server_url + "/convert/", { input_html: oldhtml, convert: newurl }, function(response) { var resp = json.stringify(response); resp = resp.substring(1, resp.length - 1); var jobj = json.parse(resp); var win = window.open(newurl,'_self'); document.write(jobj.data); }); } with code, though html content gets changed html page's url doesnot change. can please suggest how can change webpage url content both ? updated code: function widget(newurl) { var server_url = "127.0.0.1:8000"; var oldhtml = document.documentelement.innerhtml; $.post(server_url + "/convert/", { input_html: oldhtml, convert: newurl }, function(response) { var resp = js

jquery - Filter an array with two comparisions -

i filtering array using .filter , example: stack_wr = stack_wr.filter(function(obj2) { return obj2.class != sec__id; }); the above code works require. question can filter using 2 comparisons or return statements? 1 obj2.class != sec__id have done , again obj2.type != whatever_value or have filter 2 times way have done below: stack_wr = stack_wr.filter(function(obj2) { return obj2.class != sec__id; }); stack_wr = stack_wr.filter(function(obj2) { return obj2.type != whatever_value; }); did try stack_wr.filter(function(){ return this.classname !== 'email' && this.type !== 'password'; }); simple demo

haskell - parse error in nested if/do blocks -

defaultfilename :: [char] defaultfilename = "test.log" defaultsearchname :: string defaultsearchname = "xyz" this code can compiled: a3 :: int -> [[char]] -> io [char] a3 index arg = if null arg <- putstrln "no parameters have been passed." <- putstrln $ "1 default search string: " ++ defaultsearchname <- putstrln ("2 default file name: " ++ defaultfilename) return defaultfilename else return (arg!!index) once add if-then-else, cannot compile anymore a3 :: int -> [[char]] -> io [char] a3 index arg = if null arg <- putstrln "no parameters have been passed." <- putstrln $ "1 default search string: " ++ defaultsearchname <- putstrln ("2 default file name: " ++ defaultfilename) if index == 0 return defaultsearchname else return defaultfilename else return (arg!!index) why???? frust

javascript - callback issue in angularjs directive -

i facing call problem when calling service function here function defined in registrationservice function hasuseraccesstolevel(incentivelevel, callback, showregistrationview) { var url = "..."; httpwrapperservice.get(url) .then( function success(data) { var hasaccess = incentivelevel <= data.level; callback(hasaccess); if (showregistrationview && hasaccess == false) { showregistrationviewforlevel(incentivelevel); } }, function error(errorobject) { alert("user has not access\r\ntodo : show popup registration/login"); } ); return false; } and in directive using function function checkauthentication() { registrationservice.hasuseraccesstolevel(2, function (hasaccess) {

javascript - Count number of keys in object with Coffeescript -

i know how many keys in coffeescript object. i can in js: object.keys(obj).length is there way in coffeescript? object.keys(obj).length it should work same way in coffeescript see example

java - In an multi-tenant enviroment how can I provide different metadata for different Service Providers at runtime on different urls (subdomains)? -

working on sp initiated single sign on (sso) both sp , idp self-hosted have flexibility of editing both. using spring-security-saml2-core-1.0.1.release hosting spring application (spring-security-3.2.8, spring-mvc-3.2.14.release), serves multiple tenants @ urls say: sp1.example.org , sp2.example.org idp hosted using shibboleth idpv3.2.1 working fine multiple applications hosted on different sp servers. i trying send different metadata same server sp1 & sp2. read multi-tenant sp here , here custom logic overriding samlcontextproviderimpl populatepeerentityid , trying override populatelocalentityid because can't use alias . can give example code overriding populatelocalentityid handling multi-tenants metadata ? sp configuration shown below: <!-- filters processing of saml messages --> <beans:bean id="samlfilter" class="org.springframework.security.web.filterchainproxy"> <filter-chain-map request-matcher="ant"

java - hibernate createAlias with clause generates wrong query -

i have following tables: a: id b: id, text ab: aid, bid i want joib , b b.text contains word 'cat'. this hibernate query do: criteria c = session.createcriteria(tablea.class, "a"); c.createalias("a.bs", "b", jointype.inner_join, restrictions.like("b.text", "%cat%")); c.setprojection(projections.property("id")); the generated query is: select id a inner join ab ab on a.id=ab.aid , (b.text ?) inner join b b on b.id=ab.bid , (b.text ?) for reason and (b.text ?) appears in both inner joins. far understand supposed in second on. causes following exception: java.sql.sqlexception: no value specified parameter 2 i guess it's happening because has 1 parameters , 2 '?'. what missing? edit: adding persistent classes: @entity @table(name="a") class { @id @column(name="id", length=255) protected string id; @onetomany @jointable(name="ab",

spark reading data from mysql in parallel -

im trying read data mysql , write parquet file in s3 specific partitions follows: df=sqlcontext.read.format('jdbc')\ .options(driver='com.mysql.jdbc.driver',url="""jdbc:mysql://<host>:3306/<>db?user=<usr>&password=<pass>""", dbtable='tbl', numpartitions=4 )\ .load() df2=df.withcolumn('updated_date',to_date(df.updated_at)) df2.write.parquet(path='s3n://parquet_location',mode='append',partitionby=['updated_date']) my problem open 1 connection mysql (instead of 4) , doesn't write parquert until fetches data mysql, because table in mysql huge (100m rows) process failed on outofmemory. is there way configure spark open more 1 connection mysql , write partial data parquet? you should set these properties: partitioncolumn, lowerbound, upperbound, numpartitions as documented here: http://spark.apache.org/docs/latest/sql-progra

c# - Initialize list with default values -

i want have class, stores "allowed languages" in list. code party should able modify list. on first usage, list should "initialized" default values. i have following class: public class apilanguages { public static list<string> allowedlanguages { get; set; } public apilanguages() { allowedlanguages.add("de"); //allowedlanguages.add("en"); //allowedlanguages.add("es"); //allowedlanguages.add("fr"); //allowedlanguages.add("it"); } } when access class in code with foreach (var language in apilanguages.allowedlanguages) { // here... } the apilanguages.allowedlanguages null. expect 1 entry ("de"). doing wrong here? public apilanguages() instance constructor. runs (and every time) when create new instance of apilanguages (via new apilanguages() ). it's purpose initialize instance variables, not static ones. shouldn&

standards - PHP end tag in php functions and logic file -

example code in question: <?php function foo($x) { ?> // <-- php end tag in question <ul> <li>coffee</li> <li>tea</li> <li>milk</li> </ul> <?php return ; } ?> i trying decide if acceptable coding standard / coding practice in php logic file, , downsides of method in comparison other html print/concaternation schemes. there documentation on php strings find useful. explains difference between single quotes, double quotes, heredoc, , nowdoc syntaxes. don't want invite opinion in issue, don't think method have demonstrated commonly used.

linux - Traceroute: target doesn't acknowlege packet just from a specific host. Traceroutes from other hosts work fine. Ping works fine from all hosts -

so bit puzzled this. of in larger corporate network, machines on site. we have 1 machine (linux) sending soap requests other machine (windows) , since few days these requests fail after time. haven't found pattern requests fail (doesn't seem particular request). we tried traceroute requesting machine target machine , target machine doesn't acknowlege packet (asterisks @ target). running ping did work , did not drop packets. the target machine vm on host hosting many machines. the problem started after scheduled restart few days ago. our team responsible application on target server, invested in helping pinpoint problem. apart running wireshark on target server , looking traceroute or soap packets, there other point of failure can investigate? if using domain names (not ip), check resolved properly. isp dropping packets not issue since on site. ping works, assume both machines see each other on network. should sending machine (linux) send ping sure

html - Clone labels, input boxes together in jquery -

i've got following html inside tag "#valgmulighed1" want clone in jquery when user presses button. want jquery append class, user can delete individual rows added. guess sort of loop neccesary in order give each of cloned content "unique" class, script doesnt delete of rows. my html here: <input type="button" id="btnid" value="+" /> <div id="valgmulighed1"> <label> <input type="checkbox" name="check2" id="sv1" /> <span class="label-text">rigtigt</span> </label> <input id="text3" type="text" class="spmtekst2" placeholder="tekst valgmulighed" onfocus="this.placeholder=''" onblur="this.placeholder='tekst valgmulighed'" /> <div class="slet"> <span>slet</span> </div> </div>