Posts

Visual Studio C# datagridview to database -

this question has answer here: what nullreferenceexception, , how fix it? 33 answers i'm trying save data datagridview database . keep on getting nullreferenceexception: object reference not set instance of object try { foreach (datagridviewrow row in datagridview2.rows) { using ( conn = new sqlconnection(constring)) { using (sqlcommand cmd = new sqlcommand("insert tbl_students_marks values(@student, @t1, @t2, @t3, @t4)", conn)) { cmd.parameters.addwithvalue("@student", (row.cells["student number"].value).tostring()); cmd.parameters.addwithvalue("@t1", row.cells["test 1"].value); cmd.parameters.addwithvalue("@t2", row.cells["test 2"].value); cmd.param...

language lawyer - C++ name lookup -- -

the standard says (brackets mine) in cases listed in 3.4.1 [unqualified name lookup], scopes searched declaration in order listed in each of respective categories … why names kept in sort of ordered list(s)? after all, except function overloading , name hiding, think names unique within namespace. update address comment: i expect compiler keep names defined in container such unordered_set per scope , scopes linked in chain. i wondering why names classified lists per category (which thought variables, typedefs, structure like, functions, templates, etc.) , lists further sorted. the "order" in case not order of names . order of scopes . in each category scopes listed in order (typically "inside-out": inner scopes outer scopes). order in these scopes searched. typically, first scope contains name in question causes search stop.

How to optimize realm.allobjects(class) in Android -

i want use realm replace sqlite in android store list of classes, code simple below. public class myrealmobject extends realmobject { public string getfield() { return field; } public void setfield(string field) { this.field = field; } private string field; ... } list<myobject> myobjects = new arraylist(); realm realm = realm.getinstance(this); for(myrealmobject realm : realm.allobjects(myrealmobject.class)) { myobjects.add(new myobject(realm)); } realm.close(); return myobjects; however, performance slower simple sqllite table on tested device, using wrong way? there optimization tricks? why want wrap realmobjects in myobject class?. copying entire result set means loose benefit of using realm, namely doesn't copy data unless needed to. realmresults implements list interface should able use 2 interchangeably. list<myrealmobject> myobjects; realm realm = realm.getinstance(this); myobjects = realm....

c# - Register a PKCS#11 library -

i trying install pkcs#11 module firefox browser via msi setup application. after doing search through internet, bumped 'modutil' tool has wide variety of responsibilities in case = installing/uninstalling pkcs#11 module nss security databases. downloaded latest source code , built using mozillabuild. unfortunately, shows me error when try create security databases = (3 .db extension). error says "function failed: certificate/ke= y database in old, unsupported format"!. does know how can overcome issue, , there unseen aspect work utility. also, there solution install/uninstall pkcs#11 module user profiles 1 common process. finally, there better solution task of installation using mysetup. use wix toolset create msi setup. -

Java - Null Pointer Exception while parsing XML file -

this question has answer here: what nullpointerexception, , how fix it? 12 answers i'm trying parse xml file of employees, , data in xml want create array list of of employees, when run program , try parse xml file, gives me null point exception. xml file: <?xml version="1.0"?> <employees> <employee> <name>roberta robertson</name> <manager>false</manager> </employee> <employee> <name>taylor meyers</name> <manager>true</manager> </employee> <employee> <name>john mayer</name> <manager>true</manager> </employee> </employees> this code parsing xml file. call method when press button in gui. public class employeesparser { private documentbuilder builder; pri...

android - Pie chart does not have correct size inside a CardView -

Image
i working on android application , using mpandroidchart lib in it. yet application developed using mpandroidchart version 2-0-8. , chart display fine shown below. but today update lib version 2-1-1. haven't done changes code chart looks now. here xml code chart. <com.github.mikephil.charting.charts.piechart android:id="@+id/chart" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_margintop="@dimen/top_bottommarginforchart" android:layout_marginleft="@dimen/top_bottommarginforchart" android:layout_marginright="30dp" android:layout_marginbottom="@dimen/top_bottommarginforchart" /> p.s. displaying chart on cardview if matters. is there need update in code? have searched on website didn't find anything. here j...

Hibernate: two many one to one relationship -

i have 3 tables: user->profile->profiledetails user have 1 row in profile table profile have 1 row in profiledetails table create table if not exists mydb.user ( id int not null auto_increment, name varchar(45) null, primary key (id)) engine = innodb; create table if not exists mydb.profile ( userid int not null, profiledata varchar(45) null) engine = innodb; create table if not exists mydb.profiledetails ( profileid int not null, details varchar(45) null) engine = innodb; how can describe these relationships in hbm.xml files, using one-to-one relationships? i resolve problem. use primary key relations: create table if not exists mydb.user ( id int not null, name varchar(45) null, primary key (id)) engine = innodb; create table if not exists mydb.profile ( user_id int not null, profile_data varchar(45) null, primary key (user_id), constraint fk_profile_user1 foreign key (user_id) references mydb.user (id) on delete...