Posts

Showing posts from March, 2010

ios - AV Player observer in Swift - message was received but not handled -

i'm trying implement observer av player in pure swift. i'm getting error: message received not handled. because object argument in constructor of observer i'm using nil? i've placed example code below. thanks player.addobserver(self, forkeypath: "status", options:nskeyvalueobservingoptions(), context: nil) player.addobserver(self, forkeypath: "playbackbufferempty", options:nskeyvalueobservingoptions(), context: nil) player.addobserver(self, forkeypath: "playbacklikelytokeepup", options:nskeyvalueobservingoptions(), context: nil) player.addobserver(self, forkeypath: "loadedtimeranges", options: nskeyvalueobservingoptions(), context: nil) private func deallocobservers(player: avplayer) { player.removeobserver(self, forkeypath: "status") player.removeobserver(self, forkeypath: "playbackbufferempty") player.removeobserver(self, forkeypath: "playbacklikelytokeepup"...

Changing variable names within a loop in MATLAB -

what doing wrong here (matlab)? i want obtain lines ones below: syms b d m l expr11 = -m-b*l*(b-m-d); jqdfe11 = simplify(expr11); with following loop: for k=1:8 lhs=['jqdfe1',num2str(k)]; rhs=['expr1',num2str(k)]; eval('lhs = simplify(rhs)'); end but getting error: error using eval: undefined function 'simplify' input arguments of type 'char' if want working. both lhs , rhs strings whereas in code, interpreted variables. want: eval([lhs ' = simplify(' rhs ')']); lhs , rhs names variables stored strings, , want use actual strings when building string eval . btw, don't know why doing you're doing, consider not using eval . it's bad practice. see post loren shure mathworks on why shouldn't use it: http://blogs.mathworks.com/loren/2005/12/28/evading-eval/

javascript - IE 11 iframe redirect without history (back button) -

i have iframe use display pdf files. ui application on dev.domain.com location, while pdf files hosted on devapi.domain.com. main issue want able change pdf file being viewed, don't want browser button influence content of iframe. in google chrome, works wonderfully: $('#preview-frame')[0].contentwindow.location.replace(url); i when need change pdf, , , good. in ie11, however, access denied errors when running above change pdfs. suggestions on how change content of iframe without influencing button behavior on major browsers?

java - Maven resource filtering not working from 'resources' folder -

i having trouble maven's resource filtering. directory structure is: src |-main |-filters |-java |-resources |-webapp the pom contains following: <build> <filters> <filter>src/main/filters/${environment}/filter.properties</filter> </filters> <resources> <resource> <directory>src/main/resources</directory> <filtering>true</filtering> </resource> </resources> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-war-plugin</artifactid> <version>2.6</version> <configuration> <filteringdeploymentdescriptors>true</filteringdeploymentdescriptors> <failonmissingwebxml>false</failonmissingwebxml> </configuration> </plugin> ... </build...

java - providing granular data for data intensive web service -

i developing webservice data intensive. unfortunately of data returned not needed calls, might needed call. an overly simplified response might below: response : { a, b, c, d : { x : { } y, z } } i want provide flexibility callers such can request specific data big object. thought of achieving exposing enums, , taking list of enum input. each enum map field in response. example if caller needs , d, can specify passing list of enums immutablelist.of(get_enum_a, get_enum_d) , @ web service end can compute , d. questions: there better way of taking input (other enum) of data needed caller? i give control user on more fine grained data, eg. can specify part of d needed. get_enum_d_x. at server end, thinking of implementing using command pattern, having command each enum , executing if corresponding enum present in list. here d facade. if granular data requested don't use facade instead use command x. issue c...

opencv - Segment character of complicate background -

Image
in optical character recognition (ocr), facing problem of segmenting characters on noisy/complicated background image. have tried 1 easiest image among 3 (as think) attached here. also, have tried contrast enhancement (histogram equalization) since images low contrast. however, segmented characters still have poor quality: connected character, unfilled regions , can not work other images due fixed thresholds. scalar m = mean(src); ( y = 0; y < src.rows; y++ ) { ( x = 0; x < src.cols; x ++ ) { if ( filtered_image.at<uchar>(y,x) > 160 ) { filtered_image.at<uchar>(y, x) = (uchar) m(0); } } } gaussianblur(filtered_image, filtered_image, size(5, 5), 1, 1, 4); imshow("filtered", filtered_image); hardthresholding(filtered_image, filtered_image, 70); imshow("threshold", filtered_image); remove bright spots assigning image average value p...

how to put some text on image on particular area in php using GD -

i want generate online certificates using gd in php, certificate image format ready me. want put candidate name , other details on image text in particular area. have image file in jpg, gif , png format how create watermark on existing image.. //------------------------------------------------------------------------- $wwidth = 280; // set watermark image width $wheight = 50; // set watermark image height // create watermark image $watermark = imagecreate( $wwidth, $wheight ); $black = imagecolorallocate( $watermark, 0, 0, 0 ); // define colour use $white = imagecolorallocate( $watermark, 255, 255, 255 ); // define colour use // create rectangle , fill white imagefilledrectangle( $watermark, 0, 0, $wwidth, $wheight, $white ); // make white transparent #imagecolortransparent ( $watermark, $white ); $font = 'fonts/arial.ttf'; // store path font file $wtext = "(c) chris maggs ".date('y'); // set watermark text $wsize = ...

matlab - How to extract elements in an array that have multiple entries? -

i have large vector contains monotonically increasing data or duplicate, looking this: data = [0 1.1 2.2 3.3 4.4 4.4 4.4 4.4 5.5 6.6 6.6 6.6 7.7]; in data set, i'm interested in duplicate entries (in case, 4.4 , 6.6 ). have sorta clunky solution extract these values, feel matlab should have one-liner solution extract result like result = [4.4 6.6]; the combination of unique , diff enough, find not necessary. out = unique(data(~diff(data)))

python - How do I work with large, memory hungry numpy array? -

i have program creates array: list1 = zeros((x, y), dtype=complex_) currently using x = 500 , y = 1000000 . initialize first column of list formula. subsequent columns calculate own values based on preceding column. after list filled, display multidimensional array using imshow() . the size of each value (item) in list 24 bytes. sample value code is: 4.63829355451e-32 when run code y = 10000000 , takes ram , system stops run. how solve problem? there way save ram while still being able process list using imshow() easily? also, how large list can imshow() display? there's no way solve problem (in general way). computers ( as commonly understood ) have limited amount of ram, , require elements in ram in order operate on them. an complex128 array size of 10000000x500 require around 74gib store. you'll need somehow reduce amount of data you're processing if hope use regular computer (as opposed supercomputer ). a common technique partitioning ...

vb.net - Why this sub is valid? Why i can pass each Type (String, Interface, Int) to a sub without compiler error as parameter -

public class mainwindow private sub mainwindow_loaded(sender object, e routedeventargs) handles me.loaded me.x(1) end sub public sub x(byval x string) messagebox.show(x) end sub end class if want interface in sub x example public sub x(byval iperson) accept every type without error. in vs2013 under debug/debugging/projects , solutions/vb defaults option turn option strict on.

python - How can I Improve this Code, using While Loop? -

create function addnumbers(x) takes number argument , adds integers between 1 , number (inclusive) , returns total number. examples : addnumbers(10) 55 addnumbers(1) 1 so question, have done using while loop , , worked fine. not satisfied code, did problem using loop , that's okay me, want know best way improve dis code using while loop. def addnumbers(num): total = 1 = 1 while < num: += 1 total += return total print addnumbers(10) and here loop answer : def addnumbers(num): my_list = list(range(num+1) ) in my_list: my_list.append(i) return sum(my_list) usually isn't place such questions, anyway.. can use sum() , range() . range() return list of numbers 0 n , sum will, well, sum it. def sumnumbers(n): return sum(range(n+1)) edit : , using while loop: def sumnumbers(n): = 0 sum = 0 while <= n: sum += += 1 return sum

c# - Concatenate binaries then convert to int -

string middlepart = "1111"; string leftpart = "0000"; string rightpart = "0000"; i want concatenate 3 of these make 000011110000 , , convert binary int . the code below not work because number way big. int maskingval = convert.tobyte((leftpart+middlepart+rightpart), 2); is there way convert.tobyte on each individual part of binary int, , concatenate binary equivalent correct int value of 000011110000 . thank you i don't know why not do var maskingval = convert.toint16((leftpart + middlepart + rightpart), 2); but can way too byte middlepart = convert.tobyte("1111", 2); byte leftpart = convert.tobyte("0000",2); byte rightpart = convert.tobyte("0000",2); var maskingval = leftpart << 8 | middlepart << 4 | rightpart;

python - Chameleon template engine: loop with index -

i practicing chameleon template engine bootstrap . layout using fluid layout . in listing part of layout, using structure like <div class="row-fluid"> <div class="span4">******</div> <div class="span4">******</div> <div class="span4">******</div> </div> <div class="row-fluid"> <div class="span4">******</div> <div class="span4">******</div> <div class="span4">******</div> </div> each row-fluid div contains 3 span4 div . tal:repeat in chameleon repeats elements in list. if have 6 element in list, generates <div class="row-fluid"> <div class="span4">******</div> <div class="span4">******</div> <div class="span4">******</div> <div class="span4">******</div...

c# - Can someone help me understand the following line? -

public team getteambyid(int id) { team team = ctx.teams.include("login").include("people").include("school").where(x => x.id == id && this.schoolslist.contains(x.school_id)).firstordefault(); /// } ctx dataaccess obbject , schoolslist dataaccess property of type list . understsand part says x => x.id == id , part this.schoolslist.contains(x.school_id) makes no sense me. know x => x.id == id returns team objects match id passed in argument, how this.schoolslist.contains(x.school_id) work? how can able use school_id property (which property of team class)? is first part of predicate ( x => x.id == id ) returning team object, , second part using returned object's school id? reason seems weird way things working since kinda thought in where() method taken returned something, instead of each condition returning something. team team = ctx.teams .include("login...

r - tabplot visualization pkg: what is the left-side 0 -100% vertical axis? -

using "tabplot" pkg. simple iris data set example: **#load required packages** require(ggplot2) require(tabplot) **# import data set** data(iris) **# make plot** tableplot(iris, sortcol="species") so, q: vertical scale (0% 100%) on left-side of plot, represent? mean? i searched in vain clear explanation in plain english, (for tin-head me). would care explain in clear, "everyday" terms simple iris example? thanks!! the vertical scale on left of tableplot represents percentage of whole data set sortcol factor displays. iris data set, each species numbers 50, each species accounts one-third of total 100%. with diamonds data set, if sortcol set carets, plot bins data set carets, showing aggregate of 539 per bin, , shows on vertical, y-axis, percentage of diamonds fall each of 100 bins.

Android Studio Library project - .jar creation in addition/instead of .aar -

i have android app set eclipse project , associated library projects. create jars these library projects , share them customers and/or plug in app's libs folder. now, moving entire project android studio , notice library projects in android studio create .aar files default. i not sure if easy task request customers start using .aar, want stick .jar files. i wondering if there detailed tutorials creating .jar files android studio project. appreciated :)

powershell - Need to get an Exchange 2010 user report -

i'm trying exchange 2010 report multitenant platform. thing need info obtained different cmdlets. our client asking displayname, mailboxplan, primarysmtpaddress (get-mailbox ), totalitemsize , lastlogontime ( get-mailboxstatistics ) i'm trying using powershell, i'm getting error... can me find out what's wrong? here's script: $tbmailbox = get-mailbox -organization organization -resultsize unlimited | select-object identity,displayname,mailboxplan,primarysmtpaddress foreach ($mbx in $tbmailbox) {$temp += ,(get-mailboxstatistics -identity $mbx.identity | select $mbx.identity,$mbx.displayname,$mbx.mailboxplan,$mbx.primarysmtpaddress,totalitemsize,lastlogontime)} $temp | export-csv -path "c:\path" i'm getting error: foreach ($mbx in $tbmailbox) {$temp += ,(get-mailboxstatistics -identity $mbx.identity | select <<<< $mbx.identity,$mbx.mailboxplan,$mbx.primarysmtpaddress,totalitemsize,lastlogontime)} categoryinf...

spark streaming - Sliding window over an interval on Esper -

how achieve same effect of spark streaming sliding window, runs @ x sliding interval on last y window length. looking @ esper, should win:time , win:time_batch , win:time >= win:time_batch. in esper equivalent declare context. create context bucketof10sec start @now end after 10 min; context bucketof10sec select sum(price) myevent;

gitignore - Stop git from re-deleting an ignored file that used to be tracked? -

a previous poster wanted track file in 1 branch , not in another; want not track @ all. i used have ".p4client" tracked in git, turned out mistake. deleted repository, added name .gitignore , , recreated file. gets deleted when switch branches -- checkouts, not all. appears occur when switching to 'master', not from , , not when going between dev branches. how can put stop this, , keep file around, untracked? the deletion occurred in 'master' , has not been merged feature branches existed @ time. git-rm in 'master' ahead of commits in, say, 'de8060' , needs reapplied when checking out master. solution merge 'master' every branch not ancestor of, before re-creating ".p4client". git not need 'update' working copy 'newer' delete operation each time 'master' checked out.

php - How to search through a gallery of photos containing QR Codes for a character string -

i have folder of images, each containing qr code within picture acts unique identifier image. each qr code represents "order number" in form of "so12345" what great if upload these photos dropbox, , type order number search box , find image contains qr code equivalent of search phrase. is there existing service can this? or have custom written? there php library use? assuming has done using php library, there 2 ways see doing this. each time search character phrase, has loop through each image 1 1 till either completes no matches, or finds match, format take longer , longer directory increases in size. or have function loop through every image uploaded, , if finds qr code, decodes , either changes file name qr code value, or updates mysql row table associate qr code value file name. search function searches match in file name, or match in mysql row value. ideally rather not reinvent wheel if necessary. if has done appreciate can offer on start ...

c++ String copying error to struct pointer data fields -

i'm writing program uses binary search tree store names , phone numbers (phonebook basically). i've done before avl tree, , works fine. have decided switch methods implementation , not copy/paste logic , format of last one. in doing i've run weird error , have no idea why it's happening. @ first thought problem in way returned struct pointer, in string copying. i've written basic program shows copy function returns structure, used recursively fill bst data (which read in file). here shortened example: #include <iostream> #include <string> using namespace std; struct node { std::string first; std::string last; std::string phone; }; node* copyfunc(std::string first, std::string last, std::string phone) { node* temp = null; temp->first = first; temp->last = last; temp->phone = phone; return temp; } int main() { std::string first, last, phone; first = "jenny"; last = "somethi...

c# - Mimekit: parse filtered Mbox results to new Mbox -

after parsing mbox, filtering message(s) condition, , writing messages new stream => file, resulting mbox missing lines. can tell me if i'm making code mistake or if there bug in mimeparser function? example code: using system.io; using mimekit; namespace mboxscan { class program { static void main(string[] args) { // grab local .mbox file var stream = mboxstream(@"c:\temp\user.mbox"); // filter logic string fromfilter = "it@abc.com"; // load every message unix mbox var parser = new mimeparser(stream, mimeformat.mbox); // create new stream results var exportstream = new memorystream(); while (!parser.isendofstream) { var message = parser.parsemessage(); if (message.from.tostring().contains(from...

unity3d - Unity local avoidance in user created world -

i'm using unity3d networked multiplayer online game have large complex 3d terrain scene forest, trees, cliff, hills, mountains, bounders, etc. players can build structures sort of minecraft, , put them anywhere in scene, or move them around anytime. aside human controlled players, there automated ai players , objects animals roaming around scene following path. the problem how make these automated ai players , animals, able navigate around static , dynamic player created structures, because path follow can blocked player created structures, or other players , other ai objects, cliffs etc. have find away around them or on track if tumble down off high cliff example. so made navmesh , used navagents, takes care of static, non moving objects, how make ai players navigate around each other , dynamic structures created players can number in hundreds? i thought of adding navmeshobstacle everything, result in being attached hundreds of objects since user created structures b...

Wordpress get_the_post_thumbnail only works for current post ID -

i'm working on creating 'related articles' feature on wordpress site. uses custom fields post author can paste links related posts displayed @ bottom of current post. want display thumbnail , link each related post. problem: get_the_post_thumbnail works when provide id current post. have idea might going on here? here's code i'm using generate related post. i've confirmed $url, $id, , $title output expected. <?php $url = get_field('url_01'); ?> <?php $id = url_to_postid($url); ?> <?php $thumb = get_the_post_thumbnail($id, 'yarpp-thumbnail'); ?> <?php $title = get_the_title($id); ?> <?php echo $thumb ?> <a href="<?php echo $url; ?>"><?php echo $title; ?></a>

Rails Model Association with form -

i trying achieve this: it has model called customer has details of customers name (first, middle , last) , telephone numbers (mobile , landline). it has model called address linked customer. model have details customers address (a number of address lines, country , post/zip code). a customers controller supports 2 pages. first list customers in database along associated address. second display form entry of new customer along address , allow creation of new customer , address record. should possible move either page other without having enter url in browser navigation bar. number of points of note follows... this code: migration: class createaddresses < activerecord::migration def change create_table :addresses |t| t.string :address_line1 t.string :address_line2 t.string :address_line3 t.string :city t.string :county_province t.string :zip_or_postcode t.string :country t.string :customer_id t.timestamps null: false end create_table...

c++ - How can I count the number of tips in an image in OpenCV? -

Image
i have set of hiragana characters , count number of end points/ tips character have. example: input image: desired output image: i have tried using convex hull code: (based on opencv tutorial here ) findcontours(threshold_output, contours, hierarchy, cv_retr_tree, cv_chain_approx_simple, point(0, 0)); vector<vector<point> >hull(contours.size()); (int = 0; < contours.size(); i++) { convexhull(mat(contours[i]), hull[i], false); } mat drawing = mat::zeros(threshold_output.size(), cv_8uc3); (int = 0; i< contours.size(); i++) { if (hierarchy[i][3] == 0) { scalar color = scalar(rng.uniform(0, 255), rng.uniform(0, 255), rng.uniform(0, 255)); drawcontours(drawing, hull, i, color, 1, 8, vector<vec4i>(), 0, point()); } } then conrnerharris() returned many undesired corners code: (based on opencv tutorial here ) int blocksize = 2; int aperturesize = 3;...

grails - spring security core secure custom url -

i using grails 2.3.9 , spring-security-core:2.0-rc3 , using staticrules security. i have following security configurations in config file: grails.plugin.springsecurity.userlookup.userdomainclassname = 'com.mkb.user' grails.plugin.springsecurity.userlookup.authorityjoinclassname = 'com.mkb.userrole' grails.plugin.springsecurity.authority.classname = 'com.mkb.role' grails.plugin.springsecurity.useswitchuserfilter = true grails.plugin.springsecurity.logout.postonly = false grails.plugin.springsecurity.adh.errorpage = null grails.plugin.springsecurity.controllerannotations.staticrules = [ '/': ['permitall'], '/index': ['permitall'], '/index.gsp': ['permitall'], '/**/js/**': ['permitall'], '/**/css/**': ['permitall'], '/**/images/**': ['permitall'], '/**/favicon.ico': ['permitall'], '/controllerc/**': [...

Python: setting two variable values separated by a comma in python -

what difference in python between doing: a, b = c, max(a, b) and a = c b = max(a, b) what having 2 variable assignments set on same line do? your 2 snippets different things: try a , b , c equal 7 , 8 , 9 respectively. the first snippet sets 3 variables 9 , 8 , 9 . in other words, max(a, b) calculated before a assigned value of c . essentially, a, b = c, max(a, b) push 2 values onto stack; variables a , b assigned these values when popped off. on other hand, running second snippet sets 3 variables 9 . because a set point value of c before function call max(a, b) made.

php - Error 500 MVC with subdomain -

i have php mvc frame work. created subdomain gives error 500. my root .htaccess file this: <ifmodule mod_rewrite.c> rewriteengine on rewriterule ^$ all_users/ [l] rewriterule (.*) all_users/$1 [l] it redirects "all_users" folder. the "all_users" root .htaccess this: <ifmodule mod_rewrite.c> rewriteengine on rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d # rewrite other urls index.php/url rewriterule ^(.*)$ index.php?url=$1 [pt,l] </ifmodule> <ifmodule !mod_rewrite.c> errordocument 404 index.php </ifmodule> the subdomain folder in root of site. how should change .htaccess file(s) subdomain redirection. thanks. i found answer. this .htaccess file in root of site: <ifmodule mod_rewrite.c> rewriteengine on rewritecond %{http_host} ^subdomain.domain.com$ [nc] rewriterule (.*) / [l] rewriterule ^$ all_users/ [l] rewriteru...

r - Tcl/Tk Referencing user-selected values in script -

a quick question regarding tcl/tk , r. below have slice of code corresponds tk button executes todo<-function(){...} . my presumption both summary.mydata() , ggplot() commands execute. said, question whether or not have correctly coded each command reference correct selected variable (the tk widget controlling working fine, not depicted). namely if arguments each command valid. summary.mydata<-summaryse(mydata, measurevar=paste(tx.choice1), groupvars=paste(tx.choice2),conf.interval=0.95,na.rm=true,.drop=false) would read r as summary.mydata<-summaryse(mydata, measurevar=measure, groupvars=group,conf.interval=0.95,na.rm=true,.drop=false) and ggplot(data=summary.mydata,aes(x=paste(tx.choice2),y=paste(tx.choice1)))+ geom_errorbar(aes(ymin=formula(paste(tx.choice1),"-ci"),ymax=formula(paste(tx.choice1),"+ci")), colour="black", width=.5, position=pd)+ geom_point(position=pd, size=3)+ ...

java - Error when AWS Lambda trying to list DynamoDb tables -

Image
i failed following logic work on aws lambda using java: 1) when there new object created in s3 bucket, trigger lambda function (written in java) 2) in lambda function, list dynamodb tables. 3) create table if there none. 4) write s3 object's details item dynamodb. i item #1 working. when reach item #2, encounter permission related error below. any or suggestion? the permission use "basic dynamodb", has following permission: start requestid: e9ab5aba-307b-11e5-9663-3188c327cf5e filesize: 1024, datetime:1970-01-01t00:00:00.000zs3key : happyface.jpgaws credential profiles file not found in given path: /home/sbx_user1052/.aws/credentials: java.lang.illegalargumentexception java.lang.illegalargumentexception: aws credential profiles file not found in given path: /home/sbx_user1052/.aws/credentials @ com.amazonaws.auth.profile.internal.profilesconfigfileloader.loadprofiles(profilesconfigfileloader.java:45) @ com.amazonaws.auth.profile...

python - manipulate list comprehension -

i have 3 lists make condition, if b equal 1 want find first element in c below a, can 2 indexes subtract them , time. = [1.373, 1.374, 1.374, 1.385, 1.385, 1.385, 1.374, 1.374] b = [0, 1, 1, 0, 0, 0, 0, 0] c = [0, 1.384, 1.385, 1.377, 0, 0, 0, 0] view = [(nx, x, nz, z, nl, l) nx, x in enumerate(a) nl, l in enumerate(b) nz, z in enumerate(c) if (l == 1) & (nz <= nx) & (z > 0) & (z <= x) & (nz == nl)] i created simple view list shows parameters better understanding. when numbers when c lower , want first elements... expected see [(3, 1.385, 1, 1.384, 1, 1), (3, 1.385, 2, 1.385, 2, 1)] , got that: [(3, 1.385, 1, 1.384, 1, 1), (3, 1.385, 2, 1.385, 2, 1), (4, 1.385, 1, 1.384, 1, 1), (4, 1.385, 2, 1.385, 2, 1), (5, 1.385, 1, 1.384, 1, 1), (5, 1.385, 2, 1.385, 2, 1)] time = [(nx - nz) nx, x in enumerate(a) nl, l in enumerate(b) nz, z in enumerate(c) if (l == 1) & (nz <= nx) & (z > 0) ...

qt - Find coordinates in a vector c++ -

i'm creating game in qt in c++, , store every coordinate of specific size vector : std::vector<std::unique_ptr<tile>> all_tiles = createworld(bgtile); for(auto & tile : all_tiles) { tiles.push_back(std::move(tile)); } each level has healthpacks stored in vector aswell. std::vector<std::unique_ptr<enemy>> all_enemies = getenemies(nrofenemies); for(auto &healthpackuniqueptr : all_healthpacks) { std::shared_ptr<tile> healthpackptr{std::move(healthpackuniqueptr)}; int x = healthpackptr->getxpos(); int y = healthpackptr->getypos(); int newypos=checkoverlappos(healthpackptr->getxpos(),healthpackptr->getypos()); newypos = checkoverlapenemy(healthpackptr->getxpos(),newypos); auto healthpack = std::make_shared<healthpack>(healthpackptr->getxpos(), newypos, healthpackptr->getvalue()); healthpacks.push_back(healthpack); } but know i...

angularjs - Angular: why $http GET params encrypted? -

i have get method reason sends encrypted params var request = function (apimethod, apiresponse) { var deferred = $q.defer(); var apipath = getapipath(); apipath = $rootscope.root_url + apipath; var config = { method: 'get', url: apipath + apimethod, params: 'email=myemail@gmail.com, timestamp_start=1432801800, timestamp_end=1432803600, organizer_email= myemail@gmail.com, cloudinary_rules=scale, meeting_name=123', //data: apiresponse, //headers: {'content-type': 'application/x-www-form-urlencoded'}, //withcredentials: true, timeout: canceler.promise }; $http.get(config).success(function (data) { $rootscope.showloader = false; if (data.message === undefined) { deferred.resolve(data); } else { ...

java - Locating Elements with dynamic id -

if have element in page follows (there multiple select elements) <select size="1" name="j_id0:j_id2:j_id37:j_id38:0:j_id41"> <select size="1" name="j_id0:j_id2:j_id37:j_id38:1:j_id41"> with identifier being name name change dynamically how locate in selenium(java) without referencing name? i using xpath follows /html/body/div/div[2]/table/tbody/tr/td[2]/form/div[3]/div/div/div/div[2]/div[1]/span[3]/select problem being if on page changes xpath break. are there better alternative ways less broken? you've correctly noted presented xpath quite fragile. useful see complete html of page, or, @ least, preceding , following elements of select element. have now, can rely on part of name attribute: //select[contains(@name, "j_id")]

r - Shiny Map - Leaflet: How to select input matrix dynamically? -

i trying create shiny app generate dynamic maps. want use selectinput function select matrix dynamically. integrate these maps in rmarkdown file several apps there. i using amazon ec2 ubuntu machine hosting shiny apps , rstudio. working apps @ /srv/shiny-server. i getting following error: error error in maptab[, "long"] : incorrect number of dimensions error in data.frame(lng = maptab[, "long"], lat = maptab[, "lat"], category = factor(maptab[, : object 'maptab' not found code ### top doctors map leaflet library(shiny) library(leaflet) ##```{r, echo=false, warning=false, message=false} r_colors <- rgb(t(col2rgb(colors()) / 255)) names(r_colors) <- colors() shinyapp( ui =shinyui(fluidpage( # sidebar slider input number of bins sidebarpanel( selectinput("var", "1, select variables top doc summary file", choices =c( "top_docs" = 1, ...

java - run method 100 times and save each run in 2 D array -

i writing code in java i have method returns array contains 24 values i want run method 100 times , want save result in 2 dimensional array. i want save each run method in row this code int[][] multiarray = new int[101][24]; (int n= 0; n<multiarray.length; n++){ for(int nn = 0; nn<multiarray[n].length;nn++){ for(int s =0; s<100;s++){ actionarray =functionss (ff, b, d, e); multiarray [n][nn] = actionarray[s]; } multiarray [n][nn] = actionarray[nn]; system.out.print(multiarray [n][nn]+" "); } system.out.println(); } function xy return object[24]; object[][] arr = new object[100][24]; for(int = 0; < 100; i++{ for(int j= 0; j <24 ; j++){ arr[i][j] = returnof(xy)[j]; } is solution u need (pseudo code ;) )? dont understand question think :)

symfony - Is it possible to add custom global Symfony2 route variables like _format and _locale? -

in symfony2 project, have news site has posts. posts can published in different regions. current region (user choice) has part of url. urls should this: /mag => main news site, no region selection /mag/region1/ => posts region 1 /mag/region2/ => ... /mag/region1/my-news-post-slug => detail view of 1 post for news posts, used sonata news bundle . now question is, how add region choice of user route system without having change each controller , template of bundles use? when add routing config magazin: resource: '@sonatanewsbundle/resources/config/routing/news.xml' prefix: /mag/{region} i errors because parameter not set when generating route in controllers , templates of news bundle (and others). need {_format} or {_locale} route variables added routing component obviously. possible add "global" values that? take @ how symfony locale. https://github.com/symfony/symfony/blob/2.8/src/symfony/component/httpkernel/event...

android - Sectioning date header in a ListView that has adapter extended by CursorAdapter -

i trying build demo chatting app.i want show messages section headers dates "today","yesterday","may 21 2015" etc.i have managed achieve since new view method gets called whenever scroll list.the headers , messages mixed up. for simplicity, have kept header in layouts , changing visibility(gone , visible) if date changes. can me out this? let me know if needs more info posted in question. public class chatssadapter extends cursoradapter { private context mcontext; private layoutinflater minflater; private cursor mcursor; private string mmyname, mmycolor, mmyimage, mmyphone; // private list<contact> mcontactslist; private fragmentactivity mactivity; private boolean misgroupchat; public chatssadapter(context context, cursor c, boolean groupchat) { super(context, c, false); mcontext = context; mmycolor = constants.getmycolor(context); mmyname = constants.getmyname(context); ...

leaflet - D3.js SVG on OpenLayers3 interactive map -

i trying figure out how hard integrate d3.js openlayers 3 create beautiful interactive map. i looking @ mike's example, d3 + leaflet: http://bost.ocks.org/mike/leaflet/ and @ mike`s example d3.geo.path + canvas lose interactivity , css style support of svg. and on openlayers-3 example site , there interactive map, integrates mike's example of d3.geo.path + canvas openlayers create interactive map: so wondering, missing in openlayers3 allow creation of similar d3 + leaflet example, or possible considering ol3 design? you can't use css approch used leaflet on openlayers, d3 + openlayer draw data using d3 on canvas wich used imagelayer. you need use openlayer approch : layers + style , can have similar performance openlayers "imagevector" layers. i edited jsfiddle style + imagevector: http://jsfiddle.net/6r8rat8n/5/ var vector = new ol.layer.image({ source: new ol.source.imagevector({ source: vectorsource, style: new...

java -negative unary operator in RPN algorithm -

i got problem negative unary operator - not know how implement in code, can me this? got whole calculator written in java fx works fine, need implement feature allows user calculate expression like: -5 + 3 * 8 or 3 + 2 * (-8). waiting answer, regards

javascript - nodejs seperate code include middleware use() -

i'm new nodejs, below app.js installed express --sessions --css less --hogan app command. tried separate commented line in app.js move new file call route_handler.js . i'm not sure doing correct add require('./route_handler.js'); in app.js , should have export in route_handler.js express() ? how solve it? does require means execute code in file? app.js var express = require('express'); var path = require('path'); // var favicon = require('serve-favicon'); // var logger = require('morgan'); // var cookieparser = require('cookie-parser'); // var bodyparser = require('body-parser'); // var routes = require('./routes/index'); // var users = require('./routes/users'); var app = express(); // view engine setup app.set('views', path.join(__dirname, 'views')); app.set('view engine', 'hjs'); // end: view engine setup require('./route_handler.js')...