Posts

Showing posts from February, 2012

android - Re-installing Ringee Data Access in Eclipse -

the following errors received because deleted ringee data access eclipse. question: how re-install ringee plug-in eclipse these errors disappear? beginner. please me. org.eclipse.core.runtime.coreexception: file not exist. @ org.eclipse.core.internal.filebuffers.resourcefilebuffer.create(resourcefilebuffer.java:237) @ org.eclipse.core.internal.filebuffers.textfilebuffermanager.connect(textfilebuffermanager.java:112) @ org.eclipse.ui.editors.text.textfiledocumentprovider.createfileinfo(textfiledocumentprovider.java:559) @ org.eclipse.jdt.internal.ui.javaeditor.compilationunitdocumentprovider.createfileinfo(compilationunitdocumentprovider.java:980) @ org.eclipse.ui.editors.text.textfiledocumentprovider.connect(textfiledocumentprovider.java:478) @ org.eclipse.jdt.internal.ui.javaeditor.compilationunitdocumentprovider.connect(compilationunitdocumentprovider.java:1244) @ org.eclipse.ui.texteditor.abstracttexteditor.dosetin...

Java : Making a method to sort an array -

i'm trying make method sorting arrays have array made, i'm not sure returning , calling it. please? public void bubblesort(string words [][] ) { (byte count1 = 0; count1 < words.length - 1; count1++) (byte count2 = 0; count2 < ((words.length)-count1); count2++) { system.out.print(words[count1][count2] + " "); arrays.sort(words); } return words [count1][count2]; } there no need return array main() functions change in contents of array reflects in array passed during function call in main. in main function following : intialize 2-d string : string[][] rows = new string[10][10]; put required array in it. then call function bubblesort(rows); the rows array contains sorted string.

jquery not updating handlebars partial view correctly when submitting a form (express, node.js) -

i'm using node.js express , handlebars. having trouble updating particular div sending data. i'll ask question 10' level first because maybe details unnecessary answer. when use href='blah' , set jquery function express right thing , updates div without updating whole page. when use same code on <form method="post" .... however, instead drops layout, doesn't go jquery call, render entire handlebars page routed via express. why these different , should doing instead? if wasn't clear, here code: inside view directory have: index.handlebars, view1.handlebars, temp.handlebars. inside view1.handlebars, have form : <form method="post" action="/update_this" enctype="multipart/form-data" data-id="{{data.uniqueid}}"> and div : <div id="sectional"> {{> partial}} </div> and when clicks button , want update sectional div . use jquery so: $('#btn-here...

Java encryption and decryption - Recyclable keys -

here problem statement: 1) save data database in encrypted way whoever accesses database/gets hold of data, not usable. 2) 'key' used encrypt data has recycled every year. 3) if recycle key, how can decrypt old data using new key after recycle? (this primary challenge) . 4) development environment java 1) jre has packages dedicated servers , databases. have @ this: https://docs.oracle.com/javase/tutorial/jdbc/basics/connecting.html , http://docs.oracle.com/javase/7/docs/technotes/guides/jdbc/ starting points. however, before ship out data database, you'll want encrypt first. far encryption/decryption goes have ton of options including not limited aes. https://docs.oracle.com/javase/8/docs/technotes/guides/security/crypto/cryptospec.html starting point. 2) because key changing, you'll have pull in of data database, decrypt using old key. cannot make new key , decrypt way, won't work. decrypt > make new key > encrypt using new key > uplo...

javascript - How to access input values in a modal by using function outside the click event? -

