Posts

Can you grab a file with PHP through a form with $_SERVER['PHP_SELF']; action? -

i have email attachment form working fine when <form action="processingtheformfile.php"> sent php file process. however, when try implement same idea form <form action="<?php echo $_server['php_self']; ?>"> , use if(isset($_post['submit'])) { $tmp_name = $_files['filename']['tmp_name']; $type = $_files['filename']['type']; $name = $_files['filename']['name']; $size = $_files['filename']['size']; before html of file, attachment ends being noname.txt everytime, regardless of file type. is because $_files cannot work on <?php echo $_server['php_self']; ?> action, or should elsewhere dilemna? pray makes sense.... forms used uploading files need have enctype="multipart/form-data" make work. here's example: <form method="post" enctype="multipart/form-data" action=""> although r...

javascript - jquery tooltip throwing error: function not defined -

i trying custom tooltip on image. during run time says "method or property tooltip not defined" here code <script src="/full/jquery.tools.min.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function () { $("#content img[title]").tooltip(); }); </script> <style type="text/css" > .tooltip { display:none; background:transparent url(images/blackarrow.png); font-size:12px; height:70px; width:160px; padding:25px; color:#eee; }</style> </asp:content> <div id="content"> <img alt="" src="images/help1.png" title="your comes here" /></div> try include plugin directly developer, test. if works, there problem code. i've removed [title] <img> , if need it, p...

Jasper report line chart with two date type axis -

Image
hello ! i need create report attachment shows jasper reports. i've tried line chart. result : line chart expects 2 number type field axises. i've tried time series. result : time series expect 1 number , 1 date type field axises. i have use dates, need chart type can handle dates. any suggestion how can solve ? i've tried google @ least 10 hour. i'm desperated. thanks ! i think i've solved problem. i've written customizer class : package com.test; import java.text.dateformat; import java.text.simpledateformat; import net.sf.jasperreports.engine.jrchart; import net.sf.jasperreports.engine.jrchartcustomizer; import org.jfree.chart.jfreechart; import org.jfree.chart.axis.dateaxis; import org.jfree.chart.axis.datetickunit; import org.jfree.chart.plot.xyplot; public class trendcustomizer implements jrchartcustomizer { public void customize(jfreechart chart, jrchart jasperchart) { dateaxis xaxis = new dateaxis(); dateaxis yaxi...

twitter bootstrap - Less CSS - access part of class name and use in mixin -

in less, possible access part of class name , use within mixin? this best explained example: i have grid have declared follows: .columns (@columns) { //code here generate column widths } //this problem is: .column-1 { .col (1) } .column-2 { .col (2) } .column-3 { .col (3) } // etc etc obviously there lot of repetitive code going on here. ideally able not have declare column-1 column-2 etc , have way, regex perhaps, of parsing class name, , using value after dash automatically calculate column width. twitter bootstrap doing similar cant understand it: .spanx (@index) when (@index > 0) { (~".span@{index}") { .span(@index); } .spanx(@index - 1); } .spanx (0) {} i think you'll understand : .columnx (@index) when (@index > 0) { // guarded mixin: use mixin when condition true (like if statement) (~".column-@{index}") { // outputs .column-0 class name .col(@ind...

python - Obscure curses error message when creating a sub window -

i have simple python curses code creates subwindow. however, in process of running function window.subwin() fails message: here test case: import curses if __name__ == '__main__': curses.initscr() window = curses.newwin(15, 40, 7, 20) window.box() window.refresh() subwindow = window.subwin(5, 10, 2, 2) subwindow.box() subwindow.refresh() subwindow.getkey() curses.endwin() produces following output: traceback (most recent call last): file "c.py", line 12, in <module> subwindow = window.subwin(5, 10, 2, 2) _curses.error: curses function returned null is there way more descriptive message? the error happens when not possible create sub-window (illegal operation). can happen because asking paint sub-window outside of window. the method subwin receives absolute coordinates (with respect screen, not parent window). fail if subwin coordinates outside of window . reason fail: width or height overfl...

c++ - Linking to older version of gcc -

i have centos 6.2 (64bit gcc 4.4.6 default). unfortunately, code compiles gcc 3.4.6, installed gcc separately (from source) under /home/rajat/local. on linking simple "hello world" program, following. >ldd a.out linux-vdso.so.1 => (0x00007fff215ff000) libstdc++.so.6 => /home/rajat/local/lib64/libstdc++.so.6 (0x00007f11853e7000) libm.so.6 => /lib64/libm.so.6 (0x00000033be400000) libgcc_s.so.1 => /home/rajat/local/lib64/libgcc_s.so.1 (0x00007f11851ce000) libc.so.6 => /lib64/libc.so.6 (0x00000033bd000000) /lib64/ld-linux-x86-64.so.2 (0x00000033bcc00000) while stdc++ , gcc link 3.4.6 libraries, libm , libc still link default libraries. ok?? 3.4.6 installation did not produce libm or libc libraries? yes, that's ok. the libc/libm part of glibc, not gcc compiler. libstdc++ on other hand ls part of gcc.

git - Unmerged Commits going off the track with no future -

Image
i new git , trying grasp ins , outs of it. have 1 efficiency related question. in picture below please see red arrow. my question can scenario named mean line associated red arrow has no future. different color lines technicaly termed as. understanding concept of wanted google problem due limited git vocabulary wasnt able search meaning ful. after tellinng me names of these two. my next , important question should these red arrow lines considered problem ?. if yes, why , how reolve those. this isn't native git; you're using sort of gui tool. won't try guess, , practical point of view doesn't matter long it's sensible. the colored lines branches. dots on each line represent commits. whether or not colors mean specific, other way differentiate branches, gui. the top-most dot of each line branch head. red arrow pointing merge commit never merged rest of ongoing development--or vice-versa, depending on point of view. it's informational, , not ...