Posts

android - TableLayout looks fine on emulator but not on device -

android - TableLayout looks fine on emulator but not on device - i'm running code on emulator android 2.2 , works fine. when set on device (galaxy s 2.3.3) main screen should show list of elements in table - stays blank. toasts shown , header app_name the table made of button (defined in xml) , list of elements loaded db. main.xml <?xml version="1.0" encoding="utf-8"?> <scrollview xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <tablelayout android:id="@+id/tablelayoutmain" android:layout_width="match_parent" android:layout_height="wrap_content"> <tablerow> <button android:text="@string/add_button" android:id="@+id/add_button" android:layout_height="wrap_content" android:layout_margint...

c++ - Singleton class pointer assignment doesn't work -

c++ - Singleton class pointer assignment doesn't work - i have class abc singleton.(this c++) when abc *b = abc::getinstance(); abc* a; a=b; then when check in debugger value of b not assigned a. in debugger value of shown 0x00000000 , garbage values members of abc (vs 2008 debugger) i did *b in debugger watch window , see valid values, when *a see null , garbage values (this after above process over) a , b pointers. the address point same, although specific address different. one other reason might you're debugging in release mode, , you're not using variable a afterwards. in case, compiler can decide omit declaration , assignment of a . c++ singleton

sql - strange behavior with Turkish language setting -

sql - strange behavior with Turkish language setting - i have database collation arabic_ci_as when have windows english language settings can do select column table column= 'a' and can do select column table column= 'a' i mean naming not case sensitive in turkish windows if of names not named in db raise error in windows application i mean in turkish windows names must case sensitive any thought explain , how solve such don't face 1 time again in language settings the difference might in collation used. depending on collation, code might case sensitive or case insensitive. you can check server collation command: select serverproperty('collation') somwtimes, database collation may different, check command: select databasepropertyex('databasename', 'collation') for more info, see this article. sql sql-server-2005 sql-server-2000

c# - Pulling Data from 1 DataContext to use in another's Method -

c# - Pulling Data from 1 DataContext to use in another's Method - i have been trying convert sql statement linq 1 , having problem fact part of info returned in seperate database(datacontext) rest. pretty sure can overcome seem failing @ accomplishing or finding examples of previous successful attempts. can offer guidance on overcome hurdle? thanks select p.personid, p.firstname, p.middlename, p.lastname, cp.enrollmentid, cp.enrollmentdate, cp.disenrollmentdate [connect].dbo.tblperson p inner bring together ( select c.clientid, c.enrollmentid, c.enrollmentdate, c.disenrollmentdate [cmo].dbo.tblcmoenrollment c left outer bring together [cmo].dbo.tblworkerhistory wh on c.enrollmentid = wh.enrollmentid inner bring together [cmo].dbo.tblstaffextended se on wh.worker = se.staffid (wh.enddate null or wh.enddate >= getdate()) , wh.worker = --workerguid param here ) cp on p.personid = cp.clientid order p.person...

How to return multiple JSON objects in an AJAX request in django -

How to return multiple JSON objects in an AJAX request in django - currently have view render template , homecoming 2 query lists. view shown below def view_notifications(request,user_id): context_instance=requestcontext(request) user = user.objects.get(pk=user_id) user.profile.notifications = 0 user.profile.save() notices = list(notifications.objects.filter(n_reciever=user.id, is_read=0).order_by('-time')) number = notifications.objects.filter(n_reciever=user.id, is_read=0).order_by('-time').count() if number < 5: old_notices = list(notifications.objects.filter(n_reciever=user.id, is_read=1).order_by('-time')[:5]) else: old_notices = false notifications.objects.all().update(is_read = 1) homecoming render_to_response('profiles/notifications.html', {'new_notice': notices, 'old_notices':old_notices, 'number': number,},context_instance=requestcontext(request))...

doctrine2 - Doctrine update query with LIMIT -

doctrine2 - Doctrine update query with LIMIT - i update-query limit that: update anytable set anycolumn = 'anyvalue' anothercolumn='anothervalue' limit 20 how possible doctrine 2.1 ? not doctrine specific, maybe possible subquery ? class="lang-sql prettyprint-override"> update messages set test_read=1 id in ( select id ( select id messages order date_added desc limit 5, 5 ) tmp ); doctrine doctrine2 doctrine-query

mysql - Can I use ON DUPLICATE KEY UPDATE for multiple fields? -

mysql - Can I use ON DUPLICATE KEY UPDATE for multiple fields? - i have sql insert statement looks this? $sql = "insert profile_answers (user_id, profile_id, question_id, question_answer, timestamp) values ($user_id, $profile_id, {$i}, $answer, now())"; this called 3 times, each time altering question id user_id , profile_id same. possible prevent duplicate entries using 'on duplicate key update first looking @ first 2 fields (user_id, profile_id)? a entry in db this: user_id profile_id question_id 5 7 1 5 7 2 5 7 3 is possible prevent sec insert of ( 5, 7, 1) example? alter table profile_answers add together unique index(user_id, profile_id, question_id); this prevent inserting same values twice these columns. mysql