Posts

Java Generic List Template -

i created listprinter (main class) , listholder class. i taught how create generic arrayholder trying modify (my homework) list holder. my teacher's array printer code is: public class arrayholder <p> { p arr[]; public void print(p arr2[],int count) { arr = arr2; (int = 0; < count; i++) { system.out.print("\n"+arr[i]+"\n"); }// end }// end print method }// end class. i used template listholder keep getting error in sout line: public class listholder <x> { x list ; public void print (x list2, int count) { list= list2; (int = 0; < count; i++) { system.out.print(list2(i)+"\n"); } } // end print } //end class what doing wrong??? ========== kaykay it still giving me errors :( copied , pasted answer. first error on line: list list; first list underlined , error is: cannot find symbol...

Bengali Calender JQuery Datepicker Localization -

hi have been working bengali language in multilingual website, , when language set english need show jquery datepicker calender in english, , bengali need show in bengali. i have used jquery datepicker localization. i have gone through tutorial , process accomplished part of it. can show january, february etc. sat, sun etc in english , bengali . while in bengali, digit remains in english. so, question is, there way out can change digit 0-9 in bengali digit ? jquery(function($){ $.datepicker.regional['bn-bd'] = {"name":"bn-bd","closetext":"close","prevtext":"prev","nexttext":"next","currenttext":"today","monthnames":["জানুয়ারী","ফেব্রুয়ারী","মার্চ","এপ্রিল","মে","জুন","জুলাই","আগস্ট","সেপ্টেম্বর","অক্টোবর","নভেম্বর","ডিসেম্বর",...

c# - WPF / XAML - Cannot get DevExpress tiles to work in unisn -

i'm trying have cool tile feature in app can move tile want in position ans , 1 don't want snaps in place instead of navigating , fourth page page. have them on screeen dont want freakin cooperate. in xaml code , should writing c# method in order make them work right. please i've been night fooling this. <window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:dxui="http://schemas.devexpress.com/winfx/2008/xaml/windowsui" xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core" xmlns:dxlc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol" xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars" xmlns:dxr="http://schemas.devexpress.com/winfx/2008/xaml/ribbon" xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors" xmlns:ig="http://schemas.infragis...

Powershell outputs Directory paths differently sometimes -

i'm using ls find directories convention. works in finds them, i'm piping results other functions. depending on way 'ls' (aka: dir ) called. why happening? c:\tmp40d4> ls *_pkg -recurse | %{"$_"} c:\tmp40d4\sub\a_pkg c:\tmp40d4\sub\b_pkg c:\tmp40d4\sub\c_pkg c:\tmp40d4> ls sub *_pkg -recurse | %{"$_"} a_pkg b_pkg c_pkg both results list of directoryinfo instances. c:\tmp40d4> ls sub *_pkg -recurse | %{$_.gettype()} ispublic isserial name basetype -------- -------- ---- -------- true true directoryinfo system.io.filesysteminfo true true directoryinfo system.io.filesysteminfo true true directoryinfo system.io.filesysteminfo as turns out, directoryinfo instances provided alternative calls ls result in different directoryinfo instances. specifi...

django - call variable from method inside the method -

having 2 views views.py def followup(request): '''''' marklist = report_template(request) return render(request, 'incident/followup.html',{'somevar':somevar}) def report_template(request): ''''' report=report.objects.filter(report=report_id) '''''' return render(request, 'incident/print.html', {'report':report}) i calling 1 method inside method.calling report_template method followup method.followup method have variable render in template. how pass variable of report_template method followup method , make display in template. thanks one way achieve create helper method returns report or context needed both methods. issue here returning httpresponse object, , cleanest use helper method here: def get_report(request): report=report.objects.filter(report=report_id) #do more processing here. #returning dict safest ...

Java: Does nu.xom.Builder properly close Files? -

i using nu.xom.* project, link found @ http://www.xom.nu/ . question following part of code: private void open() { builder = new builder(); try { document = builder.build(file); } catch (parsingexception | ioexception ex) { logger.getlogger(invoicedata.class.getname()).log(level.severe, null, ex); } } i have unwanted file locks in program , practically checking places open file. struck me here builder.build(file file) implement closeable , myself not sure here whether closes file or not. can shed light on this? regards. fortunately xom library open source, can take @ source code of nu.xom.builder.build(file) : public document build(file in) throws parsingexception, validityexception, ioexception { inputstream fin = new fileinputstream(in); // [...] string base = url.tostring(); try { document doc = build(fin, base); return doc; } { fin.close(); } } so pass file insta...

c# 4.0 - Entity Framework non generic Include on dynamic ObjectSet -

i've ran problem while creating data access layer application. working derived entities in entity framework. if try create objectset derived entity, exception: blockquote there no entitysets defined specified entity type 'type name'. if 'type name' derived type, use base type instead. i've tried resolve problem via reflection. (if entity type derived entity type => objectset base type) i found this: how can obtain objectset<t> entity-framework @ runtime t dynamic? haven't found how use include , on built objectset. protected ienumerable<idataobject> getdata(type entitytype, expression<func<dynamic, bool>> whereclause, expression<func<dynamic, dynamic>>[] includes) { if (typeof(idataobject).isassignablefrom(entitytype.basetype)) { return getdata(entitytype.basetype, whereclause, includes); } var contexttype = this.context.gettype(); methodinfo crea...