Posts

javascript - Angular JS dialog from Angular UI does not close completely -

i'm in process of closing dialog follows: $state.transitionto('login'); $dialog.close(); but have line/bar sits near top of screen dialog hasn't closed properly. it's it's collapsed o possibility of reopening again. if knows why , how can fixed please reply! thanks! yes indeed should have been calling close on modal instance how can carry on when have: .state('login.authenticate',{ onenter: function($stateparams, $state, $dialog ) { var d = $dialog.dialog({ keyboard: true, backdropclick: true, dialogfade: true, backdrop: false, }); d.open("login/authenticate/authenticate.tpl.html", 'authenticationctrl'); } }); this opens view opens 1 of 2 other views each own module , controller (using ng-boilerplate layout). i configure state again when enter login.authenticate state can nest new modules...

Rails 400 and 500 error page in development mode -

i trying display 500 error page whenever exception occurs. below setting in development.rb file config.consider_all_requests_local = false and override method local_request in application_controller.rb file def local_request? false end but still not able display 500 page on local machine in case of exception. tried run app on production mode, still getting same result.however can display 500 web page using ip address.plz are routing them properly? can custom error pages putting in application.rb: # error handling config.exceptions_app = self.routes then in routes.rb file: ## routes exceptions match '/404', to: "static#not_found", as: "not_found" match '/422', to: "static#rejected", as: "rejected" match '/500', to: "static#something_wrong", as: "something_wrong" assuming have "static" contro...

sqlite - Unable to serialize custom object activeandroid -

i trying store custom object blob in sqllite db. object field of class extending model. other fields (of primitive types) go in db, custom 1 - null always. @table(name = "data") public class data extends model { @column(name = "number") private int number; @column(name = "blob") private contact blob; ... this how store entity data data = new data(0, new contact(id, name, number)); data.save(); here contact class public class contact { private string id; private string name; private string number; ... i believe typeserializer needed, i've created one. public class contactserializer extends typeserializer { private static final string elements_delimiter = ";"; @override public object deserialize(object asstring) { string[] aftersplit = ((string) asstring).split(elements_delimiter); return new contact(aftersplit[0], aftersplit[1], aftersplit[2]); } @override public class<?> getdeserializedtype() { retur...

c# - Can't open folders with spaces -

i have following code read items ftp-server: internal list<ftpitem> openfolder(string foldername) { ftpwebrequest request = createftpwebrequest("ftp://myserver.com", foldername); request.method = webrequestmethods.ftp.listdirectorydetails; list<ftpitem> ftpitems = getftpitemsfromrequest(request); return ftpitems; } private list<ftpitem> getftpitemsfromrequest(ftpwebrequest ftpwebrequest) { list<ftpitem> ftpitems = new list<ftpitem>(); webresponse webresponse = ftpwebrequest.getresponse(); streamreader reader = new streamreader(webresponse.getresponsestream()); string line = reader.readline(); while (line != null) { ftpitems.add(new ftpitem(line)); line = reader.readline(); } reader.close(); webresponse.close(); return ftpitems; } private ftpwebrequest createftpwebrequest(params string[] url) { ftpwebrequest webrequest = (ftpwebrequest)webrequest.create(string.join("/", ...

Specifiying dataset within a SPARQL query -

in tutorial i'm reading, see can specify dataset separately query, this: dataset field: http://dig.csail.mit.edu/2008/webdav/timbl/foaf.rdf query: prefix foaf: <http://xmlns.com/foaf/0.1/> select ?name { ?person foaf:name ?name . } how specify dataset within query? use from keyword: prefix foaf: <http://xmlns.com/foaf/0.1/> select ?name <http://dig.csail.mit.edu/2008/webdav/timbl/foaf.rdf> { ?person foaf:name ?name . } note: use after select statement

c++ - Convert UTF8 encoded byte buffer to wstring? -

does c++ standard template library (stl) provide method convert utf8 encoded byte buffer wstring? for example: const unsigned char* szbuf = (const unsigned char*) "d\xc3\xa9j\xc3\xa0 vu"; std::wstring str = method(szbuf); // should assign "déjà vu" str i want avoid having implement own utf8 conversion code, this: const unsigned char* pch = szbuf; while (*pch != 0) { if ((*pch & 0x80) == 0) { str += *pch++; } else if ((*pch & 0xe0) == 0xc0 && (pch[1] & 0xc0) == 0x80) { wchar_t ch = (((*pch & 0x1f) >> 2) << 8) + ((*pch & 0x03) << 6) + (pch[1] & 0x3f); str += ch; pch += 2; } else if (...) { // other cases omitted } } edit : comments , answer. code fragment performs desired conversion: std::wstring_convert<std::codecvt_utf8<wchar_t>,wchar_t> convert; str = convert.from_bytes((const char*)szbuf);...

mysql - declaring and using variables in a trigger -

i declaring variables in mysql trigger delimiter // create trigger lestrigger after insert on examinations each row begin declare the_last_inserted_id int ; declare the_class_id int; declare the_year_id int; set the_last_inserted_id = last_insert_id(); set the_class_id = select examination_class_id examinations examination_id = the_last_inserted_id; set the_year_id = select examination_class_year_id examinations examination_id = the_last_inserted_id; insert examination_data (ed_cs_id,ed_examination_id) select cs_id class_students cs_class_id = the_class_id , cs_year_id = the_year_id,the_last_inserted_id; end // delimiter ; but keep getting error /* sql error (1064): have error in sql syntax; check manual corresponds mysql server version right syntax use near 'select examination_class_id examinations examination_id = the_last_in' @ line 10 */ is way using variables syntactically right?. use into keyword ht...