Posts

css - Less - How to insert an @variable into property (as opposed to the value) -

in less.js, i'm able replace values variables no problems. @gutter: 20px; margin-left:e(%("-%d"), @gutter); when trying replace properties variables, errors. how perform following in less? @gutter: 20px; @direction: left; e(%("margin-%d"), @direction):e(%("-%d"), @gutter); thanks alvivi solution , research (you reward that). decided add following actual answer since real way set instead of looking @ .blah() pseudo code.. here's real strategy setting up: @gutter: 20px; @dir: left; @dirop: right; then create mixins enhance margin , padding so: .margin(left, @dist:@gutter) { margin-left:@dist; } .margin(right, @dist:@gutter) { margin-right:@dist; } .padding(left, @dist:@gutter) { padding-left:@dist; } .padding(right, @dist:@gutter) { padding-right:@dist; } .lr(left, @dist: 0) { left: @dist; } .lr(right, @dist: 0) { right: @dist; } .. can just #selector { .margin(@dir); } or #selector { ...

Create classic asp project in Visual Studio 2010 from scratch -

i have developed on asp.net on 2.0 , higher .net framework. trying create website in classic asp scratch using vs2010 , can't figure out how that. thanks create new folder open visual studio choose "file" -> "open web site" go created folder then right click -> add new item select "html file" rename file .asp create new web site or virtual directory in iis , point folder profit! (alternatively 8, can use new iis express supports asp classic)

phpmyadmin - Why won't MySQL let me remove attribute "on update CURRENT_TIMESTAMP"? -

i have table 2 timestamp fields. defined them name , type timestamp , yet reason mysql automatically set 1 of them default value , attribute on update current_timestamp . planning on having no default value in either of fields, 1 of fields called "date_updated" suppose set mentioned attribute field. unfortunately, it's field "date_created" set on update current_timestamp attribute, , no matter do, mysql won't let me remove it. i've tried editing "date_created" field , removing attribute. when clicking save, attribute back. have tried selecting both fields, removing attribute 1 of them , setting on other. gives me error #1293 - incorrect table definition; there can 1 timestamp column current_timestamp in default or on update clause , both attribute columns on values set on update current_timestamp result: error sql query: alter table `pages` change `date_created` `date_created` timestamp not null , change `date_updated` `date_...

Set CSS width to 100% + right border is missing? -

i set div's width 100% of window. when apply border div, right border cut off. have perform box model hack this? #textboxcontainer { width:100%; height:30%; position:fixed; z-index:99; bottom:0px; left:0px; background-color:#999; border: 4px solid #000; } <div id="textboxcontainer"></div> the easiest fix in case this: #textboxcontainer { height: 30%; position: fixed; z-index: 99; bottom: 0; left: 0; right: 0; background-color: #999; border: 4px solid #000; } live demo remove width: 100% . to make div fill screen, instead add right: 0 . it's viable give element both left , right (or top , bottom ), we're doing here.

ruby on rails - The line was indented 2 levels deeper than the previous line. HAML -

=image_tag('/images/public_stream_page/overlay_image.png', :onload=>"document.getelementbyid('dd_mid_right_box_public').style.background='url(#{stream.asset.url(:normal)})';") this haml code display image getting error the line indented 2 levels deeper previous line. how resolve it? you're not displaying code in correct way problem relates space indentation... line numbers help. should have this: - if stream.asset? =image_tag('/images/public_stream_page/overlay_image.png',:onload=>"document.getelementbyid('dd_mid_right_box_public').style.background='url(#{stream.asset.url(:normal)})';") with second line indented same number of spacing use in rest of templeate, while perhaps have 1 line (number in error not shown) 2 times more indented.

jquery ui - How to prevent use from putting non valid value in the autocomplete field? -

how prevent user inserting value not in source of autocomplete? var items= [ { "label": "account administration" }, { "label": "applications"}, { "label": "general information" }, { "label": "hardware" }, { "label": "network" }, { "label": "operating system" }, { "label": "remote connectivity" } ]; $(".autocomp").autocomplete({ source: items}); well while coming example figured out. $(".autocomp").blur( function(event){ s = this.value.touppercase(); var r = ""; for(var i=0;i<items.length; i++) { if(s===items[i].label.touppercase()){ r= items[i].label; break;} } this.value=r; }); http://jsfiddle.net/daelectric/bspn2/ but there better way of doing this?

c# - Lambda with nested classes -

Image
i have posted question while ago got partial answer issue, thought post more explanation hoping more accurate answer. have 2 classes: public class employee { public string name { get; set; } public list<cars> cars { get; set; } } public class car { public int carid { get; set; } public cartypes cartype { get; set; } public enum cartypes { van, smallcar } } i'm trying employees have vans allocated ignoring smallcars using lambda, tried line: list<employee> employeeswithvans = allemployees.where(emps => emps.car.any(cartype => cartype.cartype == car.cartypes.van)).tolist(); but gets employees if @ least 1 van allocated employee ( .any ) if try ( .all ) bring nothing not employees has van. any idea if can achieved using nested lambda? thanks. edit: employee mark = new employee(); mark.cars.add(new car() { cartype = car.cartypes.van, carid = 12 }); mark.cars.add(new car() { cartype = car.cartypes.van, ca...