Posts

python - Second stylesheet in child template / Overriding style sheets -

i have website i'm putting python , django. have template html page, speakers.html , extends base.html . base.html has stylesheet base.css . speakers.html displaying base.css styling should be, problem want speakers.html have additional styling stylesheet, speakers.css . i've been trying figure out speaker.css doesn't seem applied, infact i've noticed in cmd output file speaker.css isn't being loaded @ all. i tried putting in block, code see below.. had repeat {% load static %} rid of error expecting endblock doesn't seem have made difference. base.html <!doctype html> <html lang="en"> <head> <title>base.html</title> {% load static %} <link rel="stylesheet" type="text/css" href="{% static "css/base.css" %}" /> {% block additionalcss %}{% endblock %} </head> <body> ...ect speakers.html <!-- extending works --> {% ex...

Pythonic way of rewrite Java code in Python -

i have write library in python written in java before. coming java background python giving me little difficult time. stuck choosing right pythonic way of doing something.. so, java code like: import java.util.collection; public abstract class myenumbaseclass { protected int value; protected string description = null; protected myenumbaseclass(int ivalue, string idescription) { value = ivalue; description = idescription; } public int getvalue() { return value; } public string getdescription() { return description; } protected static myenumbaseclass getenum(collection<myenumbaseclass> iter, int value) { (myenumbaseclass enumobj : iter) { if (enumobj.getvalue() == value) { return enumobj; } } return null; } } import java.util.arraylist; import java.util.collection; public class myenumclass ext...

r - ggplot column chart - order of colours in brewer object has no effect -

i trying change colours on ggplot column chart. after googling, thought following code work: require(ggplot2) require(rcolorbrewer) state <- c(rep("nswtc",5), rep("tcv",5), rep("qtc",5), rep("watc",5), rep("safa",5), rep("other",5)) year <- rep(c("11-12","12-13","13-14","14-15","15-16"),6) ##some random data funding.programme <- abs(rnorm(30)) df <- data.frame(state, year, funding.programme) ##this line makes graph in order inputted it, rather alphabetical df$state <- factor(df$state, levels=unique(df$state)) ##ugly coloured bars <- ggplot(df) + aes(x=year ,y=funding.programme, fill=year) + geom_bar(stat='identity') + facet_grid(facets=~state) + scale_y_continuous('gross issuance requirements') ##nicely coloured blues <- brewer.pal(5, "blues") blues <- ...

asp.net - Access Virtual Directory in Another Web Application -

i have 2 web application projects (project , project b) in same solution. i want able to: through project a, save file somewhere in directory of project b. whenever use server.mappath etc, resolves virtual directory of project a, not of b. from reading, believe should able type url of project b directly save method. however, neither project deployed @ moment. besides, want leverage fact on same solution. tia! but if you're saving file , don't want access virtual directory ; want actual (physical) directory . means request.mappath way go; can use overload cross-app mapping set true . string pathtoappb = request.mappath("/appbvirtualpath", request.applicationpath, true); you still have know virtual path application b deployed to, though; , can't test locally unless deploy local iis.

Your way to write simple comments -

how guys write comments on simple code use yourself? i write javascript , php code, , can't feel found nice way write comments. if have short line of code, this: x = dothis(getsomevaluefromsomewhere()); // short line of code which seems nice think, doesnt works when line gets little longer or on multiple lines, // dont since it's not clear if describes line 1, or lines. alongervariablename = (getsomevaluefromsomewhere() == "this want") ? "true value" : "false value"; x = dothis(alongervariablename); so, how do it? (* * blocks of comments serve important documentation * e.g descriptions of functions. *) maybe reformatted as (* blocks of comments thet serve important documentation * e.g descriptions of functions. *) and // short inline comments do. don't forget ctrl-/ friend ;-)

javascript - Wordpress site won't load in IE 8.0 -

i'm not hardcore web developer enjoy customizing wordpress themes fit needs. put small website mom who's running local office. used wordsmith anvil theme (http://wordpress.org/extend/themes/wordsmith-anvil).. the site loads nicely in chrome , firefox. however, when comes ie 8.0, won't load (when hover cursor on page, can still click on links , whatnot page appears blank- white). or load after couple refreshes. same applies 5 pages on website. i checked theme developer's website , read thru replies ppl had similar issues. suggested replacing line of code: $(document).ready(function() { with jquery(document).ready(function($) { in 3 .js files.. however, still didn't resolve issue i'm having. ideas else might causing it? appreciate responses. thank you! ps. when disable scripts in ie, page load fine.

sql - Aggregating rows when selecting distinct rows with "bad" data -

the title bit vague, let me tell want , show what's wrong data. i need sum cell values (sizes) of unique rows in table. data sort-of "bad". working mapi , message size returned mapi can differ non-deterministically same message content. i have 2 similar tables/tasks: messages , attachments. it's easier deal attachments, since sha1 hash correlates attachment size. attachment data looks (tab-delimited, excel-ready): hash size 0x0015a93fffb1726e6647f94f47f4998ac699a455 97 0x0015a93fffb1726e6647f94f47f4998ac699a455 97 0x0020ce1810b56cc17f6cfd0a0b6121592825f7e5 85 0x0086077dd1e4af6a38014ab505105b05f8f5311e 62 0x0086077dd1e4af6a38014ab505105b05f8f5311e 62 0x00a6510eedb20a27b00b23416cf755715647a351 85 0x011c9258a0e16e25662e8f3bee8a1462c175c117 87777 0x011c9258a0e16e25662e8f3bee8a1462c175c117 87777 0x011c9258a0e16e25662e8f3bee8a1462c175c117 87777 0x011c9258a0e16e25662e8f3bee8a1462c175c117 87777 0x011c9258a0e16e25662e8f3bee8a1462c175c117 87777 0x011c9258a0e16e25662e8...