Posts

Showing posts from September, 2015

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

How - create and use database directly after creation in SQL Server? -

i created sql script check if database exist, if exists deletes , re-creates. after connect directly after creation creating tables .. here code not work. announces error message msg 911, level 16, state 1, line 10 database 'arms2' not exist. make sure name entered correctly. my script if exists (select * sys.databases name = 'arms2') begin drop database arms2 print 'drop database arms2' end create database arms2; print 'create database arms2' use arms2 create table ..... put go statement after create... ... create database arms2; print 'create database arms2' go use arms2

c - Variable isn't storing return value -

i trying make program converts hex string decimal. having issue assigning returned integer value findlength function. going printf statements can tell findlength(thestring) yield correct value length showing value of 0 despite fact have length = findlength(thestring). this isn't homework problem, i'm absolutely stumped why simple assignment isn't working. i've declared length know that's not issue. i'm getting no compiler messages. appreciated. edit: know convert doesn't useful , loop needs fixed shouldn't effecting findlength return right? second edit: i've submitted string of '324' tested. #include <stdio.h> int convert(char s[], int thelength); int findlength(char s[]); int main(){ char thestring[100]; int result; int i; int length; printf("%s","hello, please enter string below. press enter when finished."); scanf("%s",thestring); //apparently scanf b

xquery - UTC time zones calculation -

departuredatetime:2015-08-15t09:50:00 (gmtoffset=10) arrivaldatetime:2015-08-15t06:30:00(gmtoffset=-7) flightduration= arrivaldatetime-departuredatetime flithtduration =13:40 hours, giving, but how calculating unable understand, according formula giving 13:40 hours,could pls , explain. thanks in advance. 2015-08-15t09:50:00 (gmtoffset=10) = 2015-08-14t23:50:00z 2015-08-15t06:30:00(gmtoffset=-7) = 2015-08-15t13:30:00z = 13h40m i think need brush on time zone concepts bit, because there's nothing wrong calculation itself. if you're feeding bad data return bad results.

performance - numpy count sum of costs for points in same group -

i have vector each point @ index belong group vector[i] vector=np.array([[1,1,4,1,4,3,1]]) i have cost every point: cost=np.array([[10,10,40,1,4,1,2]]) i want compute in efficient way without loops sum of costs each group, point. for example except output: [[23,23,44,23,44,1,23]] for group 1 10+10+1+2 = 23 for group 2 40+4 = 44 for group 3 1 just: counts = np.bincount(vector, weights=cost) output = counts[vector]

ruby - Rescue block did not run in rails migration script -

i have generated following migration: class addmarketstatusidtoproducts < activerecord::migration def change add_column :products, :market_status_id, :integer end end but started raising following error @ heroku: 20150816131733 addmarketstatusidtoproducts: migrating ===================== -- add_column(:products, :market_status_id, :integer) (1.7ms) alter table "products" add "market_status_id" integer pg::undefinedtable: error: relation "products" not exist : alter table "products" add "market_status_id" integer (1.0ms) rollback rake aborted! standarderror: error has occurred, , later migrations canceled: error message quite clear, used following migration script instead: class addmarketstatusidtoproducts < activerecord::migration def change begin add_column :products, :market_status_id, :integer rescue pg::undefinedtable create_table :products |t| t.float :price

javascript - How can I make only one column of a table selectable? -

