Posts

How to create a form programmatically with a couple components on it in Delphi -

Image
i'm working delphi 7 , i'm trying create form programmatically. here's form class stub: unit clststudentinfoform; interface uses forms; type tstudentinfoform = class (tform) end; implementation end. i have button on main form (that's regular form that's supposed create , show form above @ run-time) , when clicked creates , shows student form modal window. show form there's nothing on it. thing can click close button @ upper-right corner of window close it. procedure tlibraryform.btnshowstudentifoformclick(sender: tobject); var f : tstudentinfoform; begin f := tstudentinfoform.createnew(self); f.showmodal; f.free; f := nil; end; i have no idea how add components programmatically-created form (not @ run-time, source code). can me write code adds okay button student form sets caption , form's height , width (the code has written in student form file)? any suggestions , examples highly appreciate...

knockout.js - how to show one validation icon for radiobuttons group -

i'm using knockoutjs , knockout validation plugin. i show 1 validation icon radio group, after 'question 1' title. how can this? <label>question 1:</label> <div> <!-- ko foreach: answers --> <div> <input type="radio" data-bind="attr: { value: id, id: id, name: 'answers' }, checked: $parent.selectedvalue" /> <label data-bind="text: text, attr: { for: id }"></label> </div> <!-- /ko --> </div> there jsfiddle example also second question - why validation icons displaying in example? thanks! you can put validation message on element using validationmessage binding handler: this shows validation message : <label>question 1: <span data-bind="validationmessage: selectedvalue"></span> this example shows custom message template : <label>question 1: <input style="di...

html - modal window not poping up in ie and Nivo Image Slider image not working after uploaded -

first question: have set page use modal windows pop brief description waterpark attraction , nivo image slider contains few shots of each attraction. can not figure out why window not pop in ie. modal window works in every other browser have tested??? in ie none of buttons on particular page able clicked? second question: when test nivo slider locally works fine. however, once upload slider doesn't work. have made sure scripts, css, images, , pages have been uploaded. i'm stumped. i no means professional @ appreciated. the link page http://splashwaywaterpark.com/attraction call jquery before files jquerymodal.js file come after jquery. solves error in ie script5009: '$' undefined jquerymodal.js, line 2 character 1 so reorder this <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script> <script type="text/javascript" src="scripts/jquerymodal.js"></script> in popbox.css ...

perl - perlbrew fails with "Can't locate Devel/PatchPerl.pm" -

perlbrew fails can't locate devel/patchperl.pm . more precisely, fails run of patchperl spawned off perlbrew . there is in fact devel/patchperl.pm accessible via paths in environment variable perl5lib , perlbrew unconditionally deletes variable before runs perlpatch : delete $env{$_} qw(perl5lib perl5opt); i can't find in perlbrew documentation justifying maneuver. can explain why perlbrew this? edit: below bash script reproduces problem. run (with suitable <path_to_script> ): % env -i home=$home shell=/bin/bash /bin/bash --noprofile --norc bash-3.2$ /bin/bash --norc --noprofile <path_to_script> the script's running time 4 minutes on machine. last few lines of output, including lines showing error below: (cd /tmp/perlbrew_root/build/perl-5.16.3 && rm -f config.sh policy.sh && patchperl && sh configure -de '-dprefix=/tmp/perlbrew_root/perls/perl-5.16.3' '-a'eval:scriptdir=/tmp/perlbrew_roo...

sql - extract field only when we have least one registration -

i have 2 tables : author(id_author, date_conf, id_visitor, id_article) visitor(id_visitor, email, registration_date, registration_fees, ...) i want extract articles (id_article) when @ least 1 author have done registration (registration fees not empty or null (logically)) for example, when natural inner join (id_author, registration_fees, id_article, ...) (0, 123.1, 1) (1, null, 1) (2, null, 2) it should extract id_article because has 123.1. authors of id_article 2 didn't pay registration. how can please? i think want want: select id_article author join visitor v on a.id_visitor = v.id_visitor registration_fees not null group id_article

timeout - How to read for X seconds maximum in C++? -

i want program wait read in fifo, if read (i use std::fstream ) lasts more 5 seconds, want exit. is possible or have use alarm absolutely? thank you. i not believe there clean way accomplish portable c++ solution. best option use poll or select on *nix based systems , waitforsingleobject or waitformultipleobjects on windows. you can transparently creating proxy streambuffer class forwards calls real streambuffer object. allow call appropriate wait function before doing actual read. might this... class mystreambuffer : public std::basic_streambuf<char> { public: mystreambuffer(std::fstream& streambuffer, int timeoutvalue) : timeoutvalue_(timeoutvalue), streambuffer_(streambuffer) { } protected: virtual std::streamsize xsgetn( char_type* s, std::streamsize count ) { if(!wait(timeoutvalue_)) { return 0; } return streambuffer_.xsgetn(s, count); } private: b...

r - Insert a non-character if a criteria is TRUE -

is possible insert non-character, in case -, if particular criteria met? for example: if there 5 numeric characters (12345), insert - after 2nd numeric character (12-345). i trying fix street addresses. thanks! s = "abc 12345 def" sub("([0-9]{2})([0-9]{3})", "\\1-\\2", s) # "abc 12-345 def" this find first instance of 5 numbers in row , add "-" after second number. see http://stat.ethz.ch/r-manual/r-patched/library/base/html/regex.html r regex syntax.