i created modal dialog in page , contains form. want have ajax process after clicking button. problem can't input values in modal. here's code: my code in onclick $('.order_concern').on('click', function(){ var order_id = $(this).data('order-id'); var product_id = $(this).data('product-id'); var product_name = $(this).data('product-name'); var seller_id = $(this).data('seller-id'); var seller_name = $(this).data('seller-name'); var customer_id = <?php echo $customer_id; ?> var concern_form = '<div class="row">'; concern_form += ' <div class="form-group">'; concern_form += ' <label>product</label>'; concern_form += ' <input type="text" class="form-control input-sm" style="width: 97%" name="response_product" valu...

How can I fill a DataFrame column with a list of e.g. 2 values in Pandas Python? -

that question quite simple, python beginner: i want create dataframe column given dataframe = df , fill list of values. it's absolutely clear me how fill 1 value: df["xyz"] = 1 but doesn't work: df["xyz"] = [0,1] i want fill column 0,1,0,1,0,1... do know how solve that? longer lists? using itertools.cycle & itertools.islice : >>> itertools import cycle, islice >>> df['xyz'] = list(islice(cycle([0, 1]), len(df)))

Rails: How do I have a zero if there is no data? -

currently if user sells see box witha price. if haven't sold box disapears , see sales. how leave number $0 if user didn't sell instead of clear blank? thanks <% if current_user %> <sold> <li><%= link_to "sales", current_user %> <% @sales.each |sale| %> <div class="sold-count">$<%= sale.amount / 100 %></ %></div> </li> </sold> <% end %> right you're iterating on sales each sale, if size of container zero, loop going skipped. you need add conditional check see if sales empty, @sales.empty? , if is, show 0 . <% if @sales.empty? %> <div class="sold-count"> $0 </div> </li> </sold> <% end %>

java - Cannot upload image to Paperclip from Rails: #<Paperclip::Errors::NotIdentifiedByImageMagickError: -

first of all, running rails 4 on heroku. i building api uploading images, using paperclip gem. the api endpoint uses param 'image' raw bytes of file upload. the code upload paperclip looks this: contents = input['image'] file = tempfile.new('foo') file.write(contents) attachment = { :filename => 'test', :type => 'test', :headers => 'image', :tempfile => file } image = actiondispatch::http::uploadedfile.new(attachment) the image raw file bytes (produced android app) heroku logs looks this: 2015-06-03t00:40:01.153210+00:00 app[web.1]: 8ijjz0r\nrorhzsexgk/fc8aen1okuw9jhlusel42ow5xyzja+ma56ftzg4uioaibwhwt6cmu6lkovdhgevds\ndgen8qrsqrloimgyzh8iq2arsdluapwpp5llsql49plaiq3qv3ml3dry+c7rntgvsuyinv7jrw8g\naqd5rwqqcy+tzf2rqqiqzkbeifdybhp+nyvlexrbpdhqgk3s3smglf2yalpughhgk6mwhkldilrl\nnvlysxywh1rybrbia0jimkwqbl6bucfevr9k1b94sswwleibgozhuk4qy0oucsj2nsiz4dlvafjr\nklsfecmuittas8bopphf5zwmssp5v5ppvigscddjkzi3g1...

javascript - Jquery Replace br tags -

i have text several line break tags so <br></br> and several double line breaks so <br></br><br></br> i want rid of single <br></br> , want keep double ones using jquery or jscript how can tell when used .filter("<br></br>") did not work because got rid of both is there way replace instances of <br></br><br></br> replacewith? or other way the easiest way three-step process: text = text. replace(/<br><\/br><br><\/br>/g, '____magicmarker____'). replace(/<br><\/br>/g, ''). replace(/____magicmarker____/g, '<br></br><br></br>') hoping ____magicmarker____ never, nor ever, part of text. possibility (and better, foolproof one) be: text = text.replace(/(<br><\/br>)+/g, function(all, once) { if (all == once) return ""; return all; }); note written assuming...

javascript - Check for duplicates in an array -

i have function check serialized form data if there duplicates values in it. s = $('#multiselectform').serialize(); var x = []; var y = []; x = s.split("&"); (var = x.length - 1; >= 0; i--) { y.push(x[i].split("=")); }; var c = 0; var e = 0; (var = y.length - 1; >= 0; i--) { if (y[i][1] == y[c][1]) { e++; $('.duplicatealert').show(); } else { $('.duplicatealert').hide(); }; c++; }; basically, split string produced serialize() function , push data arrays. the array i'm trying parse looks this: array [ array [ 0: 'my_field1', 1: 'val1' ], array [ 0: 'my_field2' 1: 'val2' ], array [ 0: 'my_field3' 1: 'val1' ] ] are there better ways same task? maybe shorter? create empty array hold matches loop t...

Error using Django Facebook -

i trying use django facebook register users in app. right in local develoment , after giving persmissions app in facebook , following indications in readthedocs, next error: please specify facebook app id , ensure context processor enabled django version: 1.8 python version: 3.8 this error django-facebook code, has been fixed. make sure using django-facebook 6.0.4 or later. if latest model not yet shipped can doing pip install git+git://github.com/tschellenbach/django-facebook.git

php - Change all array values -

all values of arrays in multidimensional array consists of 1 variable + string. how can change values array[2] , array[3] in example? want change variable called $var $var2 , put variable called $between between $var2 , string. example $var = "start-"; $array = array ( array("{$var}end1a","{$var}end2a","{$var}end3a"), array("{$var}end1b","{$var}end2b","{$var}end3b"), array("{$var}end1c","{$var}end2c","{$var}end3c") ); $var2 = "new-start-"; $between = "between-"; result $array[2]=array("{$var2}{$between}end1","{$var2}{$between}end2","{$var2} {$between}end3"); $array[3]=array("{$var2}{$between}end1","{$var2}{$between}end2","{$var2} {$between}end3"); update: first had one-dimensional array , answer maxhud perfect case. $start = "start-"; $array = array...

java - What happens to my JDBC transaction if I lose my session -

i'm connecting oracle java program, , doing following: start session start transaction insert bunch of rows, call stored procedures, etc. commit transaction end session so . . . happens if lose session (due network problems or somewhat) in middle of transaction? automatic rollback? rollback when transaction times out? worried db going in inconsistent state until oracle gets around cleaning up. if session lost during execution of transaction oracle database automatically rollback changes. can read more statement level atomicity in documentation. if lose transaction because of network problem ora-03113: end-of-file on communication channel , transaction has been rolled on database. however, true when session lost on database server itself. distributed transactions (xa) database transaction stays alive while jdbc session gone, aware of when have xa transactions. also watch out auto-commit default turned on in jdbc driver. automatically commits every ope...

"php.ini" with wordpress, if exist all works well. I can not find a sense -

i have problem have no sense. i'm using wordpress , when i'm logged in see different page. works well, 1 of user, when logged in, sees home page white. 'strange because other users , administrator account have no problem. if create "php.ini" file "error_reporting(0);" , put on root folder, works. home page before white. what's going on? logical explanation?

Youtube IFrame API without cookies -

my country starting apply laws privacy , cookies. is there way use youtube iframe api without storing cookies? this free script preventing iframe cookies: cookies-enabler here list of free cookie law tools features, pros , cons: free cookie law tools

testing - dart pub test... can you exclude files / directories? -

dart/pub v1.10 i have test/e2e folder has webdriver.dart tests. 'pub run test' trying run dart files in e2e. pubspec.yaml dev_dependencies: test: '>=0.12.1 <0.13.0' i've been running webdriver.dart test dart test/e2e/some_test.dart was hoping pub/test implemented transformer... just exclude in pubspec.yaml. no joy. can build transformer test? ideas? (besides moving directory out under test :-)) update looks options are: pub run test test/unit (specify directory) move e2e folder out of 'test' you can filter tests using --name=xxx (where xxx can regular expression) or --plain-name=xxx (just substring comparsion) parameters filter tests. there open issue add tags don't know if planned. i don't know expect transformer do. if use includes/excludes transformer configuration specifies files processed transformer not files executed.

java - Google Drive API Authentication - how to do it and how to implement it? -

i'm trying title of document using file id. here's code: private static void printfile(drive service, string fileid) { try { file file = service.files().get(fileid).execute(); system.out.println("title: " + file.gettitle()); } catch (ioexception e) { system.out.println("an error occured: " + e); } } } however, when run receive 403 forbidden error states, "daily limit unauthenticated use exceeded. continued use requires signup." i assume have authenticate, seeing i'm new google drive api , java, i'm confused how (forgive me). found webpage: https://developers.google.com/drive/web/auth/web-server explains how authenticate i'm still confused. page lists multiple classes thing such exchange authorization code access token , use oauth 2.0 credentials. my question need use of these classes authenticate? , how implement them code? here brief explanation @ http level. any google drive rest api c...

python - Scrapy returns wrong font -

Image
i using scrapy collect data , when try scrape tag element craiglist returns font different other elements. how can make font in left column font in right one? here picture , code using: item["tag"] = " ".join(response.xpath("//p[@class='attrgroup']/span/b/text()").extract()[0]) try using response.xpath("string(//p[@class='attrgroup'])") instead.

oracle - procedure does not exist in the target list of the run pl/sql? -

i compile package spec , body without problem. however, when want test procedure, not in "target:" list of run pl/sql menu of oracle sql developer. , also, not manage execute procedure php code. is there limitations number of procedures or other thing that? note: index: 3, size: 3 - java.util.arraylist.rangecheck(arraylist.java:635) can related this? after recompiling procedure, run show errors command. displays compilation errors if had they. it common issue reason this.

Change matrix/raster coordinates on R -

i'm beginner , have worked lot on problem, still stuck... i have matrix containing values of world temperature. size 360*720. values -180, -90 (longitude, latitude) 180, 90 resolution of 0.5. > head(matrix) nan. nan..1 nan..2 nan..3 nan..4, [...] nan..718 nan..719 [1,] na na na na na na [2,] na na na na na na [3,] na na na na na na [4,] na na na na na na [5,] na na na na na na [6,] -1.6634 -1.6634 -1.6634 -1.6634 -1.6634 -1.7469 ... this matrix "looks like" raster. problem don't know how tell r matrix resolution. if rasterise , plot plot(raster(matrix)) , : http://postimg.org/image/gdnblob07/ yet, need axis -180;180 (x) , -90;90 (y) do know how do? thanks lot using raster package right intuition when instantiate matrix doesn't extents accurately. it...

c# - Could not load type 'iTextSharp.text.html.HtmlParser' from assembly 'itextsharp, Version=5.5.5.0, Culture=neutral, PublicKeyToken=8354ae6d2174ddca' -

see link converting html pdf got version error in webconfig let genius find , solve qustion. my model public class customer { public int customerid { get; set; } public string firstname { get; set; } public string lastname { get; set; } } my controller normal code public actionresult index() { list<customer> customers = new list<customer>(); (int = 1; <= 10; i++) { customer customer = new customer { customerid = i, firstname = string.format("firstname{0}", i.tostring()), lastname = string.format("lastname{0}", i.tostring()) }; customers.add(customer); } return view(customers); } this pdf convert controller public actionresult pdf() { list<customer> customers = new list<customer>(); (int = 1; <= 10; i++) { customer custo...

SQL Server Partitioning - Notion -

i have got database consisting of several thousand of tables (from 2005) 20-30% of them have incremental rowcount of 200k/yr. the requirement visualize statistics of table based on column lastaccesseddate . scheme classify parition groups (10 y, 5y, 3y, 1y, 6m, 3m, 1m, 2w, currentdate) . partitions named p1,p2,..p10 i able understand multiple partitionining groups can defined tables link . the job runs every week , therefore, partitioning scheme varies on current date; i.e. after week, p10 becomes p9 . after 2 weeks, p9 becomes p8 , after month, p8 becomes p7 ; hope idea. is partitioning scheme based on current date feasible? if feasible, worthwhile horizontally partition tables , query them instead of running query through entire table? sql server reports suggests total space usage around 31,556 mb. i running on sql server 2008 instance. you mention data storage , statistics requirements. these 2 should not confused. storage solutions made quick access of...

Bootstrap Datepicker control in ng-grid cellTemplate "AngularJS" -

i using ng-grid , binding bootstrap calender control onto ng-grid follows $scope.employeegridoptions.columndefs = [ { field: 'requeststartdate', displayname: 'start date', celltemplate: '<input ng-click="open($event,row.rowindex)" ng-model="row.entity.requeststartdate" datepicker-append-to-body=true datepicker-popup="mm/dd/yyyy" is-opened="false"></input>' } ] i want open data picker control when user click on textbox. right datepicker getting opened time. there way open instance of datepicker when open function fired. $scope.calandar=function($event,row){ $event.preventdefault(); $event.stoppropagation(); $scope.opened2 = true; } help regards highly appreciated..thank you. try ng-focus instead of ng-click .

ios - Why [UIImage imageWithData:] supports PVRTC format? -

i find out in ios 8.3 sdk (i didn't test other versions), can use [uiimage imagewithdata:] load pvrtc format directly? it isn't supposed that, right? can't find documentation or discussion it, don't know if can rely on it... but work in both simulators , real devices. here codes of test, test project doesn't include opengles.framework. nsdata *data = the_content_of_a_pvr_file; nsstring *tempdir = nstemporarydirectory(); [data writetofile:[tempdir stringbyappendingpathcomponent:@"temp.pvr"] atomically:yes]; uiimage *tempimage = [uiimage imagewithdata:data]; [uiimagepngrepresentation(tempimage) writetofile:[tempdir stringbyappendingpathcomponent:@"temp.png"] atomically:yes]; the 2 saved files shared here: http://d.pr/f/17ugq you can check pvr file in hex editor, coresponds specifications of pvrtc format version 2, pixel format in pvrtc4. any idea?

wordpress - Affiliate Program -

i'm creating online store using wordpress. i'm setting store similar 1 @ link here -- http://www.emconlinestore.com/ . i'm various affiliate programs promoting different products. i've done before, when customer clicked on product image, customer left page , went actual affiliate programs product website. that's not want time around. what wondering when customer adds products cart , purchases product, possible affiliate program product coming receive order , payment without customer leaving website? i want customer think they're buying product store instead of product linking affiliate programs actual store. thanks in advance help!

javascript - AngularJS update database using X-Editable -

so, i'm using angularjs x-editable make easier way edit data. i have table information of client such name, phone, address, etc.. , apply x-editable just fine until moment need save edit on database. also, page show 1 single client, individual client page, details. this code i'm using: page.html <table fixed-header class="detcli_table" ng-init="get_detcliente()"> <thead> <tr> <th>campo</th> <th>informação</th> </tr> </thead> <tbody> <tr> <td>código</td> <td>{{cliente.id}}</td> </tr> <tr> <td>nome</td> <td><span editable-text="cliente.nm_cliente" onaftersave="updateperson(cliente.nm_cliente)">{{cliente.nm_cliente || "empty"}}</span></td> </tr>...

javascript - Web Audio- streaming file from server to client -

i'm trying stream audio server containing audio file client using binaryjs. code inspired code in question: playing pcm stream web audio api on node.js here's server code looks like: // create binaryserver using binaryjs var binaryserver = require('binaryjs').binaryserver; // gotta able access filesystem var fs = require('fs'); // create our server listening on specific port var server = binaryserver({port: 8080}); // when client makes request server.on('connection', function(client){ // audio file var file = fs.createreadstream(__dirname + '/jdillalife.mp3'); // convert int16 var len = file.length; var buf = new int16array(len); while(len--){ buf[len] = data[len]*0xffff; } var stream = client.send(); stream.write(buf.buffer); console.log("server contacted , file sent"); }); console.log('server running on port 8080'); and client code: var speaker = require('sp...

r - Creating a filled contour plot from a cvs (x,y,c) matrix -

Image
i trying use r task -- creating filled contour plot csv file, (x,y,c) matrix. got measurements football field - x , y indicate location in field, ranging 1 11. c measurement. here data looks: ,1,2,3,4,5,6,7,8,9,10,11 1,0,0,0,0,0,0,0,0,0,0,0 2,0,0,0,0.4,0.6,0.6,0.6,0.4,0,0,0 3,0,0,0.5,0.7,0.8,0.8,0.8,0.7,0.5,0,0 4,0,0.4,0.7,0.8,0.9,0.9,0.9,0.8,0.7,0.4,0 5,0,0.6,0.8,0.9,1.0,1.0,1.0,0.9,0.8,0.6,0 6,0,0.6,0.8,0.9,1.0,1.0,1.0,0.9,0.8,0.6,0 7,0,0.6,0.8,0.9,1.0,1.0,1.0,0.9,0.8,0.6,0 8,0,0.4,0.7,0.8,0.9,0.9,0.9,0.8,0.7,0.4,0 9,0,0,0.5,0.7,0.8,0.8,0.8,0.7,0.5,0,0 10,0,0,0,0.4,0.6,0.6,0.6,0.4,0,0,0 11,0,0,0,0,0,0,0,0,0,0,0 please provide example plot filled contour. z <- as.matrix(read.csv(text=',1,2,3,4,5,6,7,8,9,10,11\n1,0,0,0,0,0,0,0,0,0,0,0\n2,0,0,0,0.4,0.6,0.6,0.6,0.4,0,0,0\n3,0,0,0.5,0.7,0.8,0.8,0.8,0.7,0.5,0,0\n4,0,0.4,0.7,0.8,0.9,0.9,0.9,0.8,0.7,0.4,0\n5,0,0.6,0.8,0.9,1.0,1.0,1.0,0.9,0.8,0.6,0\n6,0,0.6,0.8,0.9,1.0,1.0,1.0,0.9,0.8,0.6,0\n7,0,0.6,0.8,0.9,1.0,1.0,1...

macvim - Vim not showing messages for less than 3 occurrences substitutions -

lets say text1 has 4 lines 1 2 1 1 after :%s/1/a/g , vim give message says 3 substitutions on 3 lines text2 has 3 lines 1 2 1 :%s/1/a/g there no messages showing. i typed ":messages" nothing in history either, wonder if there's way tell vim give message no matter number of occurrences. thanks. btw, here's vimrc update like christian brabandt said here by adding set report=0 vimrc fixed issue. this controlled 'report' option. set zero, if want message.

laravel 5 - Eloquent Friendly Column Name -

we're transitioning 1 database another. table in our legacy database has column names less ideal, example: some_crazy_name__xyz in our new database, we'd have column name like: somecrazyname in short term, have work data our legacy database. @ point in near future, we'd switch on without having refactor of our eloquent code query different column names. example: $model = mymodel::where('somecrazyname', '=', 1); i'm extending model class, implementing models provide map of terrible names friendly names: class mymodel extends basemodel { $columnmap = array( 'somecrazyname' => 'some_crazy_name__xyz' ); } this works can use __get , __set in basemodel lookup properties in map, example: $mymodel = new mymodel; // ... echo $mymodel->somecrazyname; however, doesn't work queries without having use map column names. i'm wondering if it's possible without having override of methods within ...

sql - @@Fetch_status in postgreSQL -

i'm transfering database ms sql server postgresql , have problem trigger: create trigger added_clients on client insert begin declare cursor_inserted cursor select name, surname inserted; open cursor_inserted declare @name varchar(15), @surname varchar(20) fetch next cursor_inserted @name, @surname while @@fetch_status = 0 begin print 'added: '+@name+' '+ @surname fetch next cursor_inserted @name, @surname end close cursor_inserted deallocate cursor_inserted end go what equivalent of @@fetch_status in postgresql? here cursor documentation postgresql http://www.postgresql.org/docs/current/static/plpgsql-cursors.html looping through cursor: [ <<label>> ] recordvar in bound_cursorvar [ ( [ argument_name := ] argument_value [, ...] ) ] loop statements end loop [ label ];

c# - How do I ignore the UTF-8 Byte Order Marker in String comparisons? -

i'm having problem comparing strings in unit test in c# 4.0 using visual studio 2010. same test case works in visual studio 2008 (with c# 3.5). here's relevant code snippet: byte[] rawdata = getdata(); string data = encoding.utf8.getstring(rawdata); assert.areequal("constant", data, false, cultureinfo.invariantculture); while debugging test, data string appears naked eye contain same string literal. when called data.tochararray() , noticed first byte of string data value 65279 utf-8 byte order marker. don't understand why encoding.utf8.getstring() keeps byte around. how encoding.utf8.getstring() not put byte order marker in resulting string? update: problem getdata() , reads file disk, reads data file using filestream.readbytes() . corrected using streamreader , converting string bytes using encoding.utf8.getbytes() , should've been doing in first place! help. well, assume it's because raw binary data includes bom. remove bo...

javascript - Proper way of formatting date/time for MySQL and for View vice versa -

i use backbone laravel. i have several fields in form date , time ('dd-mm-yyyy', 'hh:mm') . when want save form use own function convert mysql ('yyyy-mm-dd', 'h:i:s') via date() added save() in laravel model class. but vice versa harder because there no single function in laravel data output. find() , findornew() , findorfail() , ... - there in different classes cant use single place add formatting function. in case tried format date in frontend seems bad practice. so way should use? there way format date/time? if programming environment using expects (or can handle) date strings in format, use mysql functions construct string needed, such date_format() . i not recommend using these functions convert date fields programming environment format in where , on , or having clauses though. one, using string comparison, (and more importantly) defeats indexing benefits might have fields.

java - Simple application with Spring+Hibernate using annotation and repository -

i want create app use spring annotation configure beans , spring jparepository don't need create queries database. moment have created entity: @entity public class executor extends abstractentity { private string company; private string responsible; private string supervisor; public executor() { } public executor(string company, string responsible, string supervisor) { this.company = company; this.responsible = responsible; this.supervisor = supervisor; } ... getters , setters... also have created repository: public interface executorrepository extends jparepository<executor, integer> { public list<executor> findbycompany(string company); public list<executor> findbyresponsible(string responsible); public list<executor> findbysupervisor(string supervisor); } the service: public class executorservice { @autowired private executorrepository repository; @tr...

php - Can't connect to my Ratchet / WebSocket Server -

i've been trying websocket server (using ratchet in php) running better part of day, feel i've tried , still no luck. when try , connect websocket server in js takes ages , times out, essentially, server accepts connection (i don't connection refused error) nothing. i'm running 14.04 ubuntu lemp stack. have found loads of nginx configurations make work, none of them worked me. strange thing works fine locally virtual machine, running lemp stack well, virtually same nginx configuration. never needed configure in nginx make websockets work. a basic ratchet example i've been using test this: http://socketo.me/docs/hello-world i'm lost, , appreciated! edit: okay, figured out needed set proxy_pass on different path root path in order work. had this: location / { proxy_pass http://localhost:1111; proxy_http_version 1.1; proxy_set_header upgrade $http_upgrade; proxy_set_header connection "upgrade"; try_files $uri $uri/ /in...

vagrant - Ansible not recognizing deb parameter for aptitude -

according http://docs.ansible.com/apt_module.html , aptitude module allows installation .deb file: # install .deb package - apt: deb=/tmp/mypackage.deb but running ansible 1.9.2 or 1.8.4 on ubuntu 14.04, config: - name: install riak apt: deb=/data/riak/riak.deb update_cache=no produces output: task: [riak | install riak] *************************************************** failed: [riak-server-1] => {"failed": true} msg: unsupported parameter module: deb the same ansible script works fine on macs running ansible 1.8.4 , 1.9. the guest in cases vagrant-created ubuntu/trusty64. entire vm creation , setup done vagrant , ansible, , we're running same vagrant/ansible files. edit: >ansible-playbook --version ansible-playbook 1.9.2 configured module search path = /usr/share/ansible >ansible --version ansible 1.9.2 configured module search path = /usr/share/ansible >locate apt.py | xargs md5sum 0058a84d0685ad1b67895fdf2da95bc5 /usr/loc...

javascript - AngularJS: Prevent displaying the last separator when repeating multiple arrays -

question : elegant way ensure last separator on each line never shown? 11|18|3|8|12|1|22|31|61| 11:18:3:8:12:1:22:31: 11,18,3,8,12,61, 1 22 31 note data originates 3 different arrays, e.g., data line 1 defined as: $scope.numbers = [11,18,3,8,12]; $scope.specialnumbers = [1,22,31]; $scope.additionalnumbers = [61]; i see more elegant/angular way, finding last <li> , remove separator using $element.find , or similar. i created little jsfiddle example demonstrate problem. thanks here complete solution, using proposed $last check (only once) in combination array.concat , supported in angular expressions , supports bindings. however, correctly repeat literals, need track $index . "<li ng-repeat='num in numbers.concat(specialnumbers,additionalnumbers) " + "track $index'>" + "<span>{{ num }}</span><span ng-if='!$last'>{{ separator }}</span>" + "</li>...

c# - How to create a sorting algorithm for this special array with linear time? -

i've got tricky question can't seem figure out. have array length n+m. the array made out of n numbers sorted, m numbers sorted. example: 2 5 8 11 15 17 19 3 4 9 10 then n=7 , m=4. i need sort whole array in o(n) timewise , not usage of arrays / lists. you need perform last stage of merge sort merge 2 sorted lists/arrays. added complication want o(1) memory usage. can done follows. if have arrays of size n + m start array i [0 .. n) , j [n .. n+m) if first array lower, leave it. if second array lower, swap second array. now first array in 2 places [n..j) [i..m) in short have 3 arrays [0..i+j) - sorted portion. [n..j) [i+j..n) first array [j..n+m) second array. as progress i+j end in 1 pass , have sorted array.

r - Using grid.arrange with multiple plots -

i plotting several ggparcoord (from ggally package) subplots 1 large plot. in general, 1 of subplots derive same data set (x), , last 1 comes different data set (y). i want each subplot different color. strangely, can work when not in loop follows (in case have 3 subplots): library(ggally) library(ggplot2) library(gridextra) set.seed(1) collist = scales::hue_pal()(3) plot_i = vector("list", length=2) x = data.frame(a=runif(100,0,1),b=runif(100,0,1),c=runif(100,0,1),d=runif(100,0,1)) x$cluster = "color" x$cluster2 = factor(x$cluster) plot_i[[1]] = ggparcoord(x, columns=1:4, groupcolumn=6, scale="globalminmax", alphalines = 0.99) + xlab("sample") + ylab("log(count)") + scale_colour_manual(values = c("color" = collist[1])) plot_i[[2]] = ggparcoord(x, columns=1:4, groupcolumn=6, scale="globalminmax", alphalines = 0.99) + xlab("sample") + ylab("log(count)") + scale_colour_manual(values = c(...

html - Django/Bootstrap password input field doesn't work on mobile -

Image
i have a django , bootstrap signup form that's working fine on desktop. on mobile, can't password field. cursor , keyboard never appear when tap on signup password fields (all other fields fine, including password field login form on same page). this how html being rendered via django's "{{ form|bootstrap }}": <div class="form-group"> <label class="control-label " for="id_password1">password</label> <div class=" "> <input class=" form-control" id="id_password1" name="password1" placeholder="password" type="password" /> </div> </div> <div class="form-group"> <label class="control-label " for="id_password2">password (again)</label> <div class=" "> <input class=" form-control" id="id_password2"...

How to read lines of a file with node.js or javascript with delay, not in non-blocking behavior? -

i reading file (300,000 lines) in node.js. want send lines in batches of 5,000 lines application (elasticsearch) store them. whenever finish reading 5,000 lines, want send them in bulk elasticsearch through api store them , keep reading rest of file , send every 5,000 line in bulk. if want use java (or other blocking language such c, c++, python, etc.) task, i'll this: int countlines = 0; string bulkstring = ""; bufferedreader br = new bufferedreader(new inputstreamreader(new fileinputstream("filepath.txt"))); while ((currentline = br.readline()) != null) { countlines++; bulkstring += currentline; if(countlines >= 5000){ //send bulkstring elasticsearch via apis countlines = 0; bulkstring = ""; } } if want same thing node.js, do: var countlines = 0; var bulkstring = ""; var instream = fs.createreadstream('filepath.txt'); var rl = readline.createinterface(instream, outstre...

javascript - Is there an Ajax call generator from webapi -

i'm writing web api c# code, i.e: public void post([frombody]list<imagemodel> images,string id) { where imagemodel is: public class imagemodel { public string filename { get; set; } public bool isapproved { get; set; } public [another object...] cropped { get; set; } } i'm looking tool generate ajax call example given code above or other webapi code. you can create pages api methods. follow below steps adding pages in web api application: from tools menu, select library package manager, , select package manager console. in package manager console window, type 1 of following commands: for c# application: install-package microsoft.aspnet.webapi.helppage visual basic application: install-package microsoft.aspnet.webapi.helppage.vb also, make sure register areas. in global.asax file, add following code application_start method, if not there already: protected void application_start() { // add code, if not present. ...

css3 - Transition Expands the Page -

i have problem regarding css3's transitioning. seen in snippet of css file below, have made footer slide whenever toggled active (i using jquery). whenever becomes active, pushes content of website upwards until finishes transition, @ point content slides down. looks page expands, should not happen because of position attribute. why happening? thanks in advance help. .footer { height: 130px; width: 100%; position: absolute; bottom: -130px; background-color: #333; transition: bottom 250ms ease-out; } .footer-active { bottom: 0; } i found solution problem. seems whenever element moves, window automatically scroll element's position. fixed problem inserting overflow: hidden html's , body's css rule.

int - Maple : integer equation without explicit delimiters -

i calculate integer in maple without explicit delimiters. example, have result of formula : int(cos(a+b*x),x=0...t)) where t referred none number. the error message : "error, unable match delimiters". is there solution ? your command has right parenthesis @ end. error message refering to.

c# - Google Drive API Could not load file or assembly 'System.Net.Http.Primitives, Version=1.5.0.0 -

this issue continues problem. see several similar posts couple of years old. have referenced google apis via nuget , am, quite frankly, in "nuget hell". first, rant, why many assemblies , references when use nuget, purpose of .net framework? example, why see copy of system.io dll in /bin folder? struggled awhile website run of code. after upgraded of assemblies 4.0, , after ran updates on local .net install running on windows 8.1, have local dev website working again. when call page on site calls google drive assembly code, error: could not load file or assembly 'system.net.http.primitives, version=1.5.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a' or 1 of dependencies. located assembly's manifest definition not match assembly reference. (exception hresult: 0x80131040) i've been round , round suggestions map assemblies post: google drive sdk system.net.http.primitives version 1.5.0.0 instead of 2.1.10.0 , either doesn't work, or not...

sql server - SQL Index - is this overlapping? -

i'm going through , removing duplicate , redundant indexes in sql database. so if have 2 identical indexes delete. if have overlapping indexes delete, example... index 1: brand, model index 2: brand, model, price i delete index 1. what indexes in same order fields? index 1: brand, model index 2: brand, price, model can safely delete index 1 or not? my guess no i'm not sure no, not safe remove that. order , position of columns important. the introduction of price column between other 2 columns ( brand , model ) issue. without index on (brand,model) , the model values "in order" under brand . price column added before model , model values no longer "in order". for example, query that's doing this: where brand = 'foo' , model >= 'bar' , model <= 'cat' can make effective use of index on (brand,model) it use index on (brand,price,model) , range scan on leading column brand . aft...

solr - SolrCloud Indexing/Querying without a Smart-Client -

i'm having bit of trouble understanding how indexing , querying work if don't have smart-client available. i'm using solrnet c#, doesn't integrate zookeeper. as basic example, let's have single collection, split 2 shards, replicated across 2 separate nodes/servers, , have standard http load-balancer in front of servers (a scenario mentioned here ). if use standard compositeid router, believe indexing work without issue , replicated both nodes zookeeper behind scenes. wouldn't need worry node received "update" command -- zookeeper handle document routing , replication automatically. however, in same scenario, zookeeper handle query routing behind scenes correctly? given i'm using built-in sharding , not custom sharding, query request load-balancer routed correct shard, or have include all known shards in "shards" parameter (see here ) make sure don't miss anything? onerous maintain number of shards grows. is seems custom sh...