Posts

PHP Sorting An Multidimensional Array -

i new php , unsure why code not outputting. have in place no errors , seems correct. trying output names , dates in ascending order while using print_r() verify order. appreciate guidance matter have no idea going wrong. $win = array('name'=> array('jane doe ', 'nash patel ', 'joe public '), 'date'=> array('7 october 2015 ', '14 october 2014 ', '12 october 2016 ')); foreach($win $element => $namedate) { echo '<strong>' . $element . '</strong><br>'; foreach($namedate $both) { echo $both . '<br/>'; } } foreach($win $c=>$key) { $sort_date[] = $key['date']; $sort_name[] = $key['name']; } array_multisort($sort_name, sort_asc, $sort_date, sort_asc, $win); print_r($win); output\ array ( [date] => array ( [0] => 7 october 2015 [1...

reporting services - SQL Parameters, How to give * (ALL) a default parameter? -

i have query: select job,age,name + + surname fullname now filtering (in ssrs) per full name. how set default value in full name drop down field show candidates default? drop down field looks follows: everyone jon patric kelly steve you can pullback data similiar query below: select * ( select orderby=2,filtervalue=surname, job,age,name + + surname fullname union select orderby=1,filtervalue=null, null,null,null + + '<all>' fullname ) order orderby,fullname then send in filtervalue filter clause similiar to: select * mytable (@filtervalue null) or (surname = @filtervalue)

gdal - how to plot geotiff data in specific area (lat/lon) with python -

Image
i have geotiff raster data sets elevation data init , want plot in specific area, such 60°e - 70° e ,70°s - 80°e. i have bit of code here ,but pcolormesh seem couldn't plot geotif.it's red. picture . picture shown imshow really picture when try make plot code below: path = "f:\\mosaic_h1112v28_ps.tif" dataset = gdal.open(path) data = dataset.readasarray() x0, dx, dxdy, y0, dydx, dy = dataset.getgeotransform() nrows, ncols = data.shape londata = np.linspace(x0, x0+dx*ncols) latdata = np.linspace(y0, y0+dy*nrows) lons, lats = np.meshgrid(lonarray, latarray) fig = plt.figure(figsize=(8, 8)) m = basemap(projection='lcc', lon_0=67.5, lat_0=-68.5, height=950000, width=580000, resolution='h') m.drawcoastlines() x, y = m(lons, lats) then dont know how continue . want use imshow , imshow dont specify area(lat/lon). i appreciate help. it's question, here solution. required packages: georaster dependencies (gdal,...

can't transfer tiff or modi file with PHP -

this snippet should transfer file tiff or modi web server user web header('content-description: file transfer'); header('content-type: ' . $file_mime_type); header('content-disposition: attachment; filename="' . $file_name . '"'); header('content-transfer-encoding: binary'); header('expires: 0'); header('cache-control: must-revalidate'); header('pragma: public'); header('content-length: ' . $file_size); # till moment fine echo file_get_contents("path/to/file.tif"); # script fails on line above, , doesnt reach place when file format not tiff or modi, works fine , client browser start downloading file (docx/xlsx/pdf/etc.) when user try download tiff or modi, script fails without error. have tried print(file_get_contents("path/to/file.tif")); , readfile("path/to/file.tif"); instead of echo, result same

java - AsyncTask freezing both its thread and the UI thrad -

i've made class extending asynctask send post requests server, application. has been working until now. haven't changed anything, of sudden freezing ui thread , own thread when try execute it. i've tried using log.d() find out gets u before freezing, , turns out freezes right after doinbackground() called. i've tried changing this... string result = new asyncpost().execute(params).get(); to this... asynctask task = new asyncpost(); task.execute(); string result = task.get(); it nothing parameters i'm giving it, since freezes no matter parameters passed it. i have tried using postman check server working (and is), not server-side issue either. this asynctask class. sorry excessve amount of code, can't figure out specific part of bad, since working until now. public class asyncpost extends asynctask<object, integer, string> { @override protected string doinbackground(object ... params){ //android.os.process.setthread...

How do I install SQL Server 2016 onto my newly configured virtual machine on Azure? -

how install sql server 2016 onto newly configured virtual machine on azure? i want developer version practice queries etc. vm works fine can't administer it. you can microsoft website https://docs.microsoft.com/en-us/sql/ssms/download-sql-server-management-studio-ssms

r - Inserting NA rows when missing data -

i have data set missing values in sequence: seq<-c(1,2,3,4,6,7,10,11,12,18,19,20) data<-c(3,4,5,4,3,2,1,2,3,5,4,3) df<-data.frame(seq, data) i'd add rows data set approximating have missing values, , filling in data na. time have gap larger 2, add na row (or multiple rows if gap large). result this: newseq<-c(1,2,3,4,6,7,8.5,10,11,12,14,16,18,19,20) newdata<-c(3,4,5,4,3,2,na,1,2,3,na,na,18,19,20) newdf<-data.frame(newseq,newdata) so ignore when gap < 2, add na row anytime there gap > 2. if there still > 2 gap after adding na row, add until gap filled. not elegant, how it: seq<-c(1,2,3,4,6,7,10,11,12,18,19,20) data<-c(3,4,5,4,3,2,1,2,3,5,4,3) df<-data.frame(seq, data) first <- df$seq second <- df$data for(i in length(first):2) { gap <- first[i] - first[i - 1] if(gap > 2) { steps <- ifelse(gap %% 2 == 1, gap %/% 2, (gap %/% 2) -1) new_values_gap <- gap / (steps + 1) new_values <- vector(...