can prevent user highlighting 1 column in table? i have 2-column table. users want copy content in second column, not first column. <table> <tr> <td>col1</td> <td>line1</td> </tr> <tr> <td>col1</td> <td>line2</td> </tr> <tr> <td>col1</td> <td>line3</td> </tr> </table> here's jsfiddle example: http://jsfiddle.net/vepq0e29/ when user copies , pastes, want output be: line1 line2 line3 ... line7 i don't want col1 show or highlighted when user selects table. how can make users can select , copy content second column? thanks! you can use pseudo-elements show text. text pseudo-elements never copied @ moment (not sure, if it'll changed sometime). http://jsfiddle.net/vepq0e29/3/ td:first-child:after { content: attr(aria-label); } <table> <

Is it possible to get a stack trace for chrome console warning? -

react warned me bad state logic somewhere: warning: setstate(...): can update mounted or mounting component. means called setstate() on unmounted component. no-op. when click line number, points console.warn line in react source code. how can see in code warning coming from? there way stack trace warn ? it's hard track down when there's > 20 distinct components. when inspecting react source code in chrome, can click on line number add break point. once refresh page, debugger halt @ given line , via call stack on right can see how got there.

java - how to monitor progress of uploading file in servlet 3.1 -

i want monitor progress of file getting uploaded m using servlet 3.1 i know specs of servlet 3.1 , don't need apache common fileupload can part class i did this inputstream inputstream = null; double s; string size=null; string contenttype=null; string submittedname=null; string tim=null; string actuallocation=null; system.out.println("getting here"); part filepart = request.getpart("file"); system.out.println("getting here"); if(description.equals("")) { system.out.println("please provide description file"); } else{ if (filepart != null ) { s=(double)filepart.getsize(); double mb=(s/1048576); if(mb != 0) { size=string.valueof((float)mb); contenttype=fil

vb.net - Creating a console to edit code inside a form VB/C# -

i wondering if me problem. creating home project , wondering if there way of creating console (much in games under esc key) edit lines of code without having close form/application , recomplie it? plus possible in vb or c#? any words of advice or if possible great! thanks in adavance!

c++ - Calling random altered functions based on an original function -

let's have 10 altered functions each original function, same, different process of execution , maths. want call random function out of 10 altered functions instead of original function every time original function supposed used in code. how can , avoid getting 9 other altered functions compiled, not selected random , won't used? this hand out "different" build each receiver unique signature. possible way of doing it, can think of, have folder each original function holds 10 separate include files, each altered function. kinda messy, it's way can think of. if there's easier way of doing, want achieve, please let me know. example adding junk code original function randomly on compiling - better, since it's dynamic. can't imagine of way on how it. here's pseudo: http://pastebin.com/v7hv53ns this problem can divided 2 smaller problems. part 1: determine variant give receiver. equivalent mapping signatures {1,...,10} without colli

r - Getting specific line from Cash Flow -

i'm trying data cash flow getfinancials function in r. library(quantmod) s <- c("aapl","goog","ibm","gs","amzn","ge") fin <- lapply(s, getfinancials, auto.assign=false) names(fin) <- s but when try specific line with fin$aapl$cf$a["cash operating activities"] fin$aapl$cf$a["capital expenditures"] i na return. how can these specific lines cash flow? since fin$aapl$cf$a matrix, need comma after name because asking row name. without comma asking vector element named "cash operating activities", , since have matrix individual elements not named. class(fin$aapl$cf$a) # [1] "matrix" "cash operating activities" %in% rownames(fin$aapl$cf$a) # [1] true ## no comma - na because "cash operating activities" not named vector element fin$aapl$cf$a["cash operating activities"] # [1] na this can more illustrated with x <- 1 x[

php - add to deepest array child element -

how select deepest child element multidimensional-array in order add element specific 1 in php (always knowing added, in case additional information parent needed in order create new child)? eg. having array want able add aaaa, bbbb, cccc each: aaa, bbb, ccc? , later on aaaaa, bbbbb,… each aaaa, bbbb… , on (where each new element aware of it's parent's name). array( "a"=> array( "aa"=> array( "aaa", "bbb", "ccc" ), "bb"=> array( "aaa", "bbb", "ccc" ), "aa"=> array( "aaa", "bbb", "ccc" ), ), "b"=> array( "aa"=> array( "aaa", "bbb", "ccc" ), "bb"=> array( "aaa", "bbb", "ccc"

Rails - How to Pass Parameter to Different Controller to edit Object -

i have store class want enter in toy id simple form attach toy object store. thing passing through params[:id], not params[:toy_id] store _form.html.erb: <%= form_tag({controller: "toys", action: "update"}, method: "post") %> <%= text_field_tag(:toy_id) %> <%= submit_tag("update") %> <% end %> after clicking submit, should go toyscontroller 2 parameters: 1) params[id] store id , 2) params[:toy_id] toyscontroller=>update: def update respond_to |format| store = store.find(params[:id]) toy = toy.find(params[:toy_id]) toy.store_id = store.id toy.save if @toy.update(toy_params) format.html { redirect_to @toy, notice: 'toy updated.' } format.json { render :show, status: :ok, location: @toy } else format.html { render :edit } format.json { render json: @toy.errors, status: :unprocessable_entity } end end end as using form_tag , have

HTML/CSS drop down menu (hover) -

hi having trouble dropdown menu. here html code <div class="sticky-nav"> <a id="mobile-nav" class="menu-nav" href="#menu-nav"></a> <div id="logo"> <a id="goup" href="index.html" title="cybersprint"></a> </div> <nav id="menu"> <ul id="menu-nav"> <li><a href="about.html" class="external">about us</a></li> <li><a href="solutions.html" class="external">solutions</a> <ul id="submenu-nav"> <li><a href="hits.html" class="external"> healthcare itsolutions</a></li> <li><a href="gits.html" class="external">gove

Spring security permitAll() does not work -

<dependency> <groupid>org.springframework.security.oauth</groupid> <artifactid>spring-security-oauth2</artifactid> <version>2.0.5.release</version> </dependency> i have created spring-boot application purely severed resource server. @configuration @enableresourceserver public class resourceserverconfiguration extends resourceserverconfigureradapter { @override public void configure(httpsecurity http) throws exception { http.authorizerequests().anyrequest().permitall(); } } in configuration class, did above (allow everything, experiment purpose). however, still seems requests come server got 401 unauthorised error. permitall() not seem work. am missing here? thanks.

cakephp - Subfolder installation -

i'm trying add on cakephp on existing server, location / block being used. i'm following pretty url on nginx section on cakephp cookbook. on test environment, have server block looking server { listen 80; server_name localhost; access_log /var/www/html/log/access.log; error_log /var/www/html/log/error.log; location / { root /var/www/html/cakephp/app/webroot/; index index.php; try_files $uri $uri/ /index.php?$args; } location ~ \.php$ { root /var/www/html/cakephp/app/webroot/; index index.php; try_files $uri =404; include /etc/nginx/fastcgi_params; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param script_filename $document_root$fastcgi_script_name; } } from this, i'm able run testscontroller through url localhost/tests however, server i'm trying add cakephp to, there application installed @ domain root. location / {

html - Detect lowest vertical div on page -

i have problem trying keep footer div @ bottom of others. when call footer main content div errors long side bars overlapping footer. but when try calling footer sidebar div have same problem main content div. getting 1 work seems break other. there way can these 's check if lowest elements on page and, if so, call function? im not sure trying do...you haven't posted code , question lacks detail. but if trying last div in document use jquery function. $('div').last(); this last div on page. can chain methods $('div').last().addclass().remove() etc...

entity framework - How to implement FIFO with a ORM? -

i'm developing web pos using symfony . system works, i'm worried database. i'm storing product qty float, because products can sold in qty 0.3, 0.2, 0.99, 1.69, etc. bread. when save sell call save method. save method use foreach walk array collection of details , detail entity has qty, price, , product, every sale has @ least 1 detail. anyways update qty this: detail->getproduct()->setqty(detail->getproduct()->getqty - detail->getqty ) is easy update , delete sale. not support fifo or lifo. now want support fifo , lifo @ first tried create stock entity, stock{ var productid ; var cost; var sell; var detail; } and detail table wich hold this: detail{ var product[]; var price; } and sell class, sell{ var details[]; var total; } so example sell of 3 units of x product. 3 entities of stock no detail added yet, , if fifo results should ordered id asc. but still products bread don't know how can work, cannot have 1000 entiti

Facebook Share fails on Localhost (Ruby on Rails dev) -

Image
it looks facebook share's plugin fails when i'm on localhost:3000, though have set url on app settings. first, screenshot of app settings: and code have in head: <head> <meta property="fb:app_id" content="<%= rails.application.secrets.facebook_app_id %>"></meta> <meta property="og:site_name" content="<%=rails.application.config.app_name %>"></meta> <meta property="og:url" content="<%= request.original_url %>"></meta> <meta property="og:type" content="website"></meta> <meta property="og:title" content="<%= @user.fb_name %> doing something"></meta> <meta property="og:description" content="this website awesome!"></meta> </head> finally, here plugin html code: <div class = "row fb_share"> <div class=&qu

Detecting if a PDF file contains 3D element -

is there way detect if pdf contains 3d element (universal 3d object embedded) without reading file contents? can information obtained metadata? afaik, there no requirement put info metadata fact 3d elements may contained in document. some u3d writing software may put hint xml metadata though. long answer you'll have parse pdf page tree @ least partially in order find out. technically, 3d elements implemented annotations . discover annotation, you'd have follow parsing path: read trailer. tells object number of /root indirect object of document. read cross reference table. tells byte offsets each indirect object within document. go /root indirect object. read /pages key. tells indirect object represents root of document's page tree. go indirect object represents /pages . read /kids key. tells other indirect objects represent document pages. go each indirect object representing document page. (optionally present) /annots key. if present po

python - Function to define the @property for multiple attributes -

i trying make function takes in variable number of attributes class instance , redefines them @property, giving attribute getter , setter. i want achieve this: @property def x(self): return self._x @x.setter def x(self, value): self._x = value @property def dx(self): return self._dx @dx.setter def dx(self, value): self._dx = value @property def dy(self): return self._dy @dy.setter def dy(self, value): self._dy = value by doing this: decorate_these_attributes(self.x, self.dx, self.dy) here have far: def decorate_these_attributes(self, *args): def attr_set(attr, val): attr = val attr in args: attr_get = lambda: attr attr = property(attr_get, attr_set) as of now, when call function, doesn't anything. ideas of doing wrong? you use class decorator or metaclass things this: def apply_property(cls): def make_getter(name): def getter(self): return getattr(self, name)

javascript - jQuery scrollTo selected row in c# asp.net -

i want scroll row selected not working. have added scrollbar div outside table in html.it scroll fastly , doesn't move selected row. have used jquery version 1.8.11.its working fine in fiddle, not in asp.net c# code. don't know what's problem.i new asp.net. in advance. working fiddle not working in c# asp.net. http://jsfiddle.net/adiioo7/lavvunhj/12/ <asp:content id="content2" contentplaceholderid="maincontent" runat="server"> <h2><%: viewbag.message %></h2> <p> learn more asp.net mvc visit <a href="http://asp.net/mvc" title="asp.net mvc website">http://asp.net/mvc</a>. </p> <div style="overflow:scroll;height:120px;width:450px;" id="your_div"> <table id="table1"> <thead> <tr> <th>column1</th> <th>column2</th>

why does python round down? eg -12/10 = -2 -

i saw twitter post pointing out -12/10 = -2 in python. causes this? thought answer should (mathematically) one. why python "literally" round down this? >>> -12/10 -2 >>> 12/10 1 >>> -1*12/10 -2 >>> 12/10 * -1 -1 this due int rounding down divisions. (aka floor division ) >>> -12/10 -2 >>> -12.0/10 -1.2 >>> 12/10 1 >>> 12.0/10 1.2

java - How to generate random number and export it as JSON? -

i planning generate random number , export json using json-simple . have following code public class main implements jsonaware{ private final int data; public main(int data){ this.data = data; } public string tojsonstring(){ stringbuffer sb = new stringbuffer(); sb.append("["); sb.append(data); sb.append("]"); sb.append(","); return sb.tostring(); } public static void main(string[] args){ jsonarray da = new jsonarray(); random generator = new random(); int [][] grid; grid = new int[128][14]; (int row = 0; row < 128; row++){ (int col = 0; col < 14; col++){ grid[row][col] = generator.nextint(100); // da.add("%d",grid[row][col]); da.add(grid[row][col]); } // system.out.println(); } system.out.println(da);

javascript - Expected behavior for missing callbacks when providing a module API -

hopefully not abstract looking advice on expected behavior when creating node module api. finding in module implementation, checking make sure caller has provided callback before call getting messy. starting think user error not provide callback api needs 1 job. being node beginner, general pattern modules? took @ node source code itself. seems in places use function swaps unsupplied callback generic 1 throws error. seems might lead confusion though. thanks you can provide default callback. depending of needs , importance of callback, can provide noop function or function check if there error. if (!callback) { callback = function noop() {} } throwing or showing error you'll decide. (better not throw cases) if (!callback) { callback = function handleerror(e) { if (e) console.log(e); // or if (e) throw(new error(e)) } }

angularjs - Bootstrap 3 Angular modal popup not processing touch events on mobile devices -

bootstrap3 , angular supposed play nicely together.... , bootstrap being "mobile first" never thought i'd run this, have. i have modal window being popped button (via standard modalservice), works fine across desktop browsers i've tested (ie 10, 11, edge, chrome, opera, safari, , firefox) fails on mobile. every mobile have access (ios chrome, ios safari, android internet browser, , android chrome). it displays same failure on chrome emulation of mobile browsers. in cases on mobile, radio buttons , checkbox fail recognize tap/click event.. unless hold long long time (much longer 300ms i've seen mentioned in articles). in couple mobile browsers capture - angular actions result change not being executed on mobile clients (but on desktops) <input type="radio" class="form-control" ng-model="modaloptions.rscope.selecteditem" name="purchase" ng-value="selecteditem=item" ngclick="modaloptions.rscope.

Continous date in data range in sql server -

i want show coloring if employee absent consecutive day,so writing query - select employee,attendancedate, (select (case when count(employee) >= 3 1 else 0 end) att_tblextattendance employee = a.employee , session1status=5 , session2status=5 , attendancedate between dateadd(day,-3,'2014-05-30 00:00:00.000') , '2014-05-30 00:00:00.000') bcount, (select (case when count(employee) >= 3 1 else 0 end) att_tblextattendance employee = a.employee , session1status=5 , session2status=5 , attendancedate between '2014-05-30 00:00:00.000' , dateadd(day,3,'2014-05-30 00:00:00.000')) fcount att_tblextattendance employee=498 , (session1status=5 or session2status=5) here if employee absent continuous 3 days bcount or fcount should 1 else 0,but problem here above select date range if employee not absent continuous bcount updating 1. above query result. rows employee, attendancedate,bcount , fcount. 498 2013-07-25 00:00:00.000 1 0

c# - How can i add image when i want to respone page in asp.net? -

Image
i want write simple web application wirite data asp.net respone , show line simple image,i create image dynamically code: image myimage = new image(); myimage.width = 50; myimage.height = 50; myimage.imageurl = "direction_arrow_green_down.png"; this.controls.add(myimage); , write simple respone code: response.write("<br/>"+ "sample"); want write this: response.write("<br/>"+ "sample"+myimage); want somthing this: how can solve that?thanks. why cant try ? string img = "<img src='https://cdn3.iconfinder.com/data/icons/simple-web-navigation/165/tick-128.png' width='128' height='128'>"; response.write("<br/>" + "sample" + img); ;

Comparing two CSV files and exporting non-matches using Python -

as beginner in using python i'm stuck yet again! i've got 2 csv files follows: csv1 (master list) id name code. prop 12 sab 1234 zxc 12 sab 1236 zxc 12 sab 1233 zxc 12 sab 1234 zxc 11 asn 1234 abv 16 hgf 1233 aaa 19 mab 8765 bct 19 mab 8754 bct csv2 (subset) id name code. prop 12 sab 1234 zxc 12 sab 1236 zxc 12 sab 1233 zxc 12 sab 1234 zxc 19 mab 8765 bct 19 mab 8754 bct my goal try , use values in first column of csvs compare , identify not occur in csv2. edit in above example rows id 11 , 16 csv1 (master list) should exported. something consider. id although unique has multiple instances in both csv files (as demonstrated in sample data csv files above). i have gone through few threads on website such this one . trying achieve exact opposite of asked here cannot understand solution on t

asp.net - Sending Push Notification to multiple android devices using asp .net -

i'm trying send push notifications multiple android devices. for 1 device working, when tried add multiple device registrationids not; gcm returns error=invalidregistration var message = tmessage.text; //message text box var title = ttitle.text; string stringregids = null; list<string> regids = new list<string>(); regids.add(redidemulnew); regids.add(regidmobilenew); stringregids = string.join("\",\"", regids); webrequest trequest; trequest = webrequest.create("https://android.googleapis.com/gcm/send"); trequest.method = "post"; trequest.contenttype = " application/x-www-form-urlencoded;charset=utf-8"; trequest.headers.add(string.format("authorization: key={0}", applicationid)); trequest.headers.add(string.format("sender: id={0}", se

c - Allow some processes to read and write a directory and deny rest of all processes -

i want monitor processes , give permission accessing directory. have processes want give permission access read,write , rest of process deny access directory. i have appliction in there multiple processess. want these processes can access specific directory. no other processes should able access directory if running root. selinux can this. give directory , contents distinct file context, allow access file context specific domain, , run single process within domain.

android - How to see list of files stored in a directory -

i have built app makes folder in storage of device. here code i'm using: file wdirectory = new file("/sdcard/w/"); wdirectory.mkdirs(); file outputfile = new file(wdirectory, filename); fileoutputstream fos = new fileoutputstream(outputfile); now want know how show files in list view in directory. paste folder path.... file folder = new file("your/path"); file[] listoffiles = folder.listfiles(); (int = 0; < listoffiles.length; i++) { if (listoffiles[i].isfile()) { system.out.println("file " + listoffiles[i].getname()); } else if (listoffiles[i].isdirectory()) { system.out.println("directory " + listoffiles[i].getname()); } }

javascript - Table getting out of fieldset border in Firefox only -

i have form have fieldsets, in 1 fieldset have table. table in fieldset in chrome , ie not in firefox. please have look: https://jsfiddle.net/79504g5b/1/ my fieldset has css: #msform fieldset { background: white; border: 0 none; border-radius: 3px; box-shadow: 0 0 15px 1px rgba(0, 0, 0, 0.4); padding: 20px 30px; box-sizing: border-box; width: 80%; margin: 0 10%; /*----------------------->2*/ position: absolute; } i don't know problem. the element .statushead1 not occupy available width. so, table added next it, in available space. to move table on it's own line, use clear: both on table . table { clear: both; } see demo . optionally, can set float: left table . demo i'll recommend use clear: both . using this, don't have change other elements structure/view.

javascript - Node Express gives two responses, breaks front-end script -

due in express routing, data seems sent twice angular front-end. seems send mixpanel endless loop causes parts of app not load properly. the reason following code want detect user agents , send them other regular user sees. because user agents won't load javascript, need them scrape information page. from server.js : app = express(); app .use( morgan( 'dev' ) ) .use(bodyparser.urlencoded( { limit: '50mb', extended: true } ) ) .use( bodyparser.json( { limit: '50mb' } ) ) .use( '/api', require('./routes/usersroute.js') ) .use( express.static( indexpath ) ) .all( '/*', require( './routes/home.js' ) ) from home.js : router.get( '/:user/:stream/:slug', function( req, res, next ) { if ( req.headers['user-agent'].indexof( 'facebook' ) != -1 ) { if ( !req.params.user && !req.params.stream && !req.params.slug ) return next()

Highcharts - Posibble to change the text zoom to other worlding? -

is possible change "zoom" text in highcharts custom text? please refer link below. [http://jsfiddle.net/gh/get/jquery/1.9.1/highslide-software/highcharts.com/tree/master/samples/stock/demo/area/][1] you can use setoptions apply lang parameter. highcharts.setoptions({ lang:{ resetzoom: 'your own text', resetzoomtitle: 'your own zoom title' } });

rest - Array of objects using IODOCS -

i want add array of object like "identifiers": [ { "primary": true }, { "primary": false }, ] but object inside array need name create like "identifiers": [ { "identifier": { "primary": true } } ] i used following json code in config file, "identifiers": { "title": "identifiers", "type": "array", "location": "body", "items": { "title": "identifier fields", "type": "object", "properties": { "identifier": { "type": "object", "properties": { "primary": { &quo

sprite kit - how to get access to all my enemy nodes at the same time -

i have 6 sprites of enemies in spritekit game. want have access of them "enemies" in order make them appear on scene in random order. tried this: class gamescene: skscene { var redbox = skspritenode(imagenamed: "redbox") var greenbox = skspritenode(imagenamed: "greenbox") var bluebox = skspritenode(imagenamed: "bluebox") var magentabox = skspritenode(imagenamed: "magentabox") var cyanbox = skspritenode(imagenamed: "cyanbox") var yellowbox = skspritenode(imagenamed: "yellowbox") func randombox() -> skspritenode { let boxes = [redbox, greenbox, bluebox, magentabox, cyanbox, yellowbox] let count = boxes.count var randomone = int(arc4random_uniform(uint32(count))) var randombox = boxes[randomone] return randombox } var onebox: skspritenode = randombox() } but in onebox xcode gives me error , says "missing parameter #1 in call". how pick random node right way? edit: code

javascript - Jquery forms with adaptive table from selector -

i need help. trying build form in php + jquery , , have trouble functionality. example, have code: <form action="" method="post" id="multiform"> <!-- product selector --> <table class="multi" id="multirow"> <tr><td> <select name="store[product][]" required> <option value="" selected="selected">-product-</option> <option value="430">octa</option> <option value="440">kasko</option> <option value="19041">travel</option> <option value="19063">household</option> </select> </td> <!-- /product selector --> </table> <input type="submit" value="ok"> how can that, if selected value 430 or 440, @ right side insert s <td><input type="text" id="motor[]" name=&quo

Getting value of a text Feild for ajax request Rails -

i have simple rails form looks <%= form_for :phrase, url: phrases_path |f| %> <p> <%= f.label :"enter text" %><br> <%= f.text_area :text %> </p> <%= f.fields_for :order |builder| %> <p> <%= builder.label :"ваш email" %><br /> <%= builder.text_field :email %> </p> <% end %> this form goes appropriate controller , in controller depending on value(text) of text area performs calculations create price , save order. and works fine. have requirement. before submitting application user can click on button(inserted somewhere between form) know cost. said above cost calculated using text of text_area , logic present inside some method . implement button. on clicking button ajax request started, value(text) of text area retrieved , cost calculated depending on some method . calculated value shown on page. i know start aj

matlab - parallel independent iteration of elements in an array -

i want iterate elements independently (same condition elements though). want stop iteration when value stops changing. post part of code. according research, figured can done using parfor loop don't know how implement it. can please correct code? in advance. probability = (ones(1,2048) .* 1/2048); tij = sum(statetransitionfwd); %gives array of 2048 elements. probability = ((probability * statetransitionbwd) - (tij .* probability)); threshold = (ones(1,2048) .* 0.05); old = zeros(1,2048); new = zeros(1,2048); while(1) probability = ((probability * statetransitionbwd) - (tij .* probability)); new = probability; if old-new <= threshold break end old = probability; end so want steady state probability (where not changing anymore) for 1 cannot parallellise while loops. to implement parfor loop make sure of following: - variables must defined before parfor loop. define output variables before loop. - iterations must absolute