Posts

Replacing a CSS class using PHP? -

i'm building backend web application, possible change design of page. once user has setup design way it, should able save , new design written specific file. for reason, need replace characters between { , } after string, name of class. so simple concept, following class in seperate file load view, style.php. need go from: from <style> .bonus { bottom: 6px; left: 247px; } </style> to <style> .bonus { bottom: 20px; left: 450px; } </style> could recommend me on best way to a) find string in file, b) when found, replace between 2 strings right after first string. thank you. i don't concept of user making changes actual file much. there lot of safer methods user create , maintain custom template without them making changes php file. what storing user's css in field in database? you'd need like: <?php $css = getcssbyuserid($userid); //function runs query on db user-specific css /* $css ...

c# - Log4net doesn't write to file -

i want add new log file.this appender: <appender name="rollingfileappender" type="log4net.appender.rollingfileappender"> <file value="mylogfile.txt"/> <appendtofile value="true"/> <rollingstyle value="size"/> <maxsizerollbackups value="5"/> <maximumfilesize value="10mb"/> <staticlogfilename value="true"/> <filter type="log4net.filter.stringmatchfilter"> <stringtomatch value="test"/> </filter> <filter type="log4net.filter.stringmatchfilter"> <stringtomatch value="error"/> </filter> <filter type="log4net.filter.denyallfilter"/> <layout type="log4net.layout.patternlayout"> <conversionpattern value="%date [%thread] %level %logger - %message%newline%exception"/> </layout> </appender> <root...

no matching functions for call to constructor (c++) -

this question has answer here: what undefined reference/unresolved external symbol error , how fix it? 27 answers edit ok, i've done bit of reading again few hours , think understand c++ oop bit better (at least basics). decided rewrite entire program , code bit @ time , test more. think narrowed errors bit more time. namedstorm.h #include <string> #include <iostream> #ifndef namedstorm_h_included #define namedstorm_h_included // never use using namespce in header, use std instead. class namedstorm{ private: std::string stormname; std::string stormcategory; double maxwindspeed; double stormpressure; static int stormcount; public: // constructor namedstorm(std::string, double, std::string, double); namedstorm(std::string); // destructor ~namedstorm(); // functions int getstormcount(); doub...

javascript - Why do my singular-named routes, with plural equivalents no longer work in Ember.js RC6? -

why singular-named routes, plural equivalents no longer work in ember.js rc6? after upgrading ember.js rc4 ember.js rc6, of routes continue work couple of exceptions: app.router.map -> @route 'note', {path: 'note/:id'} @route 'notes', {path: 'notes'} @route 'attendee', {path: 'attendee/:id'} @route 'attendees', {path:'attendees'} the note , attendee singular routes, stop functioning. i've attempted setup custom controller method using transitiontoroute instead of using linkto helper in handlebars, neither approach works anymore. rolling rc5 or rc4 corrects issue, can assume has router facelift, can't seem find documentation on should doing instead.

html - clear both and divs -

this css #site-content{ margin:25px 0 0 260px; } .site-content{ width:740px; margin:auto; } #site-menu{ float:left; width: 260px; padding: 20px 0; overflow:hidden; } html <div id="site-menu"> <ul> <li class="menu"><a id="menu-glxavor" class="menu" href="/"></a></li> <li class="menu"><a id="menu-mermasin" class="menu" href="/arm/about-us"></a></li> <li class="menu"><a id="menu-usucich" class="menu" href="/arm/for-teachers"></a> <ul id="menu-usucich-sub"> <li class="sub-menu"><a class="a-sub-menu usucich" href="/arm/for-teachers/teacher-schedule">Դասացուցակ</a></li> <li class="sub-me...

android - Displaying custom objects in ArrayAdapter - the easy way? -

i trying display list of bluetooth devices in arrayadapter , , want override default functionality of adapter show objects tostring() . know there solutions extend getview(...) method, feel over-complicating things. want override how string display built. bluetooth devices using getname() instead of tostring() . so i've created custom arrayadapter below, , ideally have method getdisplaystring(t value) public class myarrayadapter extends arrayadapter<bluetoothdevice> { ... @override //i wish existed protected string getdisplaystring(bluetoothdevice b) { return b.getname(); } ... } altering behavior of getview doesn't have complicated. madapter = new arrayadapter<mytype>(this, r.layout.listitem, new arraylist<mytype>()) { @override public view getview(int position, view convertview, viewgroup parent) { textview view = (textview) super.getview(position, convertview, parent); // replace tex...

html - Text vertically and horizontally centered over a responsive image -

i'm looking center text both vertically , horizontally on image grows when page gets wider. i had image set background div of fixed height, in case relatively easy center it, because background images aren't structural, couldn't set height automatic function of width, , had toss option out when went more responsive design. so i've got div 2 elements in it, img , overlay text. image width set 100% of width of container, , height varies accordingly. consequence, though, can't set overlay text postion:absolute , top:80px or something, because distance top have vary. , doing top:25% or whatever doesn't work, because a) if page width shrinks squeeze text, or if there's more text, vertical centering thrown off when there more/less lines, , b) percentage arbitrary -- it's not 50 or something, because put top of text overlay 50% down image, when want center of overlay there. i've looked, among other things, @ this post , close -- in both sol...