Posts

matlab - Make multiple histograms for each column in matrix -

Image
i loop through each column in 306x20 matrix, nan values filling in empty spaces, , create histogram each row (finish 20 histograms). best way this? pseudocode implement: for = 1:(number of columns) % loop through each column generate different histogram same % x , y labels , title % hist(data, 20) end thank you i assume want separate figure each histogram. can achieved for-loop , figure -statement open new figure in each iteration. in matlab version r2014b , above, use histogram -function plot histogram, in versions below r2014b use hist instead ( hist still works in r2014b , above). both functions ignore nan -values in dataset. % generate random data nan-values x = randn(306,20); = randi(5,[306,20]); x(a==3) = nan; % plot histograms = 1:size(x,2) figure; histogram(x(:,i)) % before r2014b use "hist" instead title(['histogram of row ',num2str(i)]); xlabel('bins'); ylabel('frequency'); end this...

video - Videojs - multi bitrate on VOD -

hi using aws elastic transcoder transcode files mp4, want achieve multi-bitrate vod. create 3 different renditions , depending on device or/and connection user best suited file. all files h.264 , bitrates are: bitrate - 1200 bitrate - 720 bitrate - 5000 1) on right track can videojs deliver different renditions of mp4 out of box or require dev on side? 2) presets used realistic? 3) server different rendition mobile devices better use js device detection? you can use hls achieve this. elastic transcoder supports creating multi-bitrate video manifests: http://aws.amazon.com/about-aws/whats-new/2015/04/amazon-elastic-transcoder-adds_playready-drm-support/ then use hls plugin video.js: https://github.com/videojs/videojs-contrib-hls

angularjs - How to make a link function change a scope variable -

i trying use angularjs make model responds click user. have information model in controller (other elements added scope later), , directive handles showing element in view , performing actions on it, such minimizing on click. what i'm having trouble making link function in makedialog directive change value of experimentdialog.minimized in model. how can accomplish this? doing wrong? right now, nothing happens when click button -- troubleshooting appreciated. let me know if need more information! angular: angular.module('root', []) .controller('index', ['$scope', function($scope){ $scope.experimentdialog = { minimized: false, width: 200, height: 300, top: 10, left: 10, template: 'experiment-dialog.html' }; }]) .directive('makedialog', function() { return { restrict: 'e', scope: { model: '=' }, templateurl: 'dialog.ht...

imagemagick - Ghostscript convert PDF into large TIFF -

i want resize pdf tiff format ghostscript. use input pdf/x-3 has limitation of 5 meters in length or height. as result, want have tiff - file correct dimensions , final resolution of 200dpi by scaling bigger format bigtiff (e.g): gs -sdevice=tiff32nc -dnumrenderingthreads=6 -dnopause -dbatch -dsafer \ -dpdffitpage -r2000 -dusecropbox -dusebigtiff \ -soutputfile=example.tiff test.pdf edit here: first result 2000 dpi file just trick scale correct pixels, change 200dpi exiftool: exiftool -resolutionunit="inch" -xresolution="200" -yresolution="200" example.tiff i have resulting tiff 200 dpi , dimension of 72/200 times format expect. to sure result has real expected format convert calculated format: convert example.tiff -depth 8 -resize 70866x15748\! temp-1.tiff would best suitable way achieve goal? basics steps are: convert image resolution final dimension resize target dimension , final resolution of 200 dpi edit...

gradle - How do I extend the main distZip so I get a copy of the ZIP file with some extra files in it? -

i'm trying generate multiple zip files project using application plugin can include os specific exe files in zip. have exe files under src/win32/dist , end in win32 zip file fine, that's that's in zip file. how configure additional distributions each include in main zip plus these exe files, not these exe files? here's example bit of config: distributions { //i want win32 include same 'main' dist plus files in src/win32/dist win32 { contents { { libsdir } } } amd64 { contents { { libsdir } } } } here's directory structure: src/ win32/ dist/ prunsrv.exe <-- win32 specific exe amd64/ dist/ prunsrv.exe <-- amd64 specific exe i never used 'distribution' or 'application' plugin; going through documentation of 'distribution' plugin & distribution javadoc, understand : ...

c# - Getting error on jQuery Tag-it UI widget Failed to load resource -

i using jquery ui widget tagit in asp.net. code working fine want highlight tags not available list. previously asked question , using same method highlight tags not available list my code .aspx code <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js" type="text/javascript" charset="utf-8"></script> <link href="../css/jquery.tagit.css" rel="stylesheet" /> <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/jquery-ui.min.js" type="text/javascript" charset="utf-8"></script> <script src="../javascript/tag-it.js"></script> <link href="../css/tagit.ui-zendesk.css" rel="stylesheet" /> <script> $(function () { $.ajax({ url: 'updatesingimgkwds.aspx/getkeywords', type: 'get', datatype: ...

ruby on rails - Converting string to title-case -

so i'm bit of noob in ruby , mission manually convert string title-case. have been able create method believe meet requirements assignments (it's not flexible, do), have hit 1 final snag. cannot seem join final array 1 string. code , rspec errors below. believe have use .join(" ") somewhere, not sure of exact syntax. in advance help! my code: class title attr_accessor :string def initialize(string) @string = string end def fix string.split(" ").each_with_index |value, index| if index >= 2 && value.length <= 3 value.downcase! else value.capitalize! end end end end rspec: expected: "the great gatsby" got: ["the", "great", "gatsby"] (compared using ==) exercise_spec.rb:6:in `block (3 levels) in <top (required)>' again: expected: "little red riding hood" got: ["little", "red", "ri...