Posts

jquery - Modify a string in JavaScript -

i want modify color attribute returned in jquery. so, lets assume color returned , contained in var color color = 'rgb(148, 141, 124)' i want modify value of color be: color = 'rgb(148, 141, 124, .7)' (in other words, insert string ", .7") you below: color = color.replace(/\)/, ', 0.7)')

how to change all td numeric values into percentage values in jquery and PHP -

i want function when click toggle button numeric values should changed percentage value formula. <table class="table table-striped table-bordered scrollable"> <thead> <tr class="success"> <th>answer</th> <th>total</th> <th>pcp</th> <th>ob/gyn</th> <th>pain</th> </tr> </thead> <tbody><tr><td class="left-align">male</td> <td>123</td> <td>72</td> <td>18</td> <td>33</td> </tr><tr><td class="left-align">female</td> <td>78</td> <td>48</td> <td>22</td> <td>8</td> </tr><tr><td class="left-align">all respondent</td> <td>201</td> <td>120</td> <td>40</td> <td>41</td> </tr></tbody> </table> ...

python - Filling missing lines with "nan" with pandas reindex -

thanks jeff, find missing lines in file data structure , fill missing lines. however, filled missing lines in output show "2013-07-01 00:00:00,,,,,,,,,,,,,,,,,,", not nan. fill "nan" or "nan" inside of commas. my code is: filin = datapath + 'skp_aws_min_qc_10001_2013.07-09.dat' pd.set_option('max_rows',10) data=pd.read_csv(filin,sep='#',index_col=[1],parse_dates=[1]) print data index = pd.date_range('2013-07-01 00:00:00','2013-09-30 23:59:00',freq="t") df = data sk_f = df.reindex(index) print sk_f sk_f.to_csv("sample1.csv") as long know information reindex function, missing holes should filled (default "nan"). can't find reason why missing hole in result files not filled. any idea or comment appreciated. thank you, isaac it has nothing reindex() , when to_csv , provide string missing values if don't want them show blank spaces. df.to_csv('temp.csv...

sql - Count number of cases -

Image
i have table called leaves has employee id , leave type , date . example, if employee id = 1234 applies sick leave 1-june-2014 5-june-2014, stored in leave tables day day, means following records added: 1234 sick leave 1-june-2014 1234 sick leave 2-june-2014 1234 sick leave 3-june-2014 1234 sick leave 4-june-2014 1234 sick leave 5-june-2014 considered 1 case. clarify mean case: total cases how many leave request had been applied… example: need following information sql statement (i should determine period: 1-january-2014 30-december-2014, example): sick leave cases: 2 escort leave cases: 2 study leave cases: 1 i using postgresql 9.2. this design bit strange, because of these daily rows, if same person have several escort leaves, have figure out different cases. for case can use this select count(*), leavetype ( select leavetype leaves group employee_id, leavetype ) group leavetype; my suggestion use case_start , case_en...

android - Google Maps v2 not loading -

google maps not load , gives blank screen tried few guides , tried google's guide none seem work have added, couldnt find problem :-/ logcat: 06-27 01:21:16.470: i/google maps android api(12628): google play services client version: 4452000 06-27 01:21:16.490: i/google maps android api(12628): google play services package version: 4452036 06-27 01:21:16.790: d/dalvikvm(12628): gc_for_alloc freed 3003k, 16% free 17823k/21008k, paused 32ms, total 33ms 06-27 01:21:16.800: i/fpp(12628): making creator dynamically 06-27 01:21:16.800: i/google maps android api(12628): google play services client version: 4452000 06-27 01:21:16.810: w/activitythread(12628): classloader.loadclass: class loader returned thread.getcontextclassloader() may fail processes host multiple applications. should explicitly specify context class loader. example: thread.setcontextclassloader(getclass().getclassloader()); 06-27 01:21:17.261: i/google maps android api(12628): failed contact google servers. attem...

bash - sed match on first instance not working -

i want replace first instance of <tr> <tr class="active"> using shell (bash). however, sed has no affect: sed '0,/<tr>/s/<tr>/<tr class="active">/' file1 >> temp2.txt temp2.txt remains <tr> <th>set</th> <th>run</th> <th>continuum<br>filter</th> <th>narrow band<br>filter</th> </tr> <tr> <td><a href="#set1">1</a></td> <td>run09</td> <td>r_harris</td> <td>6605/32</td> </tr> whereas code changes both first , second instance of <tr> sed '1,/<tr>/s/<tr>/<tr class="active">/' file1 >> temp2.txt can explain what's going on? <tr class="active"> <th>set</th> <th>run</th> <th>continuum<br>filter</th> <th>narrow band...

spring mvc - autowiring and injecting the properties using deployment by maven -

not able run , showing errors on console giving error when running on jetty cannot autowire autowiring done here org.springframework.beans.factory.beancreationexception: error creating bean name 'employeecontroller': injection of autowired dependencies failed; nested exception org.springframework.beans.factory.beancreationexception: not autowire field: private com.dineshonjava.service.employeeservice com.dineshonjava.controller.employeecontroller.employeeservice; nested exception org.springframework.beans.factory.beancreationexception: error creating bean name 'employeeservice': injection of autowired dependencies failed; nested exception org.springframework.beans.factory.beancreationexception: not autowire field: private com.dineshonjava.dao.employeedao com.dineshonjava.service.employeeserviceimpl.employeedao; nested exception org.springframework.beans.factory.beancreationexception: error creating bean name 'employeedao': injection of autowired dependenci...