Posts

c# - Asynchronous function call inside tree loader extension function -

c# - Asynchronous function call inside tree loader extension function - i have function load children of node. internally calls wcf async service load. signature follows. public void addchildelements(node parentelement, action<ienumerable<node>> callback) { } this can used like _nodebuilder.addchildelements(parentelement, (elements) => { //do elements }); now want write function expand hierarchy based on condition. write extension function this public static t loadhierarchyuntilitemfound<t>( ienumerable<t> sequence, func<t, list<t>> loadaction, func<t, string> searchstring) { //... } the loadaction parameter expects loading function node.the usage follows elements.loadhierarchyuntilitemfound(loadchildren, "root.uk.england.london"); ...

javascript - hide the overlay using media queries -

javascript - hide the overlay using media queries - when cut down browser size iphone screen menu button appears..... when click button overlay appears.......... overlay appears when increment browser size.... how hide on lay.... rajdq0383@gmail.com http://jsfiddle.net/qyvrt/17/ http://jsfiddle.net/qyvrt/17/embedded/result/ @media (max-width: 767px) { #rightslider{ border: 1px solid red; } #rightslider{ display:none !important; } #rightslider{ display:inherit !important; } } #slidenav{ display:none !important; } #slidenav{ display:inherit !important; } } make media query when width bigger x width go display none @media , (max-width:300){show overlay} @media , (max-width:1024){hide overlay} javascript jquery html css extjs

Django - How to add admin.py in my app folder? -

Django - How to add admin.py in my app folder? - i need add together admin.py in app folder. currently app folder contains next files: __init__.py models.py test.py views.py any help :-) the tutorial edit admin.py in polls directory. however, if you're starting new project admin.py not exist. you can create blank admin.py file , add together contents suggested tutorial. django automatically notice admin settings file when admin app enabled. django django-admin

html - Background positions -

html - Background positions - this image i'm using making 3 direction animation. need show first character of image. using background position- background-position:0px 200px; but showing total image here. styles position:absolute; top: 40px;left: 40px; background-position: 0px 200px; image- please guide me through js fiddle. fiddle see link hope help jsfiddle.net/9ryph/7/ html css background-image background-position

php - Days between two dates and time -

php - Days between two dates and time - $dday = mktime(13, 00,00, 02, 07, 2013); $today = mktime(12,30,00, 02, 08, 2018); $difference = $today - $dday; $datecalculation = floor($difference / 84600); echo $datecalculation; the day 1. not 1. day 1 when time 13.00.can reply me please? the datetime class makes working dates , times much easier them mktime() $datetime1 = new datetime('2013-02-07 13:00:00'); $datetime2 = new datetime('2013-02-08 12:30:00'); $interval = $datetime1->diff($datetime2); $elapsed = $interval->format('%a days %h hours'); echo $elapsed . php_eol; echo "days: " . $interval->format('%a') . php_eol; // output 0 days 23 hours days: 0 see in action php date days date-math

java - Convert string representing key-value pairs to Map -

java - Convert string representing key-value pairs to Map - how can convert string map: map m = convert("a=4 h=x po=87"); // what's convert? system.err.println(m.getclass().getsimplename()+m); expected output: hashmap{a=4, h=x, po=87} there no need reinvent wheel. google guava library provides splitter class. here's how can utilize along test code: package com.sandbox; import com.google.common.base.splitter; import org.junit.test; import java.util.map; import static org.junit.assert.assertequals; public class sandboxtest { @test public void testquestioninput() { map<string, string> map = splittomap("a=4 h=x po=87"); assertequals("4", map.get("a")); assertequals("x", map.get("h")); assertequals("87", map.get("po")); } private map<string, string> splittomap(string in) { homecoming splitter.on("...

c++ - How can a reference require no storage? -

c++ - How can a reference require no storage? - from this question, , consequently, standard (iso c++-03): it unspecified whether or not reference requires storage (3.7). in answers in thread, it's said references have, internally, same construction of pointer, thus, having same size of (32/64 bits). what i'm struggling grasp is: how reference come not require storage? any sample code exemplifying appreciated. edit: @johannesschaub-litb comment, there like, if i'm not using const & , or if i'm using const & default value, requires allocation? seems me, somehow, there should no allocations references @ -- except, of course, when there explicit allocations involved, like: a& new_reference(*(new a())); // a() instance allocated, // not new_reference is there case this? take simple: int foo() { int x = 5; int& r = x; r = 10; homecoming x; } the implementation may utilize pointer...