Posts

sql - show data in my android app(saving works just fine now) -

hey, can save data in db, doesn't show in database activity itself. @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); oncreatedbanddbtabled(); //db und tables erstellen wenn noch nicht vorhanden setcontentview(r.layout.main); } private void oncreatedbanddbtabled() { mydb = this.openorcreatedatabase(my_db_name, context.mode_private, null); mydb.execsql("create table if not exists " + my_db_table + " ( id integer primary key autoincrement,"+ "name varchar(100),"+ "comment varchar(128),"+ "bookingdetails varchar(255),"+ "customerproject integer(3),"+ "editable varchar(15))" +";"); } public boolean oncreateoptionsmenu(menu menu) { super.oncreateoptionsmenu(...

string - Excel conversion of US date (text) to european date (date) -

i pasting data webpage excel sheet. european excel cannot understand american dates.... paste text. the difference between , european dates day , month in different order. how "us text date" real date "european" excel can understand? reading dates doesn't work, year(), month(), day() not work on native textstring. string conversion must done first. the third column to show problem. result af month function called on text in column "a". taking day month , therefore throws error when reaching 13th of september. text (from web) eu date (real date) month(a1) 9/8/10 10:03 pm 8. sep 2010 8 9/9/10 10:03 pm 9. sep 2010 9 9/10/10 10:03 pm 10. sep 2010 10 9/11/10 10:03 pm 11. sep 2010 11 9/12/10 9:40 pm 12. sep 2010 12 9/13/10 9:40 pm 13. sep 2010 error 9/14/10 9:40 pm ...

c++ - Boost bind with asio::placeholders::error -

why doesn't work? --- boost_bind.cc --- #include <asio.hpp> #include <boost/bind.hpp> #include <boost/function.hpp> void func1 (const int& i) { } void func2 (const ::asio::error_code& e) { } int main () { ::boost::function<void()> f1 = ::boost::bind (&func1, 1); // doesn't work! ::boost::function<void()> f2 = ::boost::bind (&func2, ::asio::placeholders::error); return 0; } this error: while_true@localhost:~> g++ -lpthread boost_bind.cc -o boost_bind in file included boost_bind.cc:2: /usr/include/boost/bind.hpp: in member function ‘void boost::_bi::list1::operator()(boost::_bi::type, f&, a&, int) [with f = void (*)(const asio::error_code&), = boost::_bi::list0, a1 = boost::arg (*)()]’: /usr/include/boost/bind/bind_template.hpp:20: instantiated ‘typename boost::_bi::result_traits::type boost::_bi::bind_t::operator()() [with r = void, f = void (*)(const asio::error_code&), l = boos...

visual studio - MsgProc never receive WM_ messages? -

i had program worked fine , trying make updates now. seems no more receive windows message, wm_lbuttondown or wm_setcursor (wm_create called). don't know what's problem. this layered window created that: wc.cbsize=sizeof(wndclassex); wc.style=cs_classdc; wc.lpfnwndproc=msgproc; wc.cbclsextra=0l; wc.cbwndextra=0l; wc.hinstance=getmodulehandle(null); wc.hicon=null; wc.hbrbackground=null; wc.lpszmenuname=null; wc.lpszclassname="myapp"; wc.hcursor=hmain; registerclassex( &wc ); // create application's window hwnd = createwindowex(ws_ex_layered|ws_ex_topmost, "myapp", "myapp", ws_popupwindow|ws_thickframe|ws_minimizebox|ws_maximizebox, 10, 10, desiredwidth, desiredheight, getdesktopwindow(), null, wc.hinstance, null ); i developping under visual studio express 2008 on windows 7 x64 (i started program on win7 x86) thanks the window isn't visible. add ws_visible style...

javascript - Show|Hide Div depending on show DropDownList -

i know thing simple how show div on specific listitem ? my code is: <asp:dropdownlist id="dropyesno" runat="server"> <asp:listitem text="choose..." value="-1"></asp:listitem> <asp:listitem text="yes" value="1"></asp:listitem> <asp:listitem text="no" value="0"></asp:listitem> </asp:dropdownlist> later on have div: <div id="optional"> <p>please enter reason</p></br> <asp:textbox id="_refuse" runat="server" textmode="multiline" /> </br> </div> this div css hidden default. want when user chooses "no" on drop down,the div appear. know it's done javascript, didn't understand how it. thank you. p.s. i have little related question, if have table in sql db lets call users, , has name , id columns. how load entire columns drop ...

python - Two-way querying in Django without circular reference -

let's have 2 models: post , category . each post has category_id . getting post's category straightforward: post.category . if want posts category? suppose do def posts(self): return post.filter(category__pk=self.id) but if post model , category model in separate files? because post , category require each other, end circular reference. maybe solution put post , category same file. if app has 50 different models, many of them quite large, in separate files? should combine post , category 1 file , leave others separate? should combine 50 models 1 gigantic file? i'm hoping find 1 of 2 things: an answer problem doesn't involve combining files a good, logical reason grouping models same file 1 another. models related extent, draw line far grouping goes? if draw line foreign keys, models end in same file. you can refer models name (i.e., string) rather actual object. in separate applications? in case can refer them using dot notation...

java - Hibernate link between 2 persistence units? -

my question bit tricky try make simple possible: i have 2 maven projects: projeta , projectb. projecta has following persistence.xml file: <persistence-unit name="projectaunit" transaction-type="resource_local"> <class>com.projecta.client</class> <class>com.projecta.interventiona</class> </persistence-unit> interventiona has onetoone relationship client entity. projectb has following persistence.xml file: <persistence-unit name="projectbunit" transaction-type="resource_local"> <class>com.projectb.interventionb</class> <class>com.projectb.interventionorder</class> </persistence-unit> interventionb extends interventiona class (contained in .jar dependency): all 3 classes interventiona, interventionb , client defined in same mysql schema (schema1). but interventionb has @onetoone relationship interventionorder entit...