Posts

Showing posts from September, 2013

C# generic Excel exporter using reflection -

Image
i'm working on generic excel exporter in c#. point put collection of type , specify properties of class should exported using lambda expressions , have done that. problem i'm struggling when have complex property in class, property value exported "namespace.classname" (e.g. "myapp.viewmodels.myviewmodel"). here code: excel exporter class: public class excelexporter { public void exporttoexcel<t>(ienumerable<t> data, params expression<func<t, object>>[] columns) { datatable datatable = this.converttodatatable(data, columns); //export datatable object excel using library... } private datatable converttodatatable<t>(ienumerable<t> data, params expression<func<t, object>>[] columnsfunc) { datatable table = new datatable(); foreach (var column in columnsfunc) { string

javascript - typeahead.js doesn't display the dropdown using remote data -

i think have around 5 hours since i'm struggling typeahead.js library. i'm trying load data using remote functionality don't have luck on making working completely. these js libraries i'm loading: <script src="/scripts/jquery-2.1.4.js"></script> <script src="/scripts/handlebars-v3.0.3.js"></script> <script src="/scripts/typeahead.bundle.js"></script> <script src="/scripts/bootstrap.js"></script> <script src="/scripts/respond.js"></script> then, in order initialize typeahead feature, i'm using piece of code: $(function () { var cards = new bloodhound({ datumtokenizer: function (datum) { console.log(datum); return bloodhound.tokenizers.whitespace(datum.value); }, querytokenizer: bloodhound.tokenizers.whitespace, remote: { url: '/home/suggest?searchquery=%query',

angularjs - How to switch template in angular directive by the condition of `index` value -

i require change template according count of index getting ng-repeat how achieve that? in case if index 0, want change `template' here code : "use strict"; angular.module("tcpapp") .directive('programname', function () { return { restrict : 'ae', replace : true, scope : { name:'@', index:'@' }, template : '<h2 class="que t{{index}}" ng-click=callme()>{{name}}</h2>', link : function (scope, element, attr) { scope.callme = function () { console.log($(element).prop('class')); } } } }); i tried throws error: template : scope.index ? '<h2 class="que t{{index}}" ng-

c# - create a outlook add-in to popup an input text field form for user info -

i develop outlook 2013 add-in can clicked , comes form asks user name, phone number etc. after information entered data can appended end of mail content signature. i don't know how call form input text field when clicking add-in. could give me ideas? you may treat vsto based add-in regular .net application. example, in ribbon's button click event handler can create new windows form instance , display users gathering required information. in same way in winforms applications. you may find outlook solutions section in msdn helpful.

php - How to change timeout in javascript dynamically -

good morning everyone! i've got question, not sure language should using. i'm assuming javascript since slideshow javascript. i need create slideshow user can change time in between slides. there 100 slides , want able set timing in between each individually. i've put pics on server , created db links them , slideshow works fine, except can't seem figure out way make timeout have different values. appreciated. here's code: <?php include_once 'includes/db_connect.php'; ?> <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>weather show</title> <meta name="viewport" content="width=device-width,initial-scale=1"> <link rel="stylesheet" href="responsiveslides.css"> <link rel="stylesheet" href="demo.css"> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"&

ReferenceError: event is not defined in my application when i am calling from jquery -

when calling function getting error: if (event.keycode == 46 || event.keycode == 8 || event.keycode == 9 || event.keycode == 27 || event.keycode == 13 || referenceerror: event not defined here code: $(".decimalonly").each(function () { $(this).keydown(function (e) { if (event.keycode == 46 || event.keycode == 8 || event.keycode == 9 || event.keycode == 27 || event.keycode == 13 || (event.keycode == 65 && event.ctrlkey === true) || ((event.keycode == 190 || event.keycode == 110) && $(this).val().indexof(".") == -1) || (event.keycode >= 35 && event.keycode <= 39)) { return; } else { keypress if (event.shiftkey || (event.keycode < 48 || ev

java 8 - What is the elegant way to generate Map from List using streams -

i have students list database. applied predicates list , partition list valid, invalid students. invalid students want generate map student key , error message value. because need generate report each student.here doing don't know whether approach or not or there better way it. actually after getting invalid students list trying create function think code getting messy , may there better approach it. here doing private list<predicate<olccstudent>> getallpredicates() { list<predicate<olccstudent>> allpredicates = arrays.aslist( isvalidfirstname(), isvalidmiddleinitial(), isvalidlastname(), isvalidstreetaddress(), isvalidcity(), isvalidstate(), isvalidzip(), isvaliddateofbirth(), isvalidssn(), isvalidtestdate(), isvalidtestanswers(), isvalidprovidercode(), isvalidinstructorcode() ); retu

arrays - Get specific values form JSON Table with javascript over IDs -

i have following problem: i have json table data need (found on internet since need) var testext ={"key1":[ { "firstname":"ray", "lastname":"villalobos", "joined":2012 }, { "firstname":"john", "lastname":"jones", "joined":2010 } ]} document.getelementbyid("demo").innerhtml=testext.key1[0].firstname; this works fine can see still need index [0] dataset need. i need to without index... like here: var testext = { "key1": ["string1/1", "string1/2" ], "key2": ["string2/1", "strin2/2"] }; document.getelementbyid("demo").innerhtml = testext['key1'][0]; just combined variable : document.getelementbyid("demo").innerhtml = testext['key1'].['firstname

swift - CALayer, CAConstraint & Disabling the Animation -

i wondering if there's way disable animations particular layer? my example here bog standard calayer (the nsview's calayer), , sublayer, catextlayer... catextlayer nicely tethered nsview's calayer , should.. no issues there... how turn off "easing" animations when view resized? literally have in nsview subclass: override func awakefromnib() { var newlayer: calayer = calayer() newlayer.backgroundcolor = nscolor.blackcolor().cgcolor newlayer.layoutmanager = caconstraintlayoutmanager.layoutmanager() self.layer = newlayer self.wantslayer = true var textlayer: catextlayer = catextlayer() newlayer.insertsublayer(textlayer, atindex: 0) textlayer.string = "yay layer" textlayer.foregroundcolor = nscolor.whitecolor().cgcolor textlayer.name = "textlayer" textlayer.fontsize = 42.0; textlayer.alignmentmode = kcaalignmentcenter; textlay

sas - Support results in association rules are less than 5% -

Image
i facing issue association rules. have dataset consists of transaction id , productid have edited variable , changed transactionid role "id" , productid role "target" minimum support % set 5%. when run association m getting support percentages less 5%. might wrong? can check highest frequency count of product in productid column , 5% value of that frequency count. number should threshold transaction count till enterprise miner should showing result. support percentage based on maximum frequency count of target column , not on entire transaction dataset. hope helps!

winforms - is the c# webbrowser reliable? -

i try attaching custom document events fire sometime; don't. worse, here scenario can test. not sure if os problem. win7 machine, , has ie 11 installed. i start localhost python web server , serve static web page: c:\code\forex> python -m simplehttpserver 4542 and try load above web page in webbrowser control. form's code follows: using system; using system.diagnostics; using system.windows.forms; namespace winformwebbrowser { public partial class form1 : form { public form1() { initializecomponent(); } private void form1_load(object sender, eventargs e) { webbrowser1.documentcompleted += webbrowser1_documentcompleted; webbrowser1.navigate("http://localhost:4542"); } void webbrowser1_documentcompleted(object sender, webbrowserdocumentcompletedeventargs e) { if (webbrowser1.readystate == webbrowserreadystate.complete)

javascript - Enable scroll within a function -

when use scrollwheel i'm incremeting currentslide one, when currentslide === 2 red div going , want enable scrolling body. see bind function returning false . tried put conditions on , return true when currentslide === 2 apparently won't work. can explain me how fix that? var currentslide = 0; function scrolldown() { console.log('scroll down', currentslide); if(currentslide < 3) { currentslide += 1; } if(currentslide === 3) { $('#el').addclass('hide'); } } http://jsbin.com/rovicawija/1/edit?js,console,output i'm totally not sure trying question , expected result quite unclear i made code following var currentslide = 0; function scrolldown() { console.log('scroll down', currentslide); if(currentslide < 10) { currentslide += 1; return false; } if(currentslide === 10) { $('#el').a

date - iOS Enterprise App Distribution – Provisioning Profile expired -

how can check in app when expired provisioning profile , notify user date? example i have found here. file not included in bundle of project. maybe there options? thanks despite being mac os x prov checker, applies same ios too: https://github.com/ligeiarowena/provisioninginfo personally, information shouldn't bother users. should have clear record of when expire, , notify users via push notifications and/or form of rest api expiration dates. ideally, best way handle periodically (at least once year) push out update nothing more new embedded mprov. do need users notify when provisioning profiles expiring? but in terms of reading plist file: [nsdictionary dictionarywithcontentsoffile:@"path/to/file.plist"] this seems answered question at: get expiration date of provisioning profile @ run-time? but reiterate code: - (nsstring*) getexpiry{ nsstring *profilepath = [[nsbundle mainbundle] pathforresource:@"embedded" oftype:@&q

r - Optimizing a simple linear curve (constant and coefficient estimated from a regression) -

i trying calculate turning point of a few functions have estimated coefficient , constant regression. i'm using optimize function curves linear. my function looks like: f<- function(x){ beta* x + alpha } mind: beta , alpha both vectors here. when running optimisation optimize, i'm getting following error: error in optimize(f, interval = c(10, 20), lower = (10), : invalid function value in 'optimize' is because optimize running optimisation mathematically, beta , alphas need single parameters? if knows better way of doing please contribute! thank in advance :) if functions linear, @ minimum @ lower end of range beta>=0, , @ upper end of range if beta<=0 - no need use optimize() . it's not entirely clear you're expecting code - if want return x each set of parameters, @ optim() instead , have f return sum, or run optimize on each set of parameters in turn using apply() function or loop. one other thing syntax bit

symfony - How to check if array has more elements in twigs for loop? -

i concatenating array elements in single variable , between them. i'm getting record this abc,def,ghi, i dont want add comma , after last element. code is: {% driver in item.vehicles if driver.driver.firstname %} {% set isdriver = 1 %} {% set driverlist = driverlist ~ driver.driver.firstname ~ ',' %} {% endfor %} &nbsp; you can use twig loop variable needed this: {% driver in item.vehicles if driver.driver.firstname %} {% set isdriver = 1 %} {% set driverlist = driverlist ~ driver.driver.firstname %} {% if loop.last == false %} {% set driverlist = driverlist ~ ',' %} {% endif %} {% endfor %}

Switching Git branches inside an Android Repo project -

i have question switching branches using repo . know can checkout branch this: repo init ... -b foo repo sync my understanding checkout foo branch of manifest repository, , check out git projects described in manifest. i understand can switch branches this: repo init ... -b bar repo sync -d my question is, can switch branches without doing repo init & repo sync each time, , implications of doing so? let me illustrate example: repo init ... -b foo repo sync -d repo start foo-mytopic proj1 proj2 ... repo upload -t repo init ... -b bar repo sync -d repo start bar-topic proj1 proj3 repo upload -t cd proj1 git checkout foo-mytopic # allowed? i've tried before, , seems work, it's bit strange because have checked out code in foo manifest, current manifest branch bar . implications of being on different branch described in manifest? note: i've read this , , think question different. know how switch branches. i'm interested in implications of being on

php - Updating An Image on All instances of a website -

so have raspberry pi controlling garage door. pi running apache webserver. have camera connected raspberry pi , want able update images camera. have following code: garage.html: <html> <head> <meta charset="utf-8"> <title>the house garage controls</title> </head> <body> <form action="garage.php" method="get"> <input type="submit" value="open/close garage" style="width:1000px; height:150px;font-size:80px;border-radius: 25px; background-color: 2da3a7;" > </form> <div id="doorimage"> <img src="doorstatus.jpg" alt="garage door picture camera" height="1000" width="1000"> </div> <script src="jquery-1.10.2.js"></script> <script> $(document).ready(function(){ var $container = $("doorimage"); $container.imagefill('door

printing - MS Access report margin bleedover, fit to width? -

after citrix upgrade, ms access reports appear bigger , several of them bleed on margins additional pages sliver hangs over. it not feasible me go through each report , manually resize in design view -- several of them have been compressed quite tightly. there no way "fit width"? there indeed "fit page" property. report properties -> format tab -> fit page -> yes it in experience i'm going won't universal fix you're looking for, , might not work. on reports have bled over, had manually adjust each report. of course noticed developing them not time-consuming if had 20 within week, per se. there decent amount of properties can toy with, including page width , auto center , auto resize , etc. formatting can tedious. i'm hoping default properties work you, keep in mind manual fix may required.

javascript - Reopened pop window on browser reload: -

openerwindow.php call openedwindow.html through button , why when close openedwindow.html , refresh browser openedwindow shown again?? isn't popup window triggered through button. can't figure out, why , how solve : openerwindow.php <!doctype html> <html> <head> <meta charset="utf-8"> <title>document</title> </head> <body> <form method="post" action=""> <input type="submit" name="open" value="open pop up" onclick=""/> <?php if(isset($_post["open"])){ // if button clicked call other html page pop ?> <script > newwindow = window.open('openedwindow.html', 'formuntukupte', 'width=400,height=350'); </script> <?php } ?> </form> </body> </html> openedwindow.html <!doctype html> <html> <head lang="en"> <meta

SQL Server: Update Zips, see if zips exist, Update Carrier to correspond with Zips -

vcaccountnum | izone | vczipstart | vczipend | vccarrier1 | vccarrier2 | vcterminal1 | vcterminal2 | das i want see if zip exists out of 6000 zips. zipend , zipstart same. if abc carrier either/or vccarrier1 or vccarrier2 vcterminal1 and/or vcterminal2 need updated new code, example jfk. i need flag das y or n depending on zip. i thinking of using in of zips. i have every often. looking @ way make sp or 1 done without spending day on it. thank you, i think searching query this: update yourtable set vcterminal1 = case when vccarrier1 = 'abc carrier' 'newcode' else vcterminal1 end, vcterminal2 = case when vccarrier2 = 'abc carrier' 'newcode' else vcterminal2 end, das = case when 'zip code' = 'depeneds' 'y' else 'n' end 'zip code' between vczipstart , vczipend

linux - 403 Forbidden and 13 Permission Denied -

i running problem of setting nagios, followed quick install guide http://nagios.sourceforge.net/ @ web interface prompt pc tring login web interface not local one, happen before prompt enter username , password. forbidden don't have permission access /nagios on server. apache/2.2.3 (red hat) server @ xx.x.x.xxx port 80 and [error] [client xx.xxx.xx.xxx] (13)permission denied: access /nagios denied things have done try resolve it sudo chmod 755 /home/me/nagios selinux=disabled scriptalias /nagios/cgi-bin "/home/me/nagios/sbin" <directory "/home/me/nagios/sbin"> # sslrequiressl options +execcgi allowoverride none order allow,deny allow # order deny,allow # deny # allow 127.0.0.1 authname "nagios access" authtype basic authuserfile /home/me/nagios/etc/htpasswd.users require valid-user </directory> alias /nagios "/home/me/nagios/share" <directory "/home/me/nagios/share"&

regex - php - count particular permutations -

i have strings : 431234412 what trying find instances of '1234' in each string numbers can used again long in order. so instance, in above string there 2 instances of '1234' since '12344' can interpreted '1234-' or '123-4'. i thinking of writing recursive functions maybe there simple way regex? the regex quite simple: $subject= '431234412'; preg_match_all('/(1+2+3+4)+/', $subject, $matches); you find occurrences in array $matches . the + behind each digit means, digit may repeated.

javascript - Trouble reformatting JSON into an array for use in AngularJs -

js has built-in parse function using: json.parse. it's reformatting i'm having trouble wrapping head around. eg if want fetch stars nasa api json. gives me massive list of stars, 1 entry looking this: { "absmag": 4.85, "appmag": -26.72, "colorb_v": 0.65, "created_at": "2014-11-08t07:30:49.614z", "dcalc": 0.0, "distly": 0.0, "hipnum": 0.0, "id": 1, "label": "sun", "lum": 0.8913, "plx": 0.0, "plxerr": 0.0, "speed": 0.0, "texnum": 1.0, "updated_at": "2014-11-08t07:30:49.614z", "vx": 0.0, "vy": 0.0, "vz": 0.0, "x": 0.0, "y": 0.0, "z": 0.0 } i strip out "label" value searching: window.database.foreach(function(el) {

android - How do I change the color of the ActionBar hamburger icon? -

i'm using navigationview android design support library , toolbar , works fine, want know how make hamburger icon dark (right appears white). wanna adjust distance screen edge actionbar title. how do this? help. i set theme theme.appcompat.light.noactionbar. use toolbar. here code: public class mainactivity extends appcompatactivity { //defining variables private toolbar toolbar; private navigationview navigationview; private drawerlayout drawerlayout; viewpager pager; viewpageradapter adapter; slidingtablayout tabs; charsequence titles[]={"Песни","Исполнители"}; int numboftabs =2; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); // initializing toolbar , setting actionbar toolbar = (toolbar) findviewbyid(r.id.toolbar); setsupportactionbar(toolbar); and xml: <android.support.v4.widget.drawerlayout xmlns:android="http://schemas.andr

c# - How to remove mili seconds from '0' date formatting -

i trying convert datetime following format. 2015-05-30t12:00:00+05:30 when trying 'o' formatter getting out put in following format, string plannedstarttime = starttime.tostring("o"); output:2015-06-12t16:54:47.3206929+05:30 i need remove mil seconds . not getting formatters msdn any other formatters? you can use custom formatter: string plannedstarttime = starttime.tostring("yyyy-mm-ddthh:mm:sszzz"); see custom date , time format strings

ibm mobilefirst - Unable to locate Ant builder/deployer and jee-library .jar files -

i have downloaded ifix (6.1.0.02.20150520-1015) worklight server , worklight studio not locate below files. worklight-ant-builder.jar worklight-ant-deployer.jar worklight-jee-library.jar these files extracted destination specified during installation process when using ibm installation manager. be: wl_install_dir . you need use ant builder , deployer .jar files when generating , building/deploying project's .war, .wlapp , .adapter files. the jee library .jar file used installation ant task script in order update server it. these .jar files , same files use in operating system; can copy them ever you'd to. for more information see user documentation topic: http://www-01.ibm.com/support/knowledgecenter/sszh4a_6.1.0/com.ibm.worklight.installconfig.doc/install_config/t_ov_server_install.html

ios - Push notifications that trigger a background refresh before showing the push notification VS silent push -

i want implement background refresh functionality in app when push received. before push notification displayed user want download new messages backend (parse.com) , save them array. following guide here: http://developer.xamarin.com/guides/ios/application_fundamentals/backgrounding/part_3_ios_backgrounding_techniques/updating_an_application_in_the_background/ i'm not sure how accurate guide is. states: ios 7 (and greater) extends ordinary push notifications giving applications chance update content in background before notifying user, user can open application , presented new content immediately. so tried implementing background push this: - (void)application:(uiapplication *)application didreceiveremotenotification:(nsdictionary *)userinfo fetchcompletionhandler:(void (^)(uibackgroundfetchresult result))handler { if([[userinfo objectforkey:@"aps"] objectforkey:@"content-available"]){ nslog(@"doing background refresh");

html css mega menu drop down -

Image
http://www.brokenarrowwear.com/responsivedesign/index.html i'm redesigning website , i'm having problem product catalogue drop down menu. i'm using foundation 5 responsiveness, , i'm not sure may what's messing menu. the code i'm inserting doesn't work on thing on here (i'm assuming because can't foundation , pictures load in) link has looks like. i've tried lot of different methods work editing css. thought margin thing when right click inspector view shows anchor tag didn't code anchor tag made me confused. can me? ps menu product catalog drop down supposed this. /* menu */ .button-group { width: 104%; letter-spacing: .014em; } .button-group .button { font-family: "pt sans", sans-serif; font-weight: bold; color: black; background: #5fd6d6; /* old browsers */ background: -moz-linear-gradient(top, #5fd6d6 0%, #b9e8e8 42%, #b9e8e8 57%, #5fd6d6 100%); /* ff3.6+ */ background: -webki

Rails how to make this view work? Devise, Enrolment system with courses -

how can modify view make work? have "enroll button" create viewed_lessons record current_user? class course has_many :lessons end class lesson #fields: course_id belongs_to :course end class user has_many :viewed_lessons has_many :viewed_courses end class viewedlesson #fields: user_id, lesson_id, completed(boolean) belongs_to :user belongs_to :lesson end class viewedcourse #fields: user_id, course_id, completed(boolean) belongs_to :user belongs_to :course end class coursescontroller < applicationcontroller def index @courses = course.all end def show @course = course.find(params[:id]) current_user.viewed_courses.create(course: @course) end end one gotcha create new viewed course every time viewed page, need logic add each course once. perhaps this: def show @course = course.find(params[:id]) current_user.viewed_courses.create(course: @course) unless viewedcourse.exists?(user_id: current_user.id, cour

java - view.getId is -1 in onClick Listener -

i'm inflating view, setting it's id, set tags, set onclicklistener on , add parent view. linearlayout llcategorylistincome = (linearlayout)calculatorflipcontainerback.findviewbyid(r.id.ll_category_list_income); // inflate category item linearlayout categoryitem = (linearlayout)inflater.inflate( r.layout.fragment_category_item, container, false); integer id = 2; integer position = 3; categoryitem.setid(position); categoryitem.settag(r.string.tag_category_position, position); categoryitem.settag(r.string.tag_category_id, id); categoryitem.setonclicklistener(this); llcategorylistincome.addview(categoryitem); in onclick listener want check id. id -1. same issue tags. tags null. public void onclick(view v) { integer position = (integer)view.gettag(r.string.tag_category_position); integer id = (integer)view.gettag(r.string.tag_category_id); log.d(tag, "view id " + view.getid());

docker - How do I push an image to my NON-public repo in dockerhub -

how push non-public repository on dockerhub? suppose account called “myaccount” , (non-public) repo called “myrepo”. in repo page says, “pull repository: docker pull myaccount/myrepo”. e.g., suppose have image called “myrepo/myimage”. have logged account ( sudo docker login ), , tried, sudo docker push docker.io/myrepo/myimage sudo docker push myrepo/myimage sudo docker push myaccout:myrepo/myimage sudo docker push myaccount/myrepo:myrepo/myimage sudo docker push myaccount/myrepo:myimage etc. none of these work. errors "invalid repository name", or succeeds says, "do want push public registry?" - , not - want push non-public dockerhub repo ("myaccount/myrepo"). please tag image first myaccount/myrepo:<tag-name> locally using docker tag <your-local-image> myaccount/myrepo:<tag-name> , try docker push myaccount/myrepo:<tag-name> note give valid name < tag-name > v1 , v2 , etc.

hadoop - Jcascalog to query thrift data on HDFS -

i read book of nathan marz on lambda architecture. i'm making proof of concept of solution. i have difficulties build jcascalog query. this piece of thrift schema interest : union articlepropertyvalue { 1: decimal quantity, 2: string name; } union articleid { 1: int id; } struct articleproperty { 1: required articleid id; 2: required articlepropertyvalue property; } union dataunit { 1: ticketproperty ticket_property; 2: articleproperty article_property; } i stored data pail folder : /home/tickets now want make request on data : want sum of quantity grouping article name. first need names, , after quantity. each can id of article. for example have result name request(id_article, name): (1, pasta) - (2, pasta2) - (3, pasta) for quantity request (id_article, quantity): (1, 2) - (2, 1) - (3, 1) tap source = splitdatatap("/home/florian/workspace/tickets"); api.execute( new stdouttap(), new subquery("?name&quo

sorting - How can i sort a Vector of objects in Scala? -

i have vector of objects of particular class. how can sort them? comparison method must add class make sortable? if not method, ordering function should implement? method sorted of vector takes implicit parameter of type math.ordering[b] , uses sorting. there several ways provide it: define implicit math.ordering[myclass] . can create ordering class using methods ordering companion object: case class myclass(field: int) object myclass { implicit val myclassordering: ordering[myclass] = ordering.by(_.field) } if ordering defined in companion object of myclass , it'll provided sorting automatically. otherwise, you'll have import manually before calling sorted . ordering allows provide several different ordering defined on class, , import or provide explicitly 1 want. have class extend ordered[myclass] overriding compare method. in case necessary ordering created implicitly. case class myclass(field: int) extends ordered[myclass] { def compare(o

How to store per thread contextual data in c#? -

my concrete need store remote ip can printed while logging, without explicitly passing down every method call. sort of per thread environment variable scope. i thought of having per thread singleton logger can access it. there better/safer way? make work async plus. my ideal api should this: using (new logscope("key1", "value1")) { call1(); } using (new logscope("key1", "value1")) { call1(); } void call1() { using (new logscope("key2", "value2")) { call2(); // key1:value1 key2:value2 using (new logscope("key1", "value3")) { call2(); // key1:value3 key2:value2 } } using (new logscope("key1", "value3")) { call2(); // key1:value3 } } void call2() { foreach (var kv in logscope.context) console.write("'{0}':'{1}' "); console.writeline(); } not op

cq5 - How to adapt a child node in sling model of aem6 -

i learning use 1 of new features of aem6 - sling models. have fetched properties of node following steps described here @model(adaptables = resource.class) public class userinfo { @inject @named("jcr:title") private string title; @inject @default(values = "xyz") private string firstname; @inject @default(values = "xyz") private string lastname; @inject @default(values = "xyz") private string city; @inject @default(values = "aem") private string technology; public string getfirstname() { return firstname; } public string getlastname() { return lastname; } public string gettechnology() { return technology; } public string gettitle() { return title; } } and adapted resource userinfo userinfo = resource.adaptto(userinfo.class); now have hierarchy - + userinfo (firstname, lastname, technology) | + useraddress (houseno, locality, city, state) now want fetch prope