Posts

java - How to resize image to maximize their dimensions into a panel without changing aspect ratio -

i want draw images panel, need images conserves aspect ratio biggest dimensions drawn on panel. given panel dimensions must create java code maximize dimensions. ideas had needed solve linear programming, , don´t know how in java. wich should easiest way need? you can use darryl's stretch icon . dynamically resize icon fill space available label.

iOS7 MPMusicPlayerController Music Fade-In/Fade-Out Effect -

i've been using mpmusicplayercontroller play music within app, has no volume slider available user. there instances have fade music in , out. far i've been using volume property mpmusicplayercontroller within loop that. after ios7, volume property deprecated. apple wants devs use mpvolumeview . have no use volume slider, need fade music @ occasions. there way ios7? thanks in advance

c++ - How to open a file in boost -

i relatively new using boost library c++ , wondering how open file using this. aim read json file not know how open file. in c++, can this int main () { ofstream myfile; myfile.open ("example.txt"); myfile << "writing file.\n"; myfile.close(); return 0; } but how can using boost? you can use boost::ifstream (which works boost::filesystem::path instance) or use std::ifstream read file. the actual code depends lot on concrete use-case.

r - Assign Colour to each line in ggplot2 -

Image
hello people, trying use geom_line function create line graphs in r. want assign specific colours each line , unable so. when try manually assign colours colour names variables , in legend arranged alphabetically. if don't don't colours @ all. looked around on web , noticed there should grouping variable colours can assigned. unfortunately, in dataset here, each column corresponds different variable. not sure transposing dataset work because trying plot these variables against >2000 values on x-axis. think missing simple here. ggplot(data=data, aes(xvar))+ geom_line(aes(y=var1))+ geom_line(aes(y=var2))+ geom_line(aes(y=var3))+ geom_line(aes(y=var4)) please feel free redirect section if has been answered before. appreciated. i able manually without using ggplot2 function code follows: plot(data$wavelength,data$var1,col="green") par(new=t) plot(data$wavelength,data$var2,col="red") par(new=t) plot(data$wavelength,data$var3,col=...

angularjs - jsonp call not returning data in angular? -

i trying return data through jsonp call angular application. tried workaround: angular $resource jsonp not working . did replacing webapi link , callback 'blaat' not triggered? fiddle: http://jsfiddle.net/qc4wk/5/ fragment of code: $http({ method: "jsonp", params: { callback: "blaat" }, url: "http://localhost:7234/api/person", isarray: true }) my apicontroller looks like: public class personcontroller : apicontroller { public list<person> get() { person person1 = new person() { name = "mark", id = 1 }; person person2 = new person() { name = "ed", id = 2 }; person person3 = new person() { name = "fred", id = 3 }; list<person> lijst = new list<person>(); lijst.add(person1); lijst.add(person2); lijst.add(person3);...

unzip the file in perl -

my script : #!/usr/local/bin/perl use posix qw(strftime); use strict; use warnings; use getopt::long; ($artifact, $package_id) = @argv; print $artifact; print $package_id; if($artifact =~ /\.zip$/i) { chdir("/apps/checkout/artifactory/xxkintana/$package_id"); unzip $artifact; } run : ./script.pl test-1.0.zip 4370177 error : can't locate object method "unzip" via package "test-1.0.zip" (perhaps forgot load "test-1.0.zip"?) @ ./script.pl line 16. please me -thanks use module archive::zip pull files zip archive. the module contains examples directory including 1 named extract.pl

doctrine2 - Generating joins from tables in entities in Zend Framework 2 + Doctrine 2 -

using following command can generate classes tables: ./vendor/doctrine/doctrine-module/bin/doctrine-module orm:convert-mapping --namespace="application\\entity\\" --force --from-database annotation ./module/application/src using command, can generate getters/setters: ./vendor/doctrine/doctrine-module//bin/doctrine-module orm:generate-entities ./module/application/src/ --generate-annotations=true is possible generate joins based on foreign keys setup in database? thanks.