Posts

Featured post

ios - Can NSManagedObject conform to NSCoding -

i need transfer single object across device. right converting nsmanagedobject dictionary , archiving , sending nsdata. upon receiving unarchiving it. transfer nsmanagedobject archiving , unarchiving instead of creating intermediate data object. @interface test : nsmanagedobject<nscoding> @property (nonatomic, retain) nsstring * title; @end @implementation test @dynamic title; - (id)initwithcoder:(nscoder *)coder { self = [super init]; if (self) { self.title = [coder decodeobjectforkey:@"title"]; //<crash } return self; } - (void)encodewithcoder:(nscoder *)coder { [coder encodeobject:self.title forkey:@"title"]; } @end nsdata *archivedobjects = [nskeyedarchiver archiveddatawithrootobject:testobj]; nsdata *objectsdata = archivedobjects; if ([objectsdata length] > 0) { nsarray *objects = [nskeyedunarchiver unarchiveobjectwithdata:objectsdata]; } the problem above code is. crashes @ self.title in initwithcoder sa

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

i have simple page in intranet uses razor/asp fetch single record table , display it, plus few graphic, dashboard display. meaning, no user intervention other first time open ie internal url. the problem having every morning ie displays "page not found or network error" message. refresh page, , it's stuck , doesn't display anything. try different pc, open ie internal url , it's stuck... ...until following: login server hosting page run inetmgr go web sites, etc right click on page that's giving me problem , select browse at moment, error message: server error in '/' application. -------------------------------------------------------------------------------- type of page not served. description: type of page have requested not served because has been explicitly forbidden. extension '.cshtml' may incorrect. please review url below , make sure spelled correctly. requested url: /application/dashboard.cshtml ---------------

Most efficient way to access 2D Maps (Maps of Maps) in Java? -

i'm implementing weightedslopeone prediciton algorithm recommender system , @ point in code need have 2 2d maps, 1 map<integer, map<integer, integer>> , 1 map<integer, map<integer, double>> as can understand accessing these , assigning values cumbersome procedure: //the following 20 lines 1 line in python. sigh... hashmap<integer, integer> freqsforitem1 = frequencies.get(curitemid); //see if have value curitemid if (freqsforitem1 == null) { freqsforitem1 = new hashmap<integer, integer>(); freqsforitem1.put(curitemid_2, 1); frequencies.put(curitemid, freqsforitem1); } else {//see if have value curitemid+curitemid_2 integer freqforitem1item2 = freqsforitem1.get(curitemid_2); if (freqforitem1item2 == null) { //if don't have value item1+item2 put 1 freqsforitem1.put(curitemid_2, 1); } else {//we have value curitemid+curitemid_2 //so increment freqsforitem1.put(curitemid_2, freqf

java - Jmockit String final length method mocking Issue -

using jmockit 1.2 jar, trying mock string's length method getting unexpected invocation exception: failed: test java.lang.illegalstateexception: missing invocation mocked type @ point; please make sure such invocations appear after declaration of suitable mock field or parameter @ stringdemo.testa$1.<init>(testa.java:17) @ stringdemo.testa.test(testa.java:13) i using testng: @test public void test() throws exception { new expectations() { @mocked("length") string astring; { astring.length(); result = 2; } }; system.out.println(a.showa("test")); } } actual class a: public class { public static int showa(string str){ int a= str.length(); return a; } } this wrong way of recording expected results. shouldn't mock , record string's length() method, record showa() instead. here solution @suppresswarnings("unused&qu

c++ - wxwidget compiling on windows command prompt -

can please guide me on method,as how compile wxwidget using windows command prompt or msys. [i can't seem find on wxwiki/wxwidget official book/anywhere else] i have compiled wxwidget instructions have provided (using msys). from searching on internet seems 1 can (maybe?) through use of makefile (is correct?) if yes: directory & how should link wx libraries in makefile if no: way besides makefile? i know can use ide's code::block , make life simpler prefer compile using command prompt/msys. thanks in advance.

c# - Linq to SQL search for wildcard in double -

in linq sql trying search value of type double: var q = in db.gettable<hkks_medlemmer>() g in db.hkks_get_grader_kun_grad(convert.toint32(a.skif)) a.aktiv == true && (a.skif.tostring().startswith(searchvalue) || sqlmethods.like(a.navn, "%" + searchvalue + "%") || sqlmethods.like(a.mellemnavn, "%" + searchvalue + "%") || sqlmethods.like(a.efternavn, "%" + searchvalue + "%") || sqlmethods.like(a.adresse, "%" + searchvalue + "%") || sqlmethods.like(a.telefon, "%" + searchvalue + "%") || sqlmethods.like(a.mobil, "%" + searchvalue + "%") || sqlmethods.like(a.postnr, "%" + searchvalue + "%") || sqlmethods.like(a.town, "%" + searchvalue + "%") || sqlmethods

What is the difference between data design and data model(ERD) -

i have google question , find answer in day. know, data design many many table have list column,and mark pk , fk. why er-diagram have find this? data design process of designing database. main output of data design detailed logical data model of database. some people data design includes of needed logical , physical design choices , physical storage parameters needed generate design in data definition language. technically, database analysis, database analysts (dbas) trained do. while person can both data design , database analysis, these 2 different tasks. data design models data. database analysis takes model , applies 1 or more database engines (relational, hierarchical, nosql). a logical data model 1 of main outputs of data design. data model represented entity relationship diagram, or er diagram.