Posts

Showing posts from April, 2013

sql - Best method to scrape large number of Wikipedia tables to MySQL database -

what best programmatic way grab html tables of wikipedia main article pages pages' titles match keywords? take column names , table data , put them database. would grab url , page name attribution. i don't need specifics recommended methods or links tutorials perhaps. the easy approach not scrape wikipedia website @ all. of data, metadata, , associated media form wikipedia available in structured formats; preclude need scrape web pages. to data wikipedia database (which may search, slice , dice 'til heart's content): download data files . run sqlize tool of choice run mysqlimport drink coffee. the url of original article should able re-constructed page title pretty easily.

java - Save string path in a database -

java mysql database i'm doing project on saving string path name like, "c:\desktop\" database. had create entity class update path name database, in java eclipse when run program display path store in database in format, "c:\desktop\" in database column path store "c: desktop", without '\' a simple solution replace the "\" before store in database. try: string.replace("\","@"); then slashes @ symbols. when read value again, can other way.

javascript - Mouse over not working -

i have div waiting move on event. places div information it. the problem have getting remove event listener & remove div created... reason cannot find child div made. so script tried: div.addeventlistener('mouseover',bubble_info,false); function bubble_info(e){ var x = e.pagex + 50; //push 50px right var div = document.createelement('div'); div.style.position = 'absolute'; div.style.top = e.pagey; div.style.left = x; div.classname = 'bubble'; div.innerhtml = 'testing div'; this.appendchild(div); //stop firing if mouse moves around on parent still "over" parent this.removeeventlistener('mouseover',bubble_info,false); //when mouse out occurs below should fire this.addeventlistener('mouseout',function(){clear_hover.call(this,div);},false); } function clear_hover(child){ //remove bubble div made child.parentnode.removechild(chil...

c# - How can I force <a> links to files trigger download in the browser (and not open) -

i knowt may repeated question couldn't find solution case. here's doing:i want create page admin of site can upload files , make description each file,and users can download these files.i created admin page fileupload control saves files in downloads/files .then created database 3 columns: 1- downloadtitle 2- downloadmain 3- name .the admin can enter download title , download main(the description of file) each file.and name column filled automatically uploaded file's name. here did download page(after getting data database using code behind): <asp:repeater id="downloadsrepeater" runat="server"> <itemtemplate> <div class="downloadtitle"><%#eval("downloadtitle") %></div> <div class="downloadmain"><%#eval("downloadmain") %> <div class="downloadbuttom" dir="ltr"><a href="/downloads/files/<%#eval(...

Unicode are of different type? what happens there? -

Image
how many types of unicode available ? scenario when submit मनोज display मनोज when submit ÖîjètÅÔe display &#214;&#238;j&#232;t&#197;&#212; in computer. मनोज different type ÖîjètÅÔe in unicode approach? there 1 unicode. unicode doesn't have code pages ansi. but unicode can written in couple of ways, utf-8, utf-16, utf-32. , there's difference between utf-16 little endian , utf-16 big endian well. please read the absolute minimum every software developer absolutely, positively must know unicode , character sets (no excuses!) . it's great explanation of differences between them, , more.

javascript - Creating a nested JSON object dynamically? -

i there cannot seem functionality going planned. i have json 'jsondata' contains formula of different terms "jsondata":{ "a" : "b + c", "b" : "d + e", "d" : "h + i", "c" : "f + g" } what trying have function pass 1 arguments 'mainitem'(ie. 1 of key in 'jsondata' example a in 'jsondata'). within function formula json data(for example 'mainitem' , b + c formula) , check dependency of child component of formula i.e check whether b , c have dependency down line in json data. if has dependency added child component parent example if b have formula in json data. b added 'mainitem' in child component of parent 'mainitem' a . @ end of code, get. { mainitem : "a", formula : "b+c", childcomponent: { mainitem: "b", fo...

animation - Using ScreenSlider from developer.android.com . How to jump to specific page? -

i using screenslider http://developer.android.com/training/animation/screen-slide.html . running using 5 pages . want directly jump 1 page . e.g user @ 2 page , on clicking button jumps 5 page . how implement this. there predefined methods .please help? use setcurrentitem http://developer.android.com/reference/android/support/v4/view/viewpager.html#setcurrentitem(int mviewpager.setcurrentitem(4) // moving 5th page or mviewpager.setcurrentitem(4, true) // move with animation

Grab values from checked checkboxes and put them in an array using Javascript/jQuery -

i want values of checked checkboxes name="car_type[]" , alert final array values. how that? far, have code. it's not working. don't know how loop through checked checkboxes , add values array car_type_arr . cannot alert final array using alert(car_type_arr); . help. $().ready(function(){ $('.prettycheckbox').click(function(e) { e.preventdefault(); var car_type_arr = []; $("input:checkbox[name=car_type]:checked").each(function() { // here need add values array in php // e.g. $car_type_arr[] = $the_grabbed_value; // using javascript syntax // how that? }); // need alert array, how in js? alert(car_type_arr); return false; }); }); try below code: <input type="chec...

iphone - How to use iOS TWRequest for iOS 5 for getting Twitter User Details -

how use twrequest both ios 5 getting twitter user details, twrequest working earlier , using in way nsurl *url = [nsurl urlwithstring:@"https://api.twitter.com/1/users/show.json"]; nsdictionary *params = [nsdictionary dictionarywithobjectsandkeys:twittername,@"screen_name",nil]; request = [[twrequest alloc] initwithurl:url parameters:params requestmethod:twrequestmethodget]; but recently, twitter closed api version 1 , implemented version 1.1, , presently above logic not working in ios 5, due api deprecation may be... i using slrequest ios 6 working perfect, know how can twitter user details in ios 5 try : nsurl *url = [nsurl urlwithstring:@"https://api.twitter.com/1.1/users/show.json"]; nsdictionary *params = [nsdictionary dictionarywithobjectsandkeys:twitte...

Unit Testing Spring @Repository & Hibernate -

i'm new spring. in past when use hibernate. can test dao because automatically sessionfactory. but when using spring (@repositry , @entity) only. i can't seems unit test code because .gethibernatetemplate() keeps return null. i suspect hibernatesession not initialize. may know spring, how can unit test against database? without code example can speculate. test repositories / entities unit test class requires spring context initalised. @runwith(springjunit4classrunner.class) @contextconfiguration(locations="classpath:meta-inf/test-context.xml") public class yourtestclass { @autowired <<autowire repository/sessionfactory>> } fyi: test-context.xml assumes have configured spring beans via xml , not javaconfig.

transparency - Delphi XE2: How to draw transparent GIF images on toolbar using TImageList -

Image
using: delphi xe2; vcl forms application is possible draw transparent gif images on actiontoolbar (with actionmanager) using timagelist? i have been trying black background on toolbuttons. the gif images 256 colors; , have transparency (verified opening images in corel paintshoppro). on imagelist, have set properties: colordepth := cd32bit, drawingstyle := dstransparent. screen captures of form @ design-time , run-time: any tips or workaround appreciated! save gif png. png has alpha channel , supports semi transparency

css - Dropdown list in line with and on top of text -

i have text 1 word clickable , upon being clicked, dropdown list of items should appear on top of text (with text staying in same place). i thinking of using divs instead of unordered list, because feel easier position. however, open kinds of solutions. html: this sentence, <div class="dropdown-list"> clickable word <div>list item 1</div> <div>list item 2</div> <div>list item 3</div> </div>. plus more text fill page. css: .dropdown-list { display: inline-block; } as can see in jsfiddle http://jsfiddle.net/hlyaf/8/ divs height changes , extends height of whole line, instead of dropping down on top of text. is there way achieve desired effect? please use tutorial have made you http://jsfiddle.net/hlyaf/12/ body { font-size: 20px; } .dropdown-list { display: inline-block !important; background: #ccc; position:relative; } .dropdown-list div.drop { display: no...

php - Is it a right way to create a content sharing/commenting website? -

i'm not experienced web developer please don't judge me if question sound stupid have no idea how accomplish task. basically, want create simple website user can upload picture ant receive comments/feedback people shares picture with. i'm curious, ok build complex link (of page picture) user share others , visitors comment on it? it sounds solution me i'm not competent enough distinguish if it's practice. moreover, assure other people (who don't have link) not page picture? i think of using joomla cms, custom article template (for displaying pictures + comments) , extension produce complex link. please share thoughts this. i'm not sure if i'm on right track. thank you. you can try bt galley of bowthemes. made image-video management component called bt media , built in bt gallery template. the link http://bowthemes.com/joomla-templates/bt-gallery.html

Blocked a prezi iframe. Protocols, domains, and ports must match. -

i'm on localhost, trying embed prezi presentation website. following error message. how solve it? blocked frame origin "http://prezi.com" accessing frame origin "http://localhost". protocols, domains, , ports must match. code: <iframe src="http://prezi.com/embed/auxybvbmwavk/?bgcolor=ffffff&amp; lock_to_path=1&amp; autoplay=0&amp; autohide_ctrls=0&amp; features=undefined&amp; disabled_features=undefined" width="700" height="550" frameborder="0"> </iframe>

Dynamic categories with docpad -

i have following posts in blog : src/documents/posts/foo.html.md --- category: cooking --- src/documents/posts/bar.html.md --- category: programmation --- i generate following routes : http://example.org/cooking/ http://example.org/programmation/ where each route have collection posts in selected category. posts still in standard place : http://example.org/posts/foo.html http://example.org/posts/bar.html bonus point : able list categories in layout. : <% cat in @getcategories() %> <a href="<%= cat.route %>"><%= cat.name %></a> <% endfor %> is there plugin existing give these kind of functionalities ? if not, what's best way starting implementing ? i have seen setfilter method in this answer , i'm still struggling find out how generate new pages after parsing every posts fetch categories. if dynamic page generation cannot achieved (which understand, since require parse pages in specific order), h...

asp.net mvc - C# MVC powershell -

this question has answer here: execute powershell script c# commandline arguments 7 answers i'm trying build c# mvc site , integrate powershell scripts. idea use scripts i've written. cannot find way this. is there knows find documentation? thank very much. paulo really simple code project solution should out http://www.codeproject.com/articles/18229/how-to-run-powershell-scripts-from-c

c# - Two implementations of a method? (VS2012 + ReSharper 7.1) -

Image
when right-click method , select go implementation presented 2 implementations; 1 in source code , 1 reference... in example, emailservice in different project loaded current visual studio solution , referenced project reference. selecting reference 1 seems nothing, whereas selecting source code 1 takes me implementation of method (as expected). this has happened on couple of different development machines, in different projects. what causing this, , possible resolve issue go implementation takes me directly source code implementation? this happening in visual studio 2012 resharper 7.1 installed. with alt-shift-t or whatever have symbol search, checkbox include library types selected? if not, may this resharper bug . can fixing if create small reproducible example , attach there ;)

c++ - How to print value in boost::u32regex & reg -

i want print value in boost::u32regex & reg using std::cout . for boost::regex & reg , can print reg.str() not able use str() boost::u32regex . can please tell me ? it seems type used behind boost::u32regex not compatible cout . seems using uchar32 icu library. you can print regex value using iterators : #include <boost/regex.hpp> #include <boost/regex/icu.hpp> #include <unicode/ustream.h> void printregex32( const boost::u32regex& r ) { boost::u32regex::iterator = r.begin(); boost::u32regex::iterator ite = r.end(); ( ; != ite; ++it ) { std::cout << unicodestring(*it) << std::endl; } } this working me. not easy printing boost::regex value works. suggest create function so, in example. edit : you can try code : boost::u32regex r = boost::make_u32regex("(?:\\a|.*\\\)([^\\\]+)"); printregex32( r ); i can print reg.str() just information, boost::basic_regex has o...

c# - How do i create a metadataId for a custom class derived from OrganizationRequest? -

i have created custom retrieve entity response class crm2011 serialize class. entity response class derived organizationrequest class. shown below: public partial class retrieveentityrequest : organizationrequest { public retrieveentityrequest() { } private system.guid metadataidfield; public system.guid metadataid { { return this.metadataidfield; } set { this.metadataidfield = value; } } public entityfilters entityfilters { get; set; } public string logicalname { get; set; } public bool retrieveasifpublished { get; set; } } now when run code shown below using (organizationserviceproxy serviceproxy = new organizationserviceproxy(organizationuri, homerealmuri, credentials, null)) { try { serviceproxy.enableproxytypes(); request = new crmutilities.retrieveentityrequest(); request.logicalname=entityname; request.entityfilte...

jsf - How to access the form objects in bean -

iam calling dialog using ajax, problem have defined form in dialog , accepting data's when click save want details in bean. my issue: 1 ) when click save button not hit bean. 2) iam not able access objects of form in bean. thanks in advance :) my jsf file <h:form id="outcompform"> <table border="0" class="innerbox" width="60%"> <tr><th colspan="7" align="center" class="clstitle">outbound complaints</th></tr> <tr> <td>consignment no </td> <td>consignor branch</td> <td>consignor </td> <td>contact no </td> <td>remark</td> </tr> <tr> <td><h:inputtext id="acno" value="#{outbound.accno}...

wpf - Why my stackpanel items always aligning to vertical if even i mentioned horizantalmode in silverlight? -

i wrote below code in page: <stackpanel horizontalalignment="left" height="166" margin="10,602,0,0" verticalalignment="top" width="1346" x:name="thumbnailviewer"> <scrollviewer x:name="thumbnailviewerscroller" padding="0" borderthickness="0" verticalscrollbarvisibility="hidden" horizontalscrollbarvisibility="hidden"> <stackpanel orientation="horizontal" > <itemscontrol x:name="userlist"> <itemscontrol.itemtemplate> <datatemplate> <!--<stackpanel orientation="horizontal">--> <image source="{binding imageurl}" tag=...

php - Custom layouts for custom post types? (wordpress) -

i'm intending have few different custom post types want them have different layouts of normal posts. normal posts have 2 different appearances themselves, 1 index page , 1 when click through permalink page. for custom posts want same thing (two different layouts, both different normal posts) reason code doesn't seem making difference. i've far used custom post template plugin tried code in post-[postype].php file, both seemed ineffective. for single.php here's code - <div id="primary" class="content-area"> <div id="content" class="site-content" role="main"> <?php while ( have_posts() ) : the_post(); ?> <!--- post wrapper home/post ---> <?php if ( is_home()) { echo '<div class="fullposthome">' ; } else { echo '<div class="fullpost">' ; } ?> <?php if( get_post_meta($post->id, 'imgtest', true) ) { ?...

Scaling Icon to fit in Imageview Android -

i have list in application contains installed applications icons, i'm able render installed applications , icons consuming lot of memory loads drawables(icons) of installed applications memory well. i want scale down icon , load memory reduce memory usage of application. can tell me how can achieved. note : if png format not compress image because png lossless format. , applications icons in png format any way reduce memory allocation icons?? yeah it's in docs: http://developer.android.com/training/displaying-bitmaps/index.html calculate sample size, i.e. size of bitmap want: public static int calculateinsamplesize( bitmapfactory.options options, int reqwidth, int reqheight) { // raw height , width of image final int height = options.outheight; final int width = options.outwidth; int insamplesize = 1; if (height > reqheight || width > reqwidth) { // calculate ratios of height , width requested height ,...

symfony - Form with entity field, saved in database rare string -

i've form: <?php namespace feb\twitterbundle\form; use symfony\component\form\abstracttype; use symfony\component\form\formbuilderinterface; class twitterposttype extends abstracttype { public function buildform(formbuilderinterface $builder, array $options) { $builder->add('titulo') ->add('tweet', 'textarea') ->add('photo', 'file', array('required' => false)) ->add('tags', 'entity', array( 'class' => 'febtagsbundle:tag', 'property' => 'tag', 'empty_value' => 'selecciona tags', 'multiple' => true)); } public function getname() { ...

php - cURL : "Couldn't connect to host" -

i have solved in past, cannot remember how. so, i'm trying fetch webpage server, using proxy. here code : function curlfile($url,$proxy_ip,$proxy_port,$loginpassw) { $ch = curl_init(); curl_setopt($ch, curlopt_url, $url); curl_setopt($ch, curlopt_header, 0); curl_setopt($ch, curlopt_returntransfer, 1); curl_setopt($ch, curlopt_proxyport, $proxy_port); curl_setopt($ch, curlopt_proxytype, 'http'); curl_setopt($ch, curlopt_proxy, $proxy_ip); curl_setopt($ch, curlopt_header, false); curl_setopt($ch, curlopt_verbose, false); curl_setopt($ch, curlopt_proxyuserpwd, $loginpassw); curl_setopt($ch, curlopt_httpproxytunnel, 0); $data = curl_exec($ch); if(curl_errno($ch)){ echo 'curl error: ' . curl_error($ch); } print_r(curl_getinfo($ch)); print_r(curl_error($ch)); print_r($data); curl_close($ch); return $data; } all outputs : curl error: couldn't connect hosta...

Jquery Modal and css styles -

i want set background color of elements within dialog has class of matchedon . i have following code: $('.matchedon').each(function () { if ($(this).html() == matcheditem) { $(this).css({ "color": "green", "background-color": "#ffff00" }); } }); matcheditem local variable used check content of element. example, if element class of matchedon , contains 'fred', 'fred' matcheditem , set neccessary css. this works fine first tab within modal. however, though have class defined on second tab, 'fred' css isn't applied. i have jquery code, after html drawn modal, it's not issue of checking against isn't there. * edit ** hi it's senstive data, can't display all. however, each tab has following <div id="tab6"> <div id="results1"> <div class="message"> <h2>title</h2> ...

QR code reader Android other than zxing -

i need implement qr code reader inside app. have gone across zxing, find little bit intimidating. need inside app. appreciated. zbar bar code reader here http://sourceforge.net/projects/zbar/?source=dlp it's faster zxing , easier implement. alternatively there no need install zxing implementing qr reader, create class intentintegrator.java , intentresult.java file , call activity. hear source code this.... https://code.google.com/p/dwivedi-ji-qr-code-reader/source/checkout

windows - emacs org-mode : continuous clocking does not work -

i activated option org-clock-continuously recover gaps in clocking , continuous clocking not seem work. i fixing endtimes clocked items, because forgot clock out (using function org-resolve-clocks , using k option (keep x minutes). when clocking in afterwards (in agenda view) after having fixed last clock, org-mode clocks me in current time instead of last time clocked out (according clock resolution). example: todo sample todo clock: [2013-07-31 mi 12:53] m-x org-resolve-clocks -> k -> 5 clock: [2013-07-31 mi 12:53]--[2013-07-31 mi 12:58] => 0:05 agenda view: clock in on different task (! no question, if want clock in or @ last clock out time !) ** todo sample todo 2 clock: [2013-07-31 mi 13:22] any ideas how fix or option have activate in addition org-clock-continuously? i working on windows 7 professional gnu emacs (gnu emacs 24.3.1 (i386-mingw-nt6.1.7601)) , orgmode 8.0.3

javascript - Change Div Position from Absolute to Fixed with Horizontal Scroll -

i have site scrolls horizontally using horizontal scroll plugin on @ https://github.com/brandonaaron/jquery-mousewheel . no problems there. my questions is, have 250px wide div 100% height starts 100px right side of screen. scroll (horizontally), div scrolls towards left , disappears off screen. div has position set absolute. div become fixed left hand side of screen once div hits left side of browser window. i'm guessing need use js change css of div once reaches particular place (far left) on screen. i've seen quite few sites achieve vertical scrolling, menu bar becomes fixed @ top of screen once hits top. menu may have started half way down page , moved upwards on scroll. i'm wanting achieve same effect on horizontal plane. i'm relatively new code in general, , brand new javascript. may biting off more can chew, challenge. help. the css code changing is #header { width: 250px; background: rgba(22,22,22,.85); height: 100%; position: absol...

service - Create server panel like cPanel -

i have vps, cent os 6.4 64bit i want create panel (like cpanel) , want make accessible opening port (serverip:2082 example). have created php files of own panel don't know linux services. what type of code must make , can put it? thank in advance! no offense, if don't know linux service 99% away creating own panel. first need understnad cpanel not modify system files allow hosting , managing database, these without playing system security. but start need web server host cpanel. prefer different webserver host website, reason? if default apache inaccessible or crash, panel crash it. need learn mysql, or database want manage through panel, dns binding, name servers, regular expression manage text files of configuration etc. i know these because built cpanel application, , know not easy job level of question asked.

asp.net - Concurrency check when updating using GridView -

with sqldatasource, how can sure data i'm going update not modified in meantime when fetched data , when i'm make update. <asp:sqldatasource id="sqldatasource1" runat="server" connectionstring="<%$ connectionstrings:chartdatabaseconnectionstring %>" selectcommand="select * [student]" updatecommand="update [student] set [studentname] = @studentname, [dob] = @dob, [age] = @age, [course] = @course, [city] = @city, [mobileno] = @mobileno [studentid] = @studentid"> is there gridview method or parameter can use ? there propery on sqldatasource named conflictdetection . setting property compareallvalues may trick you.

What is bash/zsh "|&" syntax mean? -

what |& syntax means? example: tree |& less i see no difference tree |& less . from bash manual : command1 [ [| or |&] command2 …] if |& used, standard error of command1 connected command2 ’s standard input through pipe; shorthand 2>&1 | . implicit redirection of standard error performed after redirections specified command. in zsh too, |& shorthand 2>&1 |

python - Drop NaNs from a pandas dataFrame -

i dont understand how nan's being treated in pandas, happy explanation, because logic seems "broken" me. i have csv file, im loading using read csv. have "comments" column in file, empty of times. i've isolated column, , tried varies ways drop empty values. first, when im writing: marked_results.comments i get: 0 vp 1 vp 2 vp 3 test 4 nan 5 nan .... the rest of column nan. pandas loading empty entries nans. great far. im trying drop entries. iv tried: marked_results.comments.dropna() and recieved same column. nothing dropped. confused, i'd tried understand why nothing dropped, tried: marked_results.comments==nan and recieved series of falses. nothing nans... confusing. tried: marked_results.comments==nan and again, nothing falses. got little pissed there, , thought smarter. did: in [71]: comments_values = marked_results.comments.unique() comments_values out[71]: array(['vp', 'te...

How to build a ViennaCl project using Visual C++ 2010? -

i have built viennacl using mingw32-make , run of generated tests on windows 7 x64. when try build new viennacl project using visual c++ 2010 ultimate, linker gives me below answer: error lnk2019: riferimento al simbolo esterno _clgetplatformids@12 non risolto nella funzione "class std::vector > __cdecl viennacl::ocl::get_platforms(void)" code: #include "stdafx.h" #include <process.h> #include <viennacl\ocl\device.hpp> #include <viennacl\ocl\platform.hpp> int _tmain(int argc, _tchar* argv[]) { typedef std::vector< viennacl::ocl::platform > platforms_type; platforms_type platforms = viennacl::ocl::get_platforms(); system("pause"); return 0; } p.s. sorry linker's italian answer. basically, linker cannot find function _clgetplatformids. in advance. pietro.

Meteor Streams : client doesn't receive streams -

i'm working on simple app based on meteor , meteorstreams. aim simple : 1 user click on button create room other users join room users can emit streams simple message creator listen message , display them in fact : message other users sent (log in server script), creator doesn't receive them. if reload page of creator, messages sent other user. i don't understand why doesn't work first time. i use meteor-router routing system. code can seen here https://github.com/rebolon/meetingtimecost/tree/feature/pokervoteprotection for client side code availabel in client/views/poker/* , client/helpers server stream's code in server/pokerstreams.js application can tested here : http://meetingtimecost.meteor.com creator must logged. if have idea, welcome. thanks ok, ok, after doing debugging, understand wrong in code : it's easy in fact. problem comes fact forgot bind stream.on event deps.autorun. result part of code not manag...

r - How to quantify overlap between three periods? -

i writing function calculate duration of overlap between 3 periods, having trouble in finding out how efficiently program this, can me out. i have dataset of people have been followed on time. starting date, , time spent in study differs between participants. each participant, calculate how many days in study in specific year , in 5-year age category was. example, if in study 01-01-2000 01-06-2001, , born on 15-06-1965, contribute 166 days 30-34 year age category in 2000, 200 days in 35-39 year age category in 2000 , 151 days in 35-39 year age category in 2001, while spent 0 days in other categories. in other words: quantify overlap between these periods: a = entering study ending study (varies among participants, fixed value within participant) b = begin specific year end specific year (same among participants, varies within participant) c = entering specific 5-yr age category exiting specific 5-yr age category (varies among participants, varies within part...

html - form background style not expanding with form in IE8.0 -

Image
my css code form, form { margin:0 auto; text-align:left; width:740px; border:1px solid #ccc; padding:15px; background:#fff; border-radius: 10px; -moz-border-radius: 10px; -webkit-border-radius: 10px; box-shadow: 0 0 4px #ccc; -webkit-box-shadow: 0 0 4px #ccc; -moz-box-shadow: 0 0 4px #ccc; behavior: url(./border-radius.htc); font-family:calibri; height: auto; } js fiddle i want form background expand form, happening in chrome not in ie8. i have hidden div set visible depending on selections. also how can css formatting of chrome , ie alike. ex: if want make 2 div visible form expand accordingly thing form border not extend in ie. please check out entire working code in jsfiddle create container div goes around form (in case called formcontainer) , move following css ...

Java Generics wildcard extends final class -

why java doesn't throw warning when compiling testgenerics class , considering string class final , cannot extended? import java.util.*; public class testgenerics { public void addstrings(list<? extends string> list) { // code here } } } let's had method this: public list<? extends t> filteroutnulls(list<t> input) { ... granted, not best signature in world, still legal. happen if passed list<string> method? according signature, returns list<? extends string> . if java disallowed type, it'd impossible use method list<string> (or @ least, it'd impossible use return value). secondarily, extends syntax still useful in case, since list<string> , list<? extends string> have different restrictions -- specifically, can't add null literal list<? extends string> . i'll use ? extends signify collection read-only (since t s can pass in null ), , ? super ...

user interface - Slick2D GUI Button listener -

i'm trying make button in slick extending abstractcomponent: public class standardbutton extends abstractcomponent { protected int x; protected int y; protected int width; protected int height; protected string text; public standardbutton(guicontext container,int x, int y, string text, int width, int height,componentlistener listener) { super(container); this.text=text; setlocation(x, y); this.width=width; this.height=height; addlistener(listener); } @override public void render(guicontext container, graphics g) throws slickexception { g.setcolor(color.white); g.setlinewidth(2f); g.drawrect(x, y, width, height); g.drawstring(text, x+5, y+(height/2-4)); } [...] and in state: public class updaterstate extends basicgamestate implements componentlistener { private standardbutton buttonplay; @override public void init(gamecontainer container, final statebasedgame game) throws slickexception { buttonplay=n...

javascript - ng-bind but store internal value -

some server side code (gsp) generating html me so: <span> <g:generateamount /> </span> i'm wrapping in angular controller , want able bind scope variable span : <span ng-bind="subtotal"> <g:generateamount /> </span> problem is, after binding, inner text removed because subtotal isn't set in controller on initialization (although writing controller works fine). ng-model doesn't seem read either. question is there way bind node persist data inside node? instance, in above example, $scope.subtotal equal whatever <g:generateamount /> outputs. able update subtotal controller , have changes reflected. see example: http://jsfiddle.net/robcampo/zg6ge/2/ just create custom directive , value dom before $compile . alternatively can change generated html , put <g:generateamount /> ng-init attribute, like <div ng-controller="myctrl" ng-init="subtotal=<g:generateamo...

caching - How to prevent form fields from repopulating after clicking the back button? -

i have simple form has 4 fields named firstname, lastname, address , phone number. after user fills form , clicks submit button, if goes fine, redirecting user success page. but on clicking browser button success page form field values repopulating on form. how can prevent happening? i have tried code: <cfheader name="cache-control" value="no-cache, no-store, must-revalidate"> <cfheader name="pragma" value="no-cache"> <cfheader name="expires" value="#gethttptimestring(now()-1)#"> but not working. repopulating form fields good thing, stop trying break it. if want prevent duplicate submissions, send unique id (e.g. uuid) along form , keep track of ones you've received (how many keep track of depends on application). if receive duplicate can either ignore (and display appropriate message), or go step further: check whether received data has been submitted or whether it's atte...

mongodb - $Where gives error -

i have collection containing data: { "_id" : objectid("51dfb7abe4b02f15ee93a7c7"), "date_created" : "2013-7-12 13:25:5", "referrer_id" : 13, "role_name" : "physician", "status_id" : "1", } i sending query: cmd { "mapreduce" : "doctor" , "map" : "function map(){emit(this._id,this);}" , "reduce" : "function reduce(key,values){return values;}" , "verbose" : true , "out" : { "merge" : "map_reduce"} , "query" : { "$where" : "this.demographics.first_name=='makdoctest'"} } i getting error as: "errmsg" : "exception: count failed in dbdirectclient: 10071 error on invocation of $where function:\njs error: typeerror: this.demographics has no properties nofile_a:0" as sammaye says in comment: ...

How to subset a list of dataframes in R? -

i have multiple datasets of physical variables, , want work on r. however, use list. here code 1 of dataframe : # table definition df.jannuary <- read.table("c:\\...file1.csv", sep=";") # subset of table containing variables of interest df.jannuary_sub <- subset(df.jannuary, select=c(2:8, 11:12)) # column names colnames(df.jannuary_sub)<-c("year","day","hour","minute","temp_air","temp_eau","humidity_rel","wind_intensity","wind_direction") # aggregation of 4 year-day-hour-minute columns single column , conversion posixct objet through temporary column "timestamp" df.jannuary_sub$timestamp <- as.posixct(paste(df.jannuary_sub$year, df.jannuary_sub$day, df.jannuary_sub$hour, df.jannuary_sub$minute), format="%y %j %h %m", tz="gmt") # getting date new format julian day normal day column called "date" df.jannuary_sub$date ...

ios6 - MPMoviePlayerController load video from Photo library,play so fast -

// cameraviewcontroller.h @interface cameraviewcontroller : uiviewcontroller{ uiimagepickercontroller *_picker; } @property (strong, nonatomic) iboutlet uiimageview *imageview; @property (nonatomic, retain) mpmovieplayercontroller *player; (ibaction)loadimage:(uibutton *)sender; // cameraviewcontroller.m @interface cameraviewcontroller () @property (strong, nonatomic) mpmovieplayercontroller *playview; @end @implementation cameraviewcontroller @synthesize imageview = _imageview; @synthesize player = _player; @synthesize playview = _playview; (void)viewdidload { [super viewdidload]; _picker = [[uiimagepickercontroller alloc] init]; } (void)didreceivememorywarning { [super didreceivememorywarning]; } (ibaction)loadimage:(uibutton *)sender { _picker.delegate = self; _picker.sourcetype = uiimagepickercontrollersourcetypephotolibrary; nsarray *mediatypes = [nsarray arraywithobjects:(nsstring *)kuttypeimage, (nsstring *)ku...