Posts

Featured post

php - Admin SDK -- get information about the group -

please, help. https://www.googleapis.com/admin/directory/v1/groups/106274944935548788283 sending request obtain information group id 1062 ... here link method in google https://developers.google.com/admin-sdk/directory/v1/guides/manage-groups#get_group in response error - 401 unauthorized. oauth authenticate via user has received rights necessary request, included in console admin sdk. authorization successful, there token. not can not understand. if not hard - response. requested information: file_get_contents("https://www.googleapis.com/admin/directory/v1/groups/1062749‌​44935548788283?key=aizasybruhiomdf9nlx9lx3imxwesqmcrnhh4l4"); id group - "106274944935548788283" key applications in case - "aizasybruhiomdf9nlx9lx3imxwesqmcrnhh4l4" error: failed open stream: http request failed! http/1.0 401 unauthorized

ember.js - "template.buildRenderNodes is not a function" on latest Ember release -

html , js (non-minified versions) index.html <!doctype html> <html> <head> <meta charset="utf-8"> </head> <body> <!-- <ember> --> <script type="text/javascript" src="assets/lib/jquery/jquery.min.js"></script> <script type="text/javascript" src="assets/lib/ember.js/ember.min.js"></script> <!-- </ember> --> <!-- <app> --> <script type="text/javascript" src="assets/js/templates.min.js"></script> <script type="text/javascript" src="assets/js/app.min.js"></script> <!-- </app> --> </body> </html> app.min.js window.app = ember.application.create(); templates.min.js (the templates compiled using gulp-ember-templates ) ember.templates["index"] = emb

php - Laravel: validate a integer field that needs to be greater than another -

i have 2 fields optional if both aren't present: $rules = [ 'initial_page' => 'required_with:end_page|integer|min:1|digits_between: 1,5', 'end_page' => 'required_with:initial_page|integer|min:2|digits_between:1,5' ]; now, end_page needs greater initial_page . how include filter? there no built-in validation let compare field values in laravel , you'll need implement custom validator , let reuse validation needed. luckily, laravel makes writing custom validator really easy . start defining new validator in yor appserviceprovider : class appserviceprovider extends serviceprovider { public function boot() { validator::extend('greater_than_field', function($attribute, $value, $parameters, $validator) { $min_field = $parameters[0]; $data = $validator->getdata(); $min_value = $data[$min_field]; return $value > $min_value; }); validator::replacer('greater_tha

java - How can I change color of button's background -

i have many buttons in calculator app. testing 1 button start, buttons id "one" , should change colour when click blue theme button. have tried following methods: bluetheme = (button) findviewbyid(r.id.bluetheme); bluetheme.setonclicklistener(new onclicklistener() { @override public void onclick(view v) { one.setbackgroundcolor(color.argb(175, 144, 202, 249)); one.setbackgroundcolor(color.parsecolor(/*hex code here*/)); one.setbackgroundcolor(color.blue); } }); nothing seems anything. trying change colour of button in 1 activity via option in activity. here's actual button one : one = (button) findviewbyid(r.id.one); one.setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) { result.append("1"); } }); xml code of one in activity_main.xml: <button android:id="@+id/one" android:layout_width="wrap_content" android:

PHP not echoing after file upload completed -

i have simple code upload file using drop zone. it's uploading file fine reason doesn't echo "done uploading" @ end of code. am missing obvious here? <script type="text/javascript"> dropzone.options.mydropzone = { addremovelinks: true, removedfile: function(file) { var _ref; return (_ref = file.previewelement) != null ? _ref.parentnode.removechild(file.previewelement) : void 0; } }; </script> <div id="dropzone"> <form id="mydropzone" action="#" class="dropzone" id="demo-upload"> <div class="dz-message"> drop files here or click upload.<br /> </div> </form> </div> <?php $ds = directory_separator; //1 $storefolder = 'uploads'; //2 if (!empty($_files)) { $tempfile = $_files['file']['tmp_name']; //3 $targetpath = dirname(

celery - Improve RabbitMQ throughput -

i'm using rabbitmq , celery project , i've reached bottleneck. my architecture follows: 1 rabbitmq node between 1 , 7 nodes read rabbitmq via celery i started performance measurements , pre-populating rabbit 200k messages, node performs 600msg/sec. starting 2 nodes same pre-populated queue, little under 600msg/sec both nodes. adding more node same scenario leads drastic loss in throughput, reaching under 400msg/sec 7 nodes. i've started add settings (some rabbitmq site) lead no improvement. my current settings configuration is [ {kernel, [ {inet_default_connect_options, [{nodelay, true}]}, {inet_default_listen_options, [{nodelay, true}]} ]}, {rabbit, [ {tcp_listeners,[{"0.0.0.0", 5672}]}, {vm_memory_high_watermark, 0.6}, {tcp_listen_options, [binary, {packet, raw}, {reuseaddr, true}, {backlog, 128}, {nodelay, t

javascript - Function apply with Promises -

i'm working on promise-based project in node.js using bluebird , , in native promises es6. in both, have chain query database in following form: some_function(/*...*/) .then(function () { return query("select `whatever` `wherever` ") }) .then(/*...*/) note query returns promise resolved query result. repeats in several chains, , i'm looking way clean unused function wrapper. i'd naturally use function.prototype.apply() , in case, when try: .then(query.apply(this, ["select * ... "])) .then(function(rows){ /*...*/ }) the next function in chain gets rows undefined . thanks ahead. appreciated. you have pass function reference .then() choices follows: use inline anonymous function are. create own utility function returns function (see example below) use .bind() create function. the inline anonymous some_function(/*...*/).then(function () { return query.apply("select `whatever` `wherever` &q