Posts

Showing posts from May, 2014

Facebook SDK for Android - dialog show up and dismissed itself -

i implemented facebook button in app , after clicking dialog show gray facebook logo , dismisses itself. far know, should offer specified page. code: likeview likeview = (likeview) findviewbyid(r.id.like_view); likeview.setobjectidandtype( "https://www.facebook.com/facebookdevelopers", likeview.objecttype.page); logcat: 04-14 17:36:07.348 14147-14147/com.klangstudios.fakecall e/activitythread﹕ failed find provider info com.facebook.katana.provider.platformprovider 04-14 17:36:07.348 14147-14147/com.klangstudios.fakecall e/activitythread﹕ failed find provider info com.facebook.wakizashi.provider.platformprovider 04-14 17:36:07.349 14147-14147/com.klangstudios.fakecall e/activitythread﹕ failed find provider info com.facebook.katana.provider.platformprovider 04-14 17:36:07.350 14147-14147/com.klangstudios.fakecall e/activitythread﹕ failed find provider info com.facebook.wakizashi.provider.platformprovider

matlab - How do I binarize Fisher Vectors? -

i'm working on school project and, between many tasks, need binarize fisher vectors following written in this paper . given vl_feat library use matlab , implementd simple tutorial return fisher vectors given features. everything works fine , updated vl_fisher function raise each dimension of fisher vector power of value α ∈ [0, 1] stated in section 4.1. α = 0 can have fisher vector values {-1,0,1} ternary encosing. the second part of section 4.1 explains how turn ternary encoding equivalent binary encoding. got little lost in there, due fact i'm using library return fisher vector representation. representation consists of vector of doubles , makes trickier follow paper description. so question is, how binarize fisher vectors vl_feat library on matlab ? have binarize ternary encoding ? should compute fisher vectors in way make them more suitable following binarization ? thanks in advance time! there 2 possible solutions problem: you put hand on open sou

c# - Is There A Better Way to Add Entropy to Array of Ints? -

