Posts

c++ - How i can extract information from DICOM file ? -

i want write script extract header information of dicom file using c or c ++, don't want use external libraries dicomsdl... when open file bloc-notes see special characters , character string patient name .. if can me read file. yes, open file in binary though might contain sequences of characters. out deep it, consider writing following record of out file (i'm showing record c-struct): struct rec_tag { int id; char name[50]; }; now, suppose use structure create file, shown in following code: file1.c: /* compile as: gcc -ansi -pedantic -wall file.c -o file_test */ #include <stdio.h> #include <stdlib.h> #include <string.h> struct rec_tag { int id; char name[50]; }; int main(int argc, char** argv) { file* fp = null; struct rec_tag rec1; struct rec_tag rec2; rec1.id = 20; strcpy(rec1.name, "thurizas"); rec2.id = 345689; strcpy(rec2.name, ...

javascript - Set element width to image inside it -

Image
i have page displays image, along metadata it. image , metadata should centered in page. i'd div containing metadata wide image. sorta so: unfortunately, it's not possible me reliably determine image's width before serving page. right i'm using listener on load: $('.image-container img').one('load', function() { $('.image-container, .image-container *').css('max-width', $(this).width()); }); this works, if image large , takes while load, page looks crappy until finishes. i'm looking either: a way use css express container should wide image inside it. an event fires browser gets enough information know image's width (which pretty on, can see). thanks! this quite easy without jquery. set container display:inline-block this: div {display:inline-block; margin:0; padding:0;} example in fiddle (image size 600px x400px)

stata - Logit model (backed up) Warning -

i trying run logit identifying probability of being tribal versus non-tribal on subsample of adult women only. have 5 rounds of data , independent variable includes years of education, age, marital status, rural residence, children under 5, household size, age of household head , monthly per capita income. have included set of zone dummies zone1-zone6 divides country 6 unique zone-with each zone consisting of group of states. this command use foreach r in 1 2 3 4 5 { logit scst age yrs_ed rural marital n_mpce ch_under5 fhead headage heademp hhsize i.zone [aw=hhwt] /* */ if (keep_agerc==1) & (sex==2) & (round==`r'), iterate (100) predict phatscst`r' if e(sample), pr sum scst [aw=hhwt] if (keep_agerc==1) & (sex==2) & (round==`r') gen pbarscst`r'=r(mean) gen scstwt`r'= (phatscst`r'/(1-phatscst`r')) * ((1-pbarscst`r')/ pbarscst`r') * (hhwt) if scst==0 & round==`r' } the issue run rounds 1,2 , 3 logit converges ...

java - Netbeans background scanning project stuck -

i'm using netbeans 7.4 java ee project school. when open netbeans, background scanning of project takes ages. if check ide log, see alot of info netbeans not beeing able read symbolic links files in library. these links files in frameworks folder. before, netbeans scanned folder named tex in de library, deleted that, since didn't need anymore, deleting frameworks folder don't trust much. since netbeans keeps scanning, can't run project. can me?

linux - Why is a deluge startup script necessary? -

i'm working on making spare raspberry pi headless bittorrent box, using deluge. most guides on setting deluge on linux include custom startup script run @ boot. however, when you're ssh'd pi, can start deluged daemon typing in "deluged". however, when wrote basic bash script ran command, put in /etc/init.d/ , added using update-rc.d, didn't work. nano /etc/init.d/startdeluged.sh chmod 755 /etc/init.d/startdeluged.sh update-rc.d startdeluged.sh defaults the bash script contained this: #!/bin/sh deluged exit i'm new setting startup scripts on linux, , i'm wondering why special script necessary when running command in terminal has same effect. have user entering command? you must add begin init infos after #!/bin/sh . looks : ### begin init info # provides: scriptname # required-start: $remote_fs $syslog # required-stop: $remote_fs $syslog # default-start: 2 3 4 5 # default-stop: 0 1 6 # short-descript...

dataframe - trouble combining two numeric columns into one R -

so having bit of bother combining 2 columns one. have 2 columns of ages, split child , adolescent columns. example: child adolescent 1 na 12 2 na 15 3 na 12 4 na 12 5 na 13 6 na 13 7 na 13 8 na 14 9 14 15 10 na 12 11 12 13 12 na 12 13 na 13 14 na 14 15 na 14 16 12 13 17 na 14 18 na 13 19 na 13 20 na 14 21 na 12 22 na 13 23 12 15 24 na 13 25 na 15 26 na 12 27 na 15 28 na 15 29 na 13 30 na 12 31 13 15` now combine them 1 column called "age" , remove na values. when try following code, encounter problem: age<- c(na.omit(data$child),na.omit(data$adolescent)) the problem being original data has 514 rows, yet when combine 2 columns, removing nas, somehow end 543 values, not 514 , don't know why. so, if possible, explain firstly why getting more values planned, , secondly might better way combine 2 columns. edit: looking this age 1 12 2 15 3 12 4 12 5 13 6 13 7 13 8 14 ...

How SpringServletContainerInitializer is bootstrapped during Spring initialization? -

i'm using webapplicationinitializer-approach initialization of spring's webapplicationcontext. official documentation webapplicationinitializer: implementations of spi detected automatically springservletcontainerinitializer, bootstrapped automatically servlet 3.0 container the question how springservletcontainerinitializer 'bootstrapped automatically'? as per doc springservletcontainerinitializer implements servletcontainerinitializer . implementations of servletcontainerinitializer notified servlet 3.0-compliant container during container startup. that's contract of servlet3.0 complaint container. doc servletcontainerinitializer can seen here doc how bootstrapped here