Posts

Showing posts from September, 2013

docker - Join SwarmKit cluster with predefined token? -

is there ways join docker swarmkit cluster predefined token? default, swarmkit nodes must provide token defined swarmkit master. not play nice scripting (like ansible). how generate token up-front? as far know there way these tokes up-front. can them comand docker swarm join-token -q worker or manager. comand prints token wich written in file or stored elswhere.

javascript - Meteor - Passing an object to template but it doesnt display data -

im trying create blog(with meteor) have different categories posts, trying create page displays categories , titles off posts in categories. this javascript code using. template.categories.cats = function(){ reviews = reviews.find({}, {sort: { createdat: -1 } }); opinions = pointlessopinions.find({}, {sort: { createdat: -1 } }); days = daysinthelife.find({}, {sort: { createdat: -1 } }); return {reviews: reviews,opinions: opinions, days: days}; } this html template <template name = "categories"> <div class = "container"> <h1>reviews</h1> {{#each reviews}} <h2> {{title}}</h2> {{/each}} </div> <div class = "container"> <h1>a day in life</h1> {{#each days}} <a href="/post/{{this._id}}"> <h2> {{title}}</h2> </a> {{/each}} </div> <div class = "container...

profiling - What is the default unit of time of c++'s chrono? -

i used code measure runtime of program this answer auto start = std::chrono::system_clock::now(); /* work */ auto end = std::chrono::system_clock::now(); auto elapsed = end - start; std::cout << elapsed.count() << '\n'; i needed measure runtime trend kind of curious unit is. you can check self, code: using clock = std::chrono::system_clock; using duration = clock::duration; std::cout << duration::period::num << " , " << duration::period::den << '\n'; on system prints: 1 , 1000000000 that is, period in terms of nanoseconds (i.e. 10 −9 s).

tensorflow - DNNClassifier predict sample -

based on tensorflow tutorial , see it's easy use dnnclassifier make basic class prediction given sample data. there way sample data given class? specifically given example, can give class 2 , 4 points of data it'd associate flower of class. the classifier exports keys other accuracy. using "scores" give score each example in each class, can loop on find max.

mono - MonoPosixHelper-x86_64.dll - ClamAV detects this as a threat/infection -

can mono project team confirm file monoposixhelper-x86_64.dll not malicious? clamav detects threat. found under /mono_2.0/bin folder under /.wine on linux. file exists when wine reinstalled. by way, it's clamav detects this, according virustotal.com

(When) are HandleScopes (still) necessary in native node.js addons? -

in node.js v6.4.0 documentation on addons , functions adhere following pattern. void x(const functioncallbackinfo<value>& args) { isolate* isolate = args.getisolate(); ... } so there no instantiation of handlescope , there used in prior versions of node.js. there's 1 exception, handlescope scope(isolate) done. most of functions instantiate local<...> handles, i'd expect handlescope necessary garbage collection done on function return. so: when handlescopes necessary in node.js 6.4.0 native addons? in general not need handlescope if calling function javascript. because there (parent) scope inherited javascript call site. javascript scope gets garbage collected, handles created in c++ collected because they're attached scope. so adding handlescope every function won't hurt anything, it's may impact performance some.

javascript form submit is not working in https -

javascript submit not working in https. javascript code function apply() { document.fileinfo.action='<%=uploadjsp%>'; // uploadjsp = https://localhost/upload.jsp document.fileinfo.submit(); } html code <form name="fileinfo" action="upload.jsp" enctype="multipart/form-data" method="post"> ... </form> result of newtwork capture on ie developer tool, ... domcontentloaded (event)‎‎ + 184ms - load (event)‎‎ + 197ms - on load(event) break this code working on http (uploadjsp = http://loaclhost/upload.jsp ) i don't know wrong. please advice me solve problem firstly, have tried printing value of document.fileinfo.action in first snippet after has been assigned = "<%=uploadjsp%>" ? <%= {code} %> processed when server sends html documents, if script in separate file html, or server doesn't process code in between <script> tags, document.fi...

regex - Replace one character with another using PHP function -

i need use custom php function process data, austin metro>central austin|austin metro>georgetown|austin metro>lake travis | westlake|austin metro>leander | cedar park|austin metro>round rock | pflugerville | hutto|austin metro>southwest austin and convert reads this: austin metro>central austin#austin metro>georgetown#austin metro>lake travis | westlake#austin metro>leander | cedar park#austin metro>round rock | pflugerville | hutto#austin metro>southwest austin currently using following replacing character "|" between "leander | cedar park". there way replace ones no space before or after? preg_replace("/|/", "#", {categories[1]} ); any suggestions? thanks! what you're looking called ahead/behind assertion in pcre . want negative behind , negative ahead space surrounding pipe. should note character | has special meaning in pcre need escape literal. preg_replace('/(?<! )...

How do I make azure resource manager templates extensions run in specific order? -

i using 2 azure resource manager template extensions in template. 1 dependent on other finishing first. tried setting dependencies however, not appear work between extensions. extensions appear run asynchronously. though placed extension want run first, first in azurerm template. the position in template won't guarantee execution sequence. if want extension execute after resource available have use dependson , reference resource waiting for. in example virtual network can extension. "dependson": [ "[concat('microsoft.network/virtualnetworks/', variables('virtualnetworkname'))]" ], azure documentation

python - Issue with Sublime Text 3's build system - can't get input from running program -

this question has answer here: sublime text 2 console input 2 answers i'm trying sublime text 3 (build 3049, if matters) run python script. simple 2 liner var = raw_input("enter something: ") print "you entered ", var which asks input, waits it, prints out in windows console prompt. this is, seeing number of similar questions on side, problem quite number of users, went through , tried ... stuff. made copy of exec.py file, commented 1 line, made new pythonw build file, tried messing build file ... nothing seems work. in lack of definite solution, how work python using sublime text 3? first off, since you're using dev build, must registered user (good!) , i'd recommend upgrading 3053, latest version, newer better in terms of known issues being fixed. second, fyi, there's complete set of (unofficial) docs @ docs.sub...

javascript - API Forismatic JSON: Random Quote Machine -

i'm building quote machine using forismatic api , utterly stumped. program working fine until decided revisit work in future. here's code: var html = "http://api.forismatic.com/api/1.0/?method=getquote&lang=en&format=jsonp&jsonp=?"; var getquote=function(data){ if(data.quoteauthor === "") { data.quoteauthor = "unknown"; } $('#author').text(data.quoteauthor); $('#text').text(data.quotetext); var quote = 'https://twitter.com/intent/tweet?text=' + "\"" + data.quotetext + "\"" + ' author: ' + data.quoteauthor +' @gil_skates'; $('#tweet').attr("href", quote); }; $(document).ready(function() { $.getjson(html, getquote, 'jsonp'); }); // on button click $('#new-quote').on("click", function(){ // deletes text , creates spinner $('#text').text("");...

javascript - Add data attribute to all images under a class -

Image
i'm using lightbox requires specific tag inside link. don't want edit every post i'm trying automatically using jquery. html <div class="wrapper"> <a href="imagelink.png">image</a> </div> js $(document).ready(function() { // scan classes $('.wrapper a').each(function(){ // apply tag $(this).parent().attr('data-lity'); }); }); result should be <div class="wrapper"> <a href="imagelink.png" data-lity>image</a> </div> jsfiddle http://jsfiddle.net/c2rvg/31/ this trick jquery $(document).ready(function() { // scan webpage class names of 'thumb' seen. $('.wrapper a').attr('data-lity', ''); }); demo

python - How to change which class variable is being called depending on user input? -

i've created class called earthquake stores relevant earthquake data (its magnitude, time hit, etc.) in class variables. want ask user data they'd see, print out data them so: earthquake1 = earthquake() answer = input("what data see?") print(earthquake1.answer) in example above, if user answers magnitude , want print out class variable earthquake1.magnitude . is there way of doing this? just use getattr : earthquake1 = earthquake() answer = input("what data see?") print(getattr(earthquake1, answer))

ruby on rails - What is the difference between a token and a digest? -

i'm learning authenticating users in rails , concept of tokens , digests keep reappearing. think understand general idea of purposes in general, don't understand difference between two. token random string digest hashed string a cryptographic hash function procedure takes data , return fixed bit string: hash value, known digest. hash functions called one-way functions, easy compute digest message, infeasible generate message digest. read more digest here: http://apidock.com/ruby/digest

javascript - Continuous ajax calls makes application crash -

Image
i have html application contains 4 ajax calls runs continously every 2 seconds back. objective read new , fresh data fron db continuously , seamlessly. function messagesreceived(){ var querystring = "xxxxxxxxx"; $.ajax({ url:querystring, 'content-type':'application/json', method:'get', datatype:'json', cache: false, success:function(data){ displaymessages(data); rendermessagesreceived(); }, complete: function(xhr,status){ settimeout(messagesreceived,2000); }, error: function(xhr,status){ if(xhr.status == 0){ footertext.settext("network disconnected"); }else{ footertext.settext("something went wrong! please reload page!"); } } }); } function loadreadings() { var querystring = "xxxxxxx"; $.ajax({ url: querystring, 'content-type': 'application/json', method: 'get', datatype: 'json', cache: false, succ...

Firebase 3.0 Query of multiple fields / Query.contains() alternative for Firebase 3.0 -

i'm wondering how query particular type of data. sample set of data basically want query name contains particular string in both firstname , lastname. example if search string "ani" both names danilo marino , ian danico marino should show up. i thinking adding of synthetic index combining firstname , lastname .contains() old query api doesnt seem included in new api. client side filtering might out of question since might have multiple names numbering tens of thousands.

jaspersoft studio eclipse plugin download error -

Image
when i'm trying install jaspersoft studio eclipse using this video tutorial , error came up. eclipse version - eclipse kepler (4.3.2) os - ubuntu 15.10

Can pyephem look more than 360 degrees past a date -

i want code output date of every 30 degrees of planets movement until date of today, reason stops @ 360 degrees. why code stopping here , not going through 390 degrees, 420, 450......etc. from ephem import venus, date, degrees, newton import datetime v = venus() start_date = '2014/2/2 00:00' v.compute(start_date) ls0 = v.hlon print "venus",start_date, ls0 print "" arc = 0 while true: d = start_date today = datetime.date.today() arc = arc + degrees('30:00:00') if d == today: break def ls(date): v.compute(date) return degrees(v.hlon - ls0).norm def thirty_degrees(date): return ls(date) - degrees(arc) def find_thirty_degrees(start_date): start_date = date(start_date) y0 = ls(start_date) y1 = ls(start_date + 1) rate = y1 - y0 angle_to_go = degrees(degrees(arc) - y0).norm closer_date = start_date + angle_to_go / rate d = newton(thirty_degrees, closer_date, closer_date + 1) return...

javascript - spacebar not cancelling default event on firefox -

i'm building video player , 1 of features related toggle play when hit spacebar , execute process within. works on browsers except firefox. if hit spacebar , video paused, plays less second , gets paused. there i'm not aware of causing behavior related firefox? player.addeventlistener('keydown', function(e) { if (e.keycode === 32) { if (player.paused) { player.play(); } else { player.pause(); } // ... other actions event e.preventdefault(); e.stoppropagation(); } }, false); firefox triggers click event when using space bar. using conditional avoid firefox when pressing space bar fixes it

unity3d - Kudan for Unity v1.2.2: Creating Custom Markers -

i'm trying started kudan in unity using kudan package v.1.2.2 on mac os. have spent quite long time trying test detecting own marker fail. here steps did: downloaded both unity package , kudan artool kit. created new unity project , deleted default components. imported kudan package. draged , dropped "kudan camera" , added editor api key. in kudan artool kit, created new project , imported simple marker (.png file): simple marker recorded marker dimensions, 300x300. i exported marker .karmarker file. in unity, clicked on "add karmarker asset" , selected .karmarker. then, dragged created .asset file markertracking component. finally, run player mode. runs without problem, never detects marker. appreciate if can me on missed, or wrong steps did. ** please note application runs without custom marker. your steps sound correct, issue think causing issue marker have chosen. has sharp contrasts great rather lacks interesting feature points...

sql server - Storing output of a stored procedure into a variable when the stored procedure is called with in another stored procedure -

i executing stored procedure within stored procedure , want store result of inner stored procedure variable use later. result of inner stored procedure varchar value. how can set variable result of stored procedure ? alter procedure [dbo].[mvc_formulas] @fund_id nvarchar(max), @start_dated datetime, @end_dated datetime declare @formulatype int declare @xfund_id bigint declare @returningtable table(fundname varchar(100), zreturn nvarchar(100)) declare @zreturn nvarchar(100) declare @zsd nvarchar(100) declare @funds table(fundid bigint) insert @funds select item dbo.splitstring(@fund_id, ',') declare @mycursor cursor; declare @curfund bigint; declare @fundname nvarchar(100); begin set @mycursor = cursor select fundid @funds open @mycursor fetch next @mycursor @curfund while @@fetch_status = 0 begin set @fundname = (select fundname fun...

Dapper Extension Ms Access System.Data.OleDb.OleDbException -

i started use dapper. dapper works fine. next step when tried integrate dapper extension. generates exception called system.data.oledb.oledbexception "additional information: characters found after end of sql statement." why that? dapper extension doesn't support ms access (because of end character) or problem code or missing something. code below using (var conn = new oledbconnection(@"provider=microsoft.ace.oledb.12.0;data source=myaccessfile.accdb;")) { conn.open(); conn.insert<person>(new person { name = "john stan", age = 20 }); } according msdn article , some database engines, such microsoft access jet database engine, not support output parameters , cannot process multiple statements in single batch. so problem insert method generating statement such as insert [person] ([person].[personname]) values (@personname); select cast(scope_identity() bigint) [id] and access can't deal it. reading around, ...

javascript - How to map a Array and create a Object from it? -

below code.... var temp = {}; [{group_id : "1111"}, {group_id: "2222"}].map(function(ele, index) { var group_id = ele.group_id; temp.group_id = {value: 0} }); after run code, temp object is {group_id : {value : 0} but want { {"1111" : {value : 0}}, {"2222" : {value : 0}} } how can that? instead of using temp.group_id use temp[group_id] .

java - Hide classes of library - Android -

i have 3 projects used libraries within 4th (main project). the 3 projects complied within each other follows (build.gradle): library project: project a compile project(":projecta") compile project(":projectb") project b compile project(':projectc') main project: compile(name: 'projecta', ext: 'aar') compile(name: 'projectb', ext: 'aar') compile(name: 'projectc', ext: 'aar') i "library project", within main project, if click on class within library project, should either not able see code, or should encrypted. so example if there interfacea in projecta, , main activity of main project implements interface, if "ctrl-click" interface, result should similar specified above. i understand proguard similar, if building release .apk, need same result compiled libraries. many projects use proguard achieve protection. you can use gradle build library co...

.net - C# float max parse error -

i declared byte array contains 4 bytes. byte[] bts = new byte[] { 0xff, 0xff, 0x7f, 0x7f };  float f1 = bitconverter.tosingle(bts, 0);  string s = f1.tostring();  float f2 = float.parse(s);  byte[] bts2 = bitconverter.getbytes(f2); after conversion, realized output changes { 0xff, 0xff, 0x7f, 0x7f } to { 0xfd, 0xff, 0x7f, 0x7f } why did happen? if @ f1 , f1.tostring() in watch window see that f1 = 3.40282347e+38 f1.tostring() = 3.402823e+38 which means tostring method outputs string representing trimmed number , not accurate 4 byte float , but why? the default float.tostring uses the g specifier in standard numeric format strings has 7 digit accuracy floats . you can use other overload of tostring specify format specifier , provide amount of digits want represent: string s = f1.tostring("g10"); a better way use "r" specifier lossless string s = f1.tostring("r"); msdn: round-trip ("r...

c# - Using Linq to group objects that contain a list field -

i have class, let's name myclass, public field of type ilist<anothertype> : class myclass { public ilist<anothertype> mylistproperty {get;} } i have list of myclass objects in app: list = new list<myclass>(); i want group "list", iorderedenumerable<igrouping<myclass,anothertype>> using linq, used source collectionviewsource , shown user grouped listview. how can this? in other words, want merge "list" grouped enumerable keys being myclass instances , values being myclass.mylistproperty . if undestand correctly, you're looking this: list.selectmany(x => x.mylistproperty.groupby(y => x)); this returns ienumerable<igrouping<myclass, anothertype>> . make iorderedenumerable , need add .orderby(x => x.someorderingproperty); @ end.

Pass mysql count to view codeigniter -

i looking count there data present only. if there record no 0 not want counted. function count()   {   $this->db->select('count(id)');   $this->db->from('projects');   $this->db->where(array('id !=' => ''));   $query = $this->db->get();   return $query->result_array();   } controller $data ['total'] = $this->mymodel->count ; view echo $total table structure proj_name | user id ----------------------------------- a. | 1 b. | 2 c. | 2 result should proj_name | total project id a | 1 b | 2

php - How to sit between seller and buyers as a payment gateway -

i need solution process creating website have payment processing. payments have 3 parties let me explain below. fund sender (buyer) primary receiver (site owner) fund receiver (seller) i want if sender (buyer) send 10 usd site owner receive , system show balance of 8 usd in balance of receiver (seller) once receiver (seller) balance greater or equal 50 usd receiver (seller) can release fund there verified payment system. now want real story need system in php, need answer following questions. which payment gateway need adopt ? i don't have paypal can without paypal? is there ready made code in github? many thanks there tons of payment solutions out there. please use google, of them have apis none free... (paypal kinda dont have) you acting bank in plans, next google recommend lawyer....

java - Efficiently read scribed text on credit cards with an ocr api -

since various ocr api's tesseract , blink ocr , abby fine reader dont scribed text reading.if there opensource ocr api or sdk (like jar ) can used read scribed card text in android or java , found card.io sdk android.is enough though. please explain code examples. if online ocr api acceptable, ocr.space ocr api , free.

c# - No method found in project.filename in Xamarin android -

i have button login on loginpage.xaml , btnloginclicked method in code behind in xamarin.forms project. code below- xaml : <stacklayout spacing="20" padding="20" verticaloptions="center"> <activityindicator x:name="activityindicator" color="white" isrunning="false" isvisible="false"/> <entry x:name="entryusername" textcolor="{x:static color:colorresources.entrytextcolor}" placeholder="firstname.lastname" placeholdercolor="gray" ispassword="false" backgroundcolor="{x:static color:colorresources.entrybackgroundcolor}" /> <entry x:name="entrypassword" textcolor="{x:static color:colorresources.entrytextcolor}" placeholder="password" placeholdercolor="gray" ispassword="true" backgroundcolor="{x:static color:colorresources.entrybackgroundcolor}...

Facebook and Twitter data scraping using perl -

i want create web dashboard can search user name facebook, & twitter , show details (public educations , likes ) on dashboard. how can done using perl? i cant use graph api shows users allow app (permission based.) please guide me . this question broad. have @ below cpan modules, write logic on top of it. if face problem show stuck minimal example. facebook::graph api::facebook check more at: https://metacpan.org/search?q=facebook&search_type=modules net::twitter api::twitter check more at: https://metacpan.org/search?q=twitter&search_type=modules i cant use graph api shows users allow app there's reason it, right?

apache - https://www redirect not working with page parameter -

i redirect requests http://example.com or www.example.com https://www.example.com described in question: how redirect http requests https so requests redirected https://www this works only, if don't need redirect url http://www.example.com/page123 when try redirected https://www.example.com/index.php?page=page123 so rewrite rules page parameter doesn't work anymore, when redirect https://www here how .htacces: options +followsymlinks rewriteengine on rewritecond %{request_filename} !-d rewritecond %{request_filename} !-f rewriterule ^([^/]+)/?$ index.php?page=$1 [l] rewriterule ^((?!index\.php)[^/]+)/([^/]+)/([0-9]{5}+)/([0-9]+)/([0-9]+)/?$ index.php?page=$1&keyword=$2&zip=$3&range=$4&offset=$5 [l,b] rewriterule ^((?!index\.php)[^/]+)/([^/]+)/([0-9]{5}+)/([0-9]+)/([0-9]+)/([a-za-z0-9]+)/?$ index.php?page=$1&keyword=$2&zip=$3&range=$4&offset=$5&action=$6 [l,b] rewriterule ^auftraege-finden/([0-9]+)/?$ auftraege-finden...

Azure AD - Populate Group Information in Claims -

i trying populate claims token user group information fetch graph api. useful port existing windows auth application azure. isinrole() functions work is. tried following post populate claims information graph api but unless update app manifest groupmembershipclaims, may not able populate groups information. trying avoid since not global admin on corporate tenant. there more sample codes can follow same?

export multiple highcharts with text area for thier highcharts to multiple PDF file -

i want multiple highcharts textarea multiple pdf file . how wil convert multiple highcharts textarea multiple pdf $(function() { highcharts.getsvg = function(chart, text) { var svgarr = [], top = 0, width = 0, txt; var svg = chart.getsvg(); svg = svg.replace('', ''); top += chart.chartheight; width = math.max(width, chart.chartwidth); svgarr.push(svg); txt = '<text x= "' + 0 + '" y = "' + (top + 20) + '" styles = "' + text.attributes.style.value + '">' + $(text).val() + '</text>'; top += 200; console.log(txt.indexof('\n')) svgarr.push(txt); return '<svg height="' + top + '" width="' + width + '" version="1.1" xmlns="http://www.w3.org/2000/svg">' + s...

amazon web services - How to add PRE deployment script to AWS Elastic Beanstalk Docker EC2 instance, custom AMI not working -

i'm liking fact i'm able use docker images pushed aws ecr elastic beanstalk. thing has given me headache lack of information on how add pre-deploy hooks elastic beanstalk ec2 instance? if i've understood correctly, .ebextensions scripts run post deploy not resolving problem here. i came solution added script needed run @ pre deploy phase eb ec2 instance manually. more directory: /opt/elasticbeanstalk/hooks/appdeploy/pre now script gets executed everytime deploy new application version instance want. if load balancer attached eb environment launches new eb instance, doesn't contain manually added script , therefore not able run application. i tried create ami running eb ec2 container containing custom pre deploy script reason docker unable start on new eb instance based on custom ami. eb-activity.log says: [2016-08-29t07:38:36.580z] info [3887] - [initialization/preinitstage0/preinithook/01setup-docker-options.sh] : activity execution failed, because:...

hadoop - Write Parquet format to HDFS using Java API with out using Avro and MR -

what simple way write parquet format hdfs (using java api) directly creating parquet schema of pojo, without using avro , mr ? the samples found outdated , uses deprecated methods uses 1 of avro, spark or mr. effectively, there not lot of sample available reading/writing apache parquet files without of external framework. the core parquet library parquet-column can find test files reading/writing directly : https://github.com/apache/parquet-mr/blob/master/parquet-column/src/test/java/org/apache/parquet/io/testcolumnio.java you need use same functionality hdfs file. can follow sow question : accessing files in hdfs using java updated : respond deprecated parts of api : avrowritesupport should replaced avroparquetwriter , check parquetwriter it's not deprecated , can used safely. regards, loïc

node.js and bluetooth barcode-scanner -

i struggling quite while solid, long-term connection bluetooth barcode scanner inateck using node.js. process running in background (linux, no input-focus) that's why configured scanner spp device. the connection working long scanner doesn't automatically switch off save power, after 5 minutes. my first approach use bluetooth-serial-port package. discovers scanner, reads barcodes when scanner switches off, don't know how re-connect. added interval timer check connection , try connect again if isopen() returns false (which works once). when press button on scanner switches on , can re-connect after view seconds isopen() returns false if connection established, , don't further readings. here code: var btserial = new (require('bluetooth-serial-port')).bluetoothserialport(); var btinterval = null; btserial.on('found', function (address, name) { btserial.findserialportchannel(address, function (channel) { if (address === '00:06:1...

asp.net mvc - How do I show content and insert data form in one view in mvc -

i have contact form show contact info , users can send feedback. know must use viewmodel , use viewmodel in view . got below error: the model item passed dictionary of type 'system.collections.generic.list`1[models.contactinfo]', dictionary requires model item of type 'finalkaminet.viewmodel.contactviewmodel'. models: public class contactus { [key] public int contactid { get; set; } public string fullname { get; set; } public string companyname { get; set; } public string email { get; set; } public string website { get; set; } public string contactmessage { get; set; } } public class contactinfo { [key] public int contactinfoid { get; set; } public string contacttype { get; set; } public string contactvalue { get; set; } } viewmodel: namespace finalkaminet.viewmodel { public class contactviewmodel { public contactus contactus { get; set; } public ienumerable<contactinfo...

Kafka - difference between Log end offset(LEO) vs High Watermark(HW) -

what difference between leo , hw in replica ( leader replica )? will contain same number? can understand hw last committed message offset . when leo updated , how? the high watermark indicated offset of messages replicated, while end-of-log offset might larger if there newly appended records leader partition not replicated yet. consumers can consumer messages high watermark. see blog post more details: http://www.confluent.io/blog/hands-free-kafka-replication-a-lesson-in-operational-simplicity/

google tag manager - GTM Ecommerce Tracking Issue -

i expecting me on below. below scenario we planning track revenue, products sold etc , have setup standard ecommerce tracking using gtm on test domain. if ecommerce tracking works fine on test domain then, have planned move live. trigger have setup enter image description here tag have setup enter image description here data layer code placed on confirmation page above gtm container after opening tag <script> window.datalayer = window.datalayer || [] datalayer.push({ 'transactionid': 'xyz', 'transactiontotal': 123, 'currencycode': 'sar', 'transactionproducts': [{ 'sku': 'abcd', 'name': 'iphone', 'category': 'mobile', 'price': 999, 'quantity': 1 }] }); </script> here problems are 1) whenever lands on confirmation page in real time goal conversion visitors showing 2 instead...

javascript - On Click.. Add Div text to another DIV with comma -

i want add city name inside filter_selected_det container. working: whatever <a> element clicked, removes previous city name , replace clicked city name. solution needed: example. 'perth' city name clicked.. have add 'filter_selected_det'. city name 'sydney' clicked, have add existing 'perth' 'perth, sydney'. wise 'perth, sydney, krabi, melbourne' if exceeds maximum 3 cities selected.. should not add. please let me know comments. html: <div class="filter_selected_det"> </div> <div class="city_container"> <a href="#">perth</a> <a href="#">sydney</a> <a href="#">krabi</a> <a href="#">melbourne</a> </div> js: $('.city_container a').on('click', function (e) { e.preventdefault(); $(this).addclass('selected'); var $selectcities = $(t...

php - Slim 3 - Slash as a part of route parameter -

i need compose urls parameters can contain slash /. example, classic /hello/{username} route. default, /hello/fabien match route not /hello/fabien/kris . ask how can in slim 3 framework. route placeholders : for “unlimited” optional parameters, can this: $app->get('/hello[/{params:.*}]', function ($request, $response, $args) { $params = explode('/', $request->getattribute('params')); // $params array of optional segments });

How to use checkboxes as radio buttons with listners in android -

i have 7 check boxes ,on checking 1 check box other should unchecked i need multiple check boxes in activity functionality works radio button listener get. use listview this adapter_radio_buttons.xml <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <checkbox android:id="@+id/radios" android:layout_width="wrap_content" android:text="@string/app_name" android:button="@drawable/custom_checkbox" android:padding="10dp" android:textcolor="#000000" android:layout_height="wrap_content" /> set adapter listview private int selectedposition = -1; private cl...

c - fatal error: asm/linkage.h: No such file or directory -

i need setp keepalived provide ip failover web cluster in nginx webserver. i follow link install keepalive : http://www.cyberciti.biz/faq/rhel-centos-fedora-keepalived-lvs-cluster-configuration/ while install $ make && make install system throw fatal error: asm/linkage.h : no such file or directory this error: [root@www keepalived-1.1.19]# make && make install make -c lib || exit 1; make[1]: entering directory `/opt/keepalived-1.1.19/lib' make[1]: nothing done `all'. make[1]: leaving directory `/opt/keepalived-1.1.19/lib' make -c keepalived make[1]: entering directory `/opt/keepalived-1.1.19/keepalived' make[2]: entering directory `/opt/keepalived-1.1.19/keepalived/core' make[2]: nothing done `all'. make[2]: leaving directory `/opt/keepalived-1.1.19/keepalived/core' make[2]: entering directory `/opt/keepalived-1.1.19/keepalived/vrrp' gcc -g -o2 -i/lib/modules/3.10.0-22...

php - How can I show data which is greater than or equal to mysql table column month? -

Image
i have 2 columns (there more) in clients table. conn_date bill_date ======================= 2016-08-25 2016-09-04 2016-08-01 2016-09-03 2016-08-08 2016-09-01 2016-08-09 2016-09-01 now want show data if selected month = (equal) or > greater conn_date . can selected month html select tag e. g. : 1, 2, 9. for purpose, using following query it's showing data less conn_date "select cbp.advance_amount, cbp.bill_month, cbp.due_amount, cbp.pay_amount, c.is_active, c.client_id, c.user_id, c.address, c.contact_no, zone.zone_name, package.package_name, c.monthly_bill, c.bill_date clients c left join zone on zone.zone_id = c.zone_id left join package on package.package_id = c.package_id left join clients_pay_bill cbp on cbp.client_id = c.client_id c.uid = '$uid' , c.is_active = 1 , month(c.conn_date) > $selected_month using print_r select cbp.advance_amount, cbp.bill_month, cbp.due_amount, cbp.pay_amount, c.is_active, c.client_id, c.use...

javascript - How to add another variable to a script -

i've having trouble trying following script work correctly. i'm trying add variable script, i've kind of hacked lack of programming knowledge! doesn't seem work when add variable called extradate. works without must getting wrong somewhere. could please point out problem is? thanks help. output: using span id="extradate", id="fromdate" , id="todate" script: //cdnjs.cloudflare.com/ajax/libs/datejs/1.0/date.min.js full code var fromdate = date.today().adddays(1); if (fromdate.is().saturday() || fromdate.is().sunday()) { fromdate = fromdate.next().monday(); } var todate = date.today().adddays(2); if (todate.is().saturday()) { todate = todate.next().monday(); } else if (todate.is().monday()) { todate = todate.next().tuesday(); } else if (todate.is().sunday()) { todate = todate.next().tuesday(); } var extr...

java - How is it possible that when I pass a lambda expression as a parameter it can access other variables in this scope? -

public class arraysdemo { public static void main(string[] args) { int[] = {0, 2, 4, 6, 8}; int[] b = {10, 12, 14, 16, 18}; arrays.setall(a, -> b[i]+1); system.out.println(arrays.tostring(a)); } } outputs: [11, 13, 15, 17, 19] the source of setall() function used follows: public static void setall(int[] array, intunaryoperator generator) { objects.requirenonnull(generator); (int = 0; < array.length; i++) array[i] = generator.applyasint(i); } intunaryoperator functional interface , part of source: public interface intunaryoperator { int applyasint(int operand); // rest methods omitted } correct me if i'm wrong understanding of lambda expressions in java when pass lambda expression parameter setall() method, object of anonymous class implements intunaryoperator interface created , called generator . , lambda expression implementation of applyasint() method believe transl...

javascript - Is phaser capable of large multiplayer games? -

newbie here. working phaser, isometric plugin. i know if possible create games in phaser similar agar.io , in terms of handling real-time multiple connections, generating enormous map 300 players in , without having impact in game performance. don't know how handle multiplayer part (probably sockets, node.js) work well. , generating big map quite blank too. is possible, in phaser, create isometric-type game handles multiples real time multiplayer , huge maps generated when user gets edges of visible "map"? how? if not, should opt (game engine in js , other applications) in order achieve want? you're not asking right question, you're close! your first guess correct. wouldn't handle multiplayer phaser, you'd use web sockets, or nodejs, or other backend. phaser not limit in can create regards multiplayer, since none of networking code has phaser. the idea of handling huge map depends on how optimize graphics, regardless of platform or ...

jquery - Uncaught TypeError: $(...).proofreader is not a function -

wanted use joomla proofreader component, not display modal window gives error uncaught typeerror: $(...).proofreader not function found line gives error, <div id="proofreader_container" class="proofreader_container" style="display:none;"><?php echo $displaydata['form']; ?></div> <script> jquery(document).ready(function ($) { $('#proofreader_container').proofreader({ 'handlertype' : '<?php echo $displaydata['options']['handler']; ?>', <?php if (isset($displaydata['options']['load_form_url'])): ?> 'loadformurl' : '<?php echo $displaydata['options']['load_form_url']; ?>', <?php endif; ?> <?php if ($displaydata['options']['highlight']): ?> 'highlighttypos' : tru...

css - Changing text color and style in material-ui version 0.15.4 -

i new css , front end web development , having trouble in setting style of button on page. want change text color of , maybe change primary color of theme (currently looks cyan, want make blue). know material-ui has moved inline styles , tried passing style variable "style" field in button, wasn't able make work. appreciated. var react = require('react'), mui = require('material-ui'), logindialog = require('./login-dialog.jsx'), raisedbutton = mui.raisedbutton, muithemeprovider = require('material-ui/styles/muithemeprovider'), darkbasetheme = require('material-ui/styles/basethemes/darkbasetheme'); var index = react.createclass({ getchildcontext: function() { return { muitheme: getmuitheme(darkbasetheme), }; }, childcontexttypes: { muitheme: react.proptypes.object }, render: function() { return ( <div classname="mui-app-canvas home-page-background"> <raisedbutton...

google cloud messaging - How to send notification message from my android app based on some condition -

Image
i working on android app, while user registration stores registration id(gcm id) in database. having gcm id, sender id, api key. how can send notification message particular device passing gcm id ? pls guide me link. dont know php. guide me through java code. advance thanks put data here , send. link testing can create own panel.

javascript - .append is executed more than once -

.append executed more once (3 times) though function calls once. $('#container, #tree').on('click', 'li', function(event){ $( '#myareadiv' ).append( field:<br /><input name="myfield" id="myfield" readonly value="2"/>' ); event.stoppropagation(); }); try instead, because think field not right. click on tree... $('#container, #tree').on('click', 'li', function(event) { $('#myareadiv').append('<br /> <input name="myfield" id ="myfield" readonly value="2"/>'); event.stoppropagation(); }); <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <div id="tree"> <li> tree </li> </div> <div id="myareadiv"> </div>