i needed take array of (c#) integers , randomly reassign values make values "feel" more randomized, without changing length or sum of array. array can quite large, i'm wondering if has better way this. basically, array contains values sum divided length, 1 element having remainder. using is: static int[] addentropy(int[] ia) { int elements = ia.length; int sum = ia.sum(); (int runs = 0; runs < (elements * 2); runs++) { random rnd = new random(int.parse(guid.newguid().tostring().substring(0, 8), system.globalization.numberstyles.hexnumber)); int rndi = rnd.next(0, (sum / elements)); int rnde1 = rnd.next(0, elements); int rnde2 = rnd.next(0, elements); if (rndi < 1 ) rndi = 1; if (ia[rnde1] > (rndi + 2)) { ia[rnde1] = ia[rnde1] - rndi; ia[rnde2] = ia[rnde2] + rndi; } }

php - python overlapping values from serial -

i have arduino connected pi via usb , sending readings dht sensor using simple program below (this bit works expected in arduino serial monitor): int chk = dht.read11(dht_pin); serial.println(dht.temperature,1); delay(2000); i have python program should data serial port: import serial conn = serial.serial('/dev/ttyacm0',9600) temp = conn.readline() print temp this script called in php using $temp = shell_exec('python temp.py 2>&1'); works fine values serial wrong. the expected output should 23.0 when refresh page (or run python script in terminal) values 2323.0 , 23.023.0 , 22..0 , 2 . these change time , come out in desired format. it seems if data serial overlapping, though serial.println() function puts on new line. if tell me how correct appreciated. try print repr(temp) ... or print temp.strip()+" . " i stronly suspect when read get "23.0\r" \r returns cursor start of line if print "23.0\rb&

R: compare the next two values in a vector with each other (without looping if possible) -

i have vector this: 10 7 7 10 7 10 7 10 10 7 10 10 7 7 10 10 7 10 7 7 10 7 10 i want compare entries of vector in pairs: e.g. first entry second, third fourth until in pair have 2 equal entries. in example 2 equal values occur first time in sixth pair or in other words 11th , 12th values equal. important want have index of 11th row , continue comparison between 12th , 13th row. is there way (i prefer without looping)? edit: didn't explain myself clear enough. when pair has equal values delete first entry of these 2 values. indices of pairs not known start. in above example, desired output be: 10 7 7 10 7 10 7 10 10 7 10 7 7 10 10 7 10 7 7 10 7 10 and index of row has been deleted: 11 in case 1 row had deleted pairs consist of 7 , 10. based on edited version of question, it's clear need sort of looping function, because decisions on previous indices affect decisions on subsequent indices. efficient way can think populate logical

node.js - sequelize.js how to associate through a 3rd table? -

i have 3 models, poll, category, , poll_to_category. poll.server.model.js module.exports = function(sequelize, datatypes) { var poll = sequelize.define('poll', { poll_id:{type:datatypes.integer,primarykey:true} }, { associate: function(models){ poll.hasone(models.caetgory, {through:models.polltocategory) } } ); return poll; }; category.server.model.js module.exports = function(sequelize, datatypes) { var category = sequelize.define('category', { category_id:{type:datatypes.integer, primarykey:true} }, { associate: function(models){ category.hasmany(models.poll, {through:models.polltocategory) } } ); return category; }; poll_to_category.server.model.js module.exports = function(sequelize, datatypes) { var polltocategory = sequelize.define('polltocategory', {

numpy - Failure to install HTSeq Python package on Ubuntu 14.04 -

i need use program called htseq. there detailed instructions installation, new python user must have messed somewhere. i first tried install under windows xp kept getting error below, after installing vcredist_x86.exe : >>> import htseq traceback (most recent call last): file "<stdin>", line 1, in <module> file "c:\python27\lib\site-packages\htseq\__init__.py", line 9, in <module> _htseq import * importerror: dll load failed: le module specifie est introuvable. since prefer unix environment, gave windows , installed ubuntu 14.04, , tried again. in terminal, entered: sudo apt-get install build-essential python2.7-dev python-numpy python-matplotlib i obtained series of errors because proxy wasn't set properly. since didn't work, decided download python-2.7.9.tgz , install with .configure make sudo make install meanwhile discovered proxy set wrong , edited apt.conf accordingly. repeated command sudo apt-get i

java - Rotate image without clear background -

i have read lot of articles of drawing images, cant work when need keep background. i'm trying rotate image on image after click on jbutton. background image generated on jpanel by: public void paintcomponent(graphics g){ int index = 0; graphics2d g2 = (graphics2d) g; super.paintcomponent(g); try { image = imageio.read(url1); image2 = imageio.read(url2); image3 = imageio.read(url3); } catch (ioexception e) { } g.drawimage(image, 0, 0, null); g.drawimage(image3, 0, 0, null); if(scaledrawnflag == 0){ for(index = 0; index < 60; index ++){ tx = affinetransform.getrotateinstance(math.toradians(6*index), this.getheight()/2, this.getwidth()/2); op = new affinetransformop(tx, affinetransformop.type_bilinear); g.drawimage(op.filter(image3, null), 0, 0, null); } scaledrawnflag = 1; } g.drawimage(image2, 0, 0, null); } which jpanel na

vba - Best Way to Create Import Files with Excel? -

not sure best way describe situation is, i'll best. trying create import file database system using excel. here have example: 1) names in column 2) accounts in column (accounts 1-3) 3) amounts (an amount each combo, ex: name1, account1, name 1, account2) so want easy way (possibly vba?) create import file similar below: (columns a, b, c) name#1, account#1, amount#1 name#1, account#2, amount#2 name#1, account#3, amount#3 name#2, account#1, amount#4 name#2, account#2, amount#5 etc.. etc.. is there anyway without having ton of copying , pasting? tried pivot tables, doesn't seem work situation sample data: names | accounts | amounts david 11230 $32.50 marry 11240 $2.00 jerry 54500 $990.00 64000 $500.00 $300.00 $600.00 $330.55 $500.00 $45.00

javascript - Modify variable value inside a jquery-modal event -

i'm trying modify value of variable inside before_close event, no luck far... i'm using kylefox's jquery-modal html: <div id="other" class="modal" style="display:none;"> <label for="form_othername" class="label-important required">(*) enter 'other' name </label> <input type="text" required="required" name="form[othername]" class="round default-width-input" id="simple-input"> <a href="#close" rel="modal:close">close window</a></div> js: $('#form_submit').on('click', function (e) { e.preventdefault(); var page = $("#carousel").rcarousel("getcurrentpage"); var employeeid = $("input[name='form[employeeid]']").val(); var temp = ''; if (page == 4) { $('#other').modal();

c# - Reading Json output from Odata services -

i trying read output odata services in json format. getting error message "the response payload not valid response payload. please make sure top level element valid atom or json element or belongs ' http://schemas.microsoft.com/ado/2007/08/dataservices ' namespace". northwindentities dc = new northwindentities(new uri("http://services.odata.org/v3/northwind/northwind.svc/"),dataserviceprotocolversion.v3); dc.format.usejson(new edmmodel()); dataservicequery<product> query = (dataservicequery<product>)from o in dc.products o.unitprice > 0 select o; query.execute(); {"odata.metadata":"http://services.odata.org/v3/northwind/northwind.svc/$metadata#products","value":[{"productid":24,"productname":"guaran\u00e1 fant\u00e1stica","supplierid":10,"categoryid":1,"quantityperunit":"12 - 355 ml cans","

java - Why does my programme runs sometimes, but take forever to run some other times? -

i trying make program generate battleship board. runs , generates board sometimes, @ other times keeps"run"ing. using netbeans on mac, if helpful. (you might notice, did not invoke methods throughout code, because programme not completed yet, it's halfway through) here programme: class battlehipgame: public class battleshipgame { public static void main(string[] args) { gamemaker.shipmaker(); } } class gamemaker: public class gamemaker { private static int numberofships; public static void numberofshipssetter(int shipnumber) { if (shipnumber<=5) { numberofships = shipnumber; gamemaker.shipmaker(); } } public static void shipmaker() { ship aircraftcarrier = new ship(); ship battleship = new ship(); ship cruiser = new ship(); ship dest1 = new ship(); ship dest2 = new ship(); aircraftcarrier.sizesetter(5); battleship.sizesetter(4); cruiser.sizesetter(3); dest1.sizesetter(2); dest2.sizesetter(2);

ruby - Rails 4 Devise, with after_sign_in_path_for(resource) always redirect to Show action of Model -

i'm stuck method after_sign_in_path_for of devise, thing... have 2 models users , adminusers i'm using active_admin gem my routes.rb file, looks this: devise_for :admin_users, activeadmin::devise.config activeadmin.routes(self) scope "(:locale)", locale: /es|en/ devise_for :users, path_names: { sign_in: 'login', sign_out: 'logout', password: 'password', confirmation: 'confirmation', unlock: 'unlock', registration: 'registration', sign_up: 'sign_up' } devise_scope :user "login", to: "devise/sessions#new" end 'dashboard/index' end ok... in application_controller.rb, tryed codes: def after_sign_in_path_for(resource) case resource when adminuser #admin_root_path '/admin/dashboard' puts'in admin_root_path'

retrofit - Rx Network Polling & Immediately getting first result -

i want poll service application, can refresh data periodically (~15 minutes). however, same data needed on startup. i'm using retrofit & rxandroid. i can network data (or whenever call returns, rather), , have been working on doing repeating call this: return mnetworker.getinitializationproperites(deviceid) .observeon(schedulers.io()) // database i/o need done .subscribeon(schedulers.io()) .delay(20l, timeunit.seconds) // 20 seconds testing .repeat() .subscribe(onnext, rxerrorhandler.handle(), oncomplete); this method (and others using timer , interval ) time interval correct, deliver result late. particularly, in above, know webservice hit immediately, yet waits 20 seconds emit result. is there way can combine ideas of getting first result asap & schedule repeat indefinitely? other thought create 2 different observables , subscribe them separately, seems i'm missing something. instead

python - Strip carriage returns / line feeds from database records before they are written to csv -

i have following code reads lines database , writes matching results csv file. problem running there carriage returns / line feeds in of fields in different rows cause csv file unusable because there bogus rows. for example, here sample of happens when there carriage returns / line feeds in sql data , affect has on file. ... sample content of messed file: field1|field2|field3|field4|field5 value 1|value 2|value 3|value 4|value 5 value 1|value 2|value 3|value 4|value 5 value 1|value 2|val ue 3|value 4|value 5 value 1|value 2|value 3|va lue 4|value 5 here code writes results of sql query output file. trying strip results have carriage returns / line feeds. ''' while loop read each row. if compares row[2] (updated) against last record processed ''' latest = params #declare 'latest' variable consumption while loop while row: if row[2] > latest: latest = row[2] logger.debug("[%s] - writing

javascript - Populating a form with names from a .txt file -

i trying populate dropdown list bunch of names stored in .txt in same directory html code. each name on new line of file and"names" id of dropdown store names. upon loading page, list not populated @ all. guidance awesome. <script type = "text/javascript"> window.onload = function () { var select = document.getelementbyid("names"); var textfile = "/names.txt"; jquery.get(textfile, function(textfiledata) { var eachlineintextfile = textfiledata.responsetext.split(","); (var = 0, len = eachlineintextfile.length; < len; i++) { var option = document.createelement('option'); option.text = option.value = eachlineintextfile[i]; select.add(option, 0); }; }; }; </script> thanks! it looks major issue needed better version of jquery. thank help! <script type = "text/javascript"> window.onload = func

video - Can play .ts files in Samsung android phones -

i'm trying play .ts files server.it playing without problem in pipo tablet not samsung devices.using following code(using videoview) tried play .ts files videoview vidview = (videoview)findviewbyid(r.id.myvideo); string vidaddress="http://.../test/bf4_mp_launch_trailer_60fps_esrb-145117-10042015.ts"; uri viduri = uri.parse(vidaddress); vidview.setvideouri(viduri); vidview.start(); i think problem in samsung device.how can fix problem?.is there way attach other player(that can play devices) application or there other class or interface can use app.please need quick help.

ios - Strong Class Objects inside for loop is not retaining in ARC -

i have manual reference count project, few classes im converting arc removing retain,release & etc , setting compiler flag “-fobjc-arc” 2 arc(-fobjc-arc) enabled view controller classes, classa , classb. i allocating , initialising objects of classb inside classa within loop achieve functionality, code snippet below, @interface classa () @property (strong, nonatomic) classb *classbobj; @end @implementation classa - (void)createclassbview { (int count = 0; count <= [dataobject count]; count++) //if count more 1 not retaining previous classbobj { classbobj = [[classb alloc] init]; //arc keeping 1 object reference of class need retain iterated objects [self.scrollview addsubview:classbobj withframe:myframe];//only 1 view getting added subview if control comes here more once } } @end the above code works fine me in non-arc(mrc) fails work when arc enabled. not retaining classb objects if strong, only 1 object i.e; last iterated classb ob

c# - Disable autocompletion on windows tablet keyboard for textbox control in a Windows 8.1 store app? -

i stop windows 8.1 store application's tablet keyboard providing autocompletion option when using textbox is there way set this? if talking suggestions need add xaml of textbox istextpredictionenabled="false" giving result : <textbox x:name="txtexample" style="{staticresource textboxstyles}" istextpredictionenabled="false"/>

java - Flush Universal Image Loader cache -

i'm using volley singleton load images private volleysingleton(){ mrequestqueue = volley.newrequestqueue(volleyapplication.getappcontext()); mimageloader = new imageloader(this.mrequestqueue, new imageloader.imagecache() { private final lrucache<string, bitmap> mcache = new lrucache<string, bitmap>(10); public void putbitmap(string url, bitmap bitmap) { mcache.put(url, bitmap); } public bitmap getbitmap(string url) { return mcache.get(url); } }); } i need flush cache update imageview when photo changed. i've read memorycacheutils here can't seem implment in code, can use memorycacheutils in code? if not there way flush cache in imageloader? edit exposing lrucache private volleysingleton(){ mrequestqueue = volley.newrequestqueue(volleyapplication.getappcontext()); mimageloader = new imageloader(this.mrequest

ssl - Spring-Boot client authentication configuration. -

first off, i'm new spring-boot , ssl in general, i've spent several days researching , trying simple spring-boot application configured client authentication. i've set connector so: private connector createsslconnector() { connector connector = new connector("org.apache.coyote.http11.http11nioprotocol"); http11nioprotocol protocol = (http11nioprotocol) connector.getprotocolhandler(); try { file keystore = getkeystorefile(); file truststore = keystore; connector.setscheme("https"); connector.setsecure(true); connector.setport(sslport); protocol.setsslenabled(true); protocol.setkeystorefile(keystore.getabsolutepath()); protocol.setkeystorepass("changeit"); protocol.settruststorefile(truststore.getabsolutepath()); protocol.settruststorepass("changeit"); protocol.setkeyalias("apitester"); protocol.setclientauth(&qu

android - How do I send webview content body via email? -

currently in app, using webview html content displayed(which coming via assets folder expected,just clarify). however, have integrated send via email functionality , see subject body , title null instead of content in focus in selected email of choice. (say pick gmail when select send via email option. see content body null instead of content in webview).any 1 has done or has idea, how go same? here's code: emailutils class: public class emailutils { public static string feedback_email = "android.feedback@mycompany.com"; public static void sharenewsviaemail(final fragment fragment, final string emailsubject, final string emailbody){ sharenewsviaemailex(fragment.getactivity(), emailsubject, emailbody); } public static void sharenewsviaemailex(final context context, final string emailsubject, final string emailbody){ final intent emailintent = new intent(intent.action_send); emailintent.settype("text/html");

rename - renaming files to a new name folder using batch script -

have tried rename files in folder script, seems not work @echo off setlocal enabledelayedexpansion set old=*.txt set new="c:\path file contains listed names" /f "tokens=*" %%f in ('dir /b *.txt') ( set newname=%%f set newname=!newname:%old%=%new%! move "%%f" "!newname!" ) what trying achieve script should pick set of listed names in file , rename each file in specified folder accordingly first said want rename each file "accordingly" (accordingly what?), , later in comment said try rename files "with set of listed names in file". point cause several additional questions: have file 1 name in each line? must first file listed dir /b *.txt match first name listed in file, , on? other option? (why use move command "rename"?). because objective not clear, can not said if code right or not. however, code does. suppose first file "firstfile.txt"; section: set newname=%%f s

struts2 - Pass table row values to struts action class which uses display: column tag -

i have struts table displays data using <display:column> tag.it has many rows , checkbox each row. 1 column need show text fields did using <display:column><input type ="text"..../></display:column> . problem need submit value of text fields rows have been selected checking check box. submit button outside display tag. can please suggest how achieve this.

debugging - Debug django app running inside docker image, using pycharm debugger -

my app running inside docker image (my development team never install software in machines, docker images have dependencies). i need debug using pycharm debugger, how connect pycharm's debugger docker image's python? one possible method treat docker container remote host , use remote debugging: https://www.jetbrains.com/pycharm/help/remote-debugging.html

coldfusion - finding a way to replace images to proper url's -

i getting contents website: images coming as: /images/abc.gif, doing is attaching website url , giving me network error: here example of this "networkerror: 404 not found - https://devl.example.com/segment/images/headcont.gif" headcont.gif "networkerror: 404 not found - https://devl.example.com/segment/images/newdetails.gif" newdetails.gif "networkerror: 404 not found - https://devl.example.com/segment/images/headsurr.gif" i using code replace of images <cfset lnk = replace(lnk,'"/images/sym_s_up.gif"','"http://thewebsite.com/images/sym_s_up.gif"','all')> but above doing image specify, how can write kind of single code searches /images , replace them url irrespective of image name have specify remove actual image name , search consistent string <cfset lnk = replace(lnk,'/images/','http://thewebsite.com/images/','all')> you take approach of replacing <

class - Linked List Operations C++ -

i've got linked list data base using templates compiles fine , lets me print out list of states , lets me search person , print persons data (since these methods work, left them out below save space). below have print_people_in_state method, need able (given user input of state) print out info on people particular state. right when run it, nothing happens. how can fix this? if want run code here link file named data.txt ( http://rabbit.eng.miami.edu/class/een118/labs/152/dbfile1.txt ) #include <iostream> #include <string> #include <string.h> #include <fstream> using namespace std; struct person { int dob,ss_number; string fname, lname,state; person() { } person(int a, int b, string c, string d, string e) {dob=a; ss_number=b; fname=c; lname=d; state=e;} }; struct state { string sname; person*p; state() {} state(string a) {sname=a;} }; template<typename t>struct link { t*data; lin

python - pip install: Please check the permissions and owner of that directory -

while installing pip , python have ran says: the directory '/users/parthenon/library/logs/pi' or parent directory not owned current user , debug log has been disabled. please check permissions , owner of directory. if executing pip sudo, may want -h flag. because have install using sudo . i had python , handful of libraries installed on mac, i'm running yosemite. had clean wipe , reinstall of os. i'm getting prompt , i'm having trouble figuring out how change it before command line parthenon$ it's philips-mbp:~ parthenon$ i sole owner of computer , account on it. seems problem when upgrading python 3.4, nothing seems in right place, virtualenv isn't going expect to, etc. i saw change on mac when went running 'pip' 'sudo pip' adding '-h' sudo causes message go away me. e.g. sudo -h pip install foo 'man sudo' tells me '-h' causes sudo set $home target users (root in case). so appe

ruby - How do I "group" sets in Rails' jbuilder? -

i've got set of "player" , "team" models in ror app (a json api) representing sports team, "roster" model acting middleman in many-to-many relationship. in "roster" view, i'm trying 'group' players team jbuilder, can't figure out proper code this. my current jbuilder view code (index.json.jbuilder) looks this: json.rosters @rosters |roster| json.team_id roster.team.team_id json.team_name roster.team.team_name json.player_id roster.player.player_id json.first_name roster.player.first_name json.last_name roster.player.last_name end this outputs following json: { "rosters": [ { "team_id": "1", "team_name": "dallas mavericks", "player_id": "1", "first_name": "dirk", "last_name": "nowitzki" },

php - Twig - Loop returns only 1 result -

i'm trying make loop in php while using twig , inside loop, creating parameter contains record database query. the problem when use parameter in html file, return 1 record while loop, if there 3 or 4 or more.. this php code have: public function getwidgetsbyname($name) { global $params; $get = $this->db->query("select * profile_items category = 'widget' , username = '". $name ."'"); if($get) { while($key = $get->fetch()) { $params["profile_widget_name"] = $key['name']; } } } and html parameter in html twig rendered file: {{ profile_widget_name }} the paremeters rendered how supposed rendered: echo $twig->render('app/views/'. $_request['p'] .'.html', $params); and yes $params variable array, in config file first gets used $params = array("...

Dart: Prevent polymer transformer from changing my hrefs -

i have polymer component html file contains anchor element <a href="foo"> . component imported html import. polymer transformer (or maybe web_components transformer) inline import, , when doing rewrite anchor element <a href=/path/where/the/html/file/exists/foo"> . now want use anchor tag client-side routing. have route set "foo" when transformer has rewritten href route not work. want transformer leave href alone , keep original path. tried using _href gives error should used bindings. guess question if there way instruct transformer leave hrefs alone? this might work: <a _href="{{'foo'}}">

eclipse - Windows C++ __imp reference error when building -

environment: windows server 2012 r2 eclipse luna cygwin mingw i building c++ program queries against active directory using ldap (similar msdn page ). have following code sample program: #include<iostream> #include<windows.h> #include<winldap.h> using namespace std; int main() { string ldapserverurl = "192.168.10.29"; int ldapserverport = 389; ldap* ldapsession = ldap_init(&ldapserverurl[0], ldapserverport); return 0; } when try build sample mingw toolchain in eclipse, build fails , line ldap_init() underlined in red. when hover mouse on error, says "undefined reference _imp__ldap_inita() ." when try cygwin toolchain, yields similar error (with different underscore arrangement). when try compile via cmd ( cd directory g++ main.cpp , cygwin in path), error: /cygdrive/c/users/someuser/appdata/local/temp/cczczwy3.o:main.cpp:(.text+0x68): undefined reference `__imp_ldap_init' /cygdrive/c/users/someu

mvp - How can I add Ractive instances to a list? in a parent Ractive instance? -

i have ractive instance (or component - either) , want add list in ractive instance. this: var listitemone = new ractive({ data: { key: "hello" } }); var listitemtwo = new ractive({ data: { key: "world" } }); var ractive = new ractive({ el: "#output", template: "#template", data: { greeting: 'hi', name: 'there', listitems: [ listitemone, listitemtwo ] } }); template: <p>{{greeting}} {{name}}!</p> <ul> {{#listitems}} <li>{{key}}</li> {{/listitems}} </ul> jsbin or using method: var ractive = new ractive({ el: "#output", template: "#template", data: { greeting: 'hi', name: 'there', listitems: [] }, addlistitem: function(listitem){ this.get('listitems').push(listitem); } }); ractive.addlistitem(listitemone); ractive.addlistitem(listitemtwo); jsbin is possib

angularjs change element based on dropdown select -

using angularjs i have 3 select dropdowns , button json list focus select dropdown looks this: <select id='sort' ng-model='sort'> <option value='1'>id</option> <option value='2'>departmentname</option> <option value='3'>number of employees</option> </select> <button ng-click="getinfo()">get info</button> the table looks this <table> <tr> <td>{{ depid }}</td> <td>{{ depname }}</span></td> <td>{{ depemp }}</td></tr> in controller have: $scope.depid = "department id"; $scope.depname = "departmentname"; $scope.depemp = "number of employees"; $scope.getinfo = function() { var url = ""; ... } based on selection "sort" want sort column bold/strong or uppercase. how do this? you can use ng-class on td elements: <tr> <

python - PYODBC - Too Few Parameters -

i have following code: late_students = cursor.execute(''' select student.forename, student.surname, format(event_date_time,"long time") time_of_event events, student format(event_date_time,"short date") = date() , events.rfid = student.rfid , events.in_or_out = ? , format(event_date_time,"long time")>#08:40:00#''','in') rows = cursor.fetchall() print(rows) it's simple , have many in program it, when run program, following error: traceback (most recent call last): file "...coursework system 1.8.py", line 104, in <module> , format(event_date_time,"long time")>#08:40:00#''','in') pyodbc.error: ('07002', '[07002] [microsoft][odbc microsoft access driver] few parameters. expected 3. (-3010) (sqlexecdirectw)') when add parameters, following error telling me have many parameters: traceback (m

symfony - PHP Fatal error: Class 'Doctrine\\DBAL\\Platforms\\MySqlPlatform' not found -

i have symfony 2 project. running fine 2 different ubuntu systems. have deployed openshift instance , error: php fatal error: class 'doctrine\\dbal\\platforms\\mysqlplatform' not found in /var/lib/openshift/552ba6ecfcf93371e600007a/app-root/runtime/repo/vendor/doctrine/dbal/lib/doctrine/dbal/driver/pdomysql/driver.php on line 80 i have no idea error. ideas? please check file permissions. executable? exist @ all?

hive - Auto execution of "validate metadata" in Impala -

i have tableau connected cloudera impala data. table reading metastore keeps on updating so, when want viz update (pressing f5) have go impala in cloudera , execute "invalidate metadata" before refreshing viz. know can done using connection hive server 2, takes long time execute query. question there anyway automatically execute "validate metadata" , "refresh" queries in impala cloudera? thanks, amr unfortunately impala not offer mechanism automatically update metadata yet. working on future, though haven't committed such functionality particular release yet. in meantime, there may things can make easier. firstly, how table being updated? there new data files? if so, can run refresh faster. also, sure invalidate/refresh specific table, e.g. refresh my_table . see documentation [invalidate metadata][1] , refresh more information. is there etl process in background? users modify workflow issue refresh command impala after updating

new to selenium-webdriver, switching from one window to another -

currently have started use selenium 2.0/web-driver automation testing company work for. currently have 20 tests developed testing, when run tests open new browser window each test. unfortunately though need new user registration/login info executed in first test used in rest of tests since i'm testing webstore/shopping cart. my question is, there way either stop having new browser windows opening or close window , place focus first window new user registered , logged in? through doing research before writing question here found out driver.getwindowhandles(); which have being run in registration test case , driver.switchto().window("handle"); have being run in second test case , thought should have put focus first window. i'm using driver.close(); close additional windows being created, prefer don't open in first place. if understand question correct need - add procedure @before annotation , inside procedure open driver. add procedu

Is this correct usage of lambdas in Java 8? -

final list<string> userids = request.getuserids(); final list<string> keys = userids.stream().map(p -> { return removeprefix(p); }).collect(collectors.tolist()); basically, every key in list of userids contains prefix "_user" want remove every key. so, invoking removeprefix function on each item of list , storing result in list called "keys" yes it's fine although make little shorter , more readable method reference , static import: final list<string> keys = userids.stream() .map(this::removeprefix) .collect(tolist());

python - Can I control the mouse inside a virtual machine programatically without hijacking the cursor on my real machine? -

i trying automate html5 application checks @ location of real cursor before accepts click. tried using selenium in python automate clicks @ various points on canvas. buttons on canvas change color way supposed when mouse on them when selenium tries click on them, click accepted if have real mouse on same button @ time selenium trying click (i don't have click manually, hover mouse). so, thinking of using sikuli or autopy instead (both of have used great success in past). trouble is, both of these things move real cursor around, , don't want that. i wonder if possible disable mouse integration virtual machine in virtualbox, , use 1 of these tools move virtual machine's cursor, , automate applications inside virtual machine without affecting real cursor. know how this, or if possible? i have no experience selenium, maybe can make sikuli , selenium coorperate each other. 1 has wait() until parameter set. have 1 parameter, , when option "a" sikuli

Using Ionic with Breeze JS -

is possible use breezejs ionic framework(mibile), planing develop mobile application using ionic , targeting using ionic love if ionic support use of breezejs, if have idea, please share experience. thanks.` breezejs works angular, there angular adapter breeze provides it. since ionic built on angular, ionic work breeze. built complex ionic app makes heavy use of breezejs caching data work offline.

c++ - cvCreateMat memory leak (OpenCV) -

alright; i'm finding odd memory leak when attempting use cvcreatemat make room soon-to-be-filled mat. below attempting do; adaptivethreshold didn't when put 3-channel image in, wanted split separate channels. works! every time go through particular function gain ~3mb of memory. since function expected run few hundred times, becomes rather noticeable problem. so here's code: void adaptivecolorthreshold(mat *inputshot, int adaptivemethod, int blocksize, int csubtraction) { mat newinputshot = (*inputshot).clone(); mat inputblue = cvcreatemat(newinputshot.rows, newinputshot.cols, cv_8uc1); mat inputgreen = cvcreatemat(newinputshot.rows, newinputshot.cols, cv_8uc1); mat inputred = cvcreatemat(newinputshot.rows, newinputshot.cols, cv_8uc1); for(int rows = 0; rows < newinputshot.rows; rows++) { for(int cols = 0; cols < newinputshot.cols; cols++) { inputblue.data[inputblue.step[0]*rows + inputblue.step[1]*cols] = n