Posts

linux - How to print hexadecimal double in C? -

i have number in hexadecimal: ffffffffffff and need save it, used double double a=0xffffffffffff; but need print , don't know how to. each time use %f , %d , %x , doesn't print value of it; need print ffffffffffff . code: int main() { double a=0xffffffffffff; printf("%x\n",a); printf("%d\n",a); printf("%x\n",a); printf("%f\n",a); return 0; } the true value %f ; returns decimal value of hexadecimal — returns this: ffffffe0 -32 ffffffe0 281474976710655.000000 with need change hexadecimal string, compare it, because have ffffffffffff in string , need compare both. if can't printf it, neither sprintf work. that's integer, , long one. don't use double store such value, that's floating-point. just use: unsigned long long temp = 0xffffffffffffull; you have 12 hexadecimal digits, number needs @ least 12 * 4 = 48 bits. platforms should have unsigned long long ...

orchardcms - What are the definitions of each of the Lifecycle Events in Orchard's CMS? -

the documentation content handlers in orchard mentions lifecycle events ( http://docs.orchardproject.net/documentation/understanding-content-handlers ). most events self explanatory, wondering if can tell me differences between onactivated , oninitializing , , onloading ? in firing order: onactivated - content item object hierarchy has been created, not yet fetched db used preparing content part further usage. eg. setting getters , setters lazy loaded objects, setting delegates etc. think of of "constructor" given part. oninitializing - content item object hierarchy has been created, not yet fetched db. used setting initial/default property values given part. onloading - content item loaded db. used various things. fired if item exists in database , loaded. orchard core uses event set lazy loaders part records. onloaded - content item has been loaded db used various things. fired if item exists in database , record loaders have been set. can ...

python - Creating a PyCObject pointer in Cython -

a few scipy functions (like scipy.ndimage.interpolation.geometric_transform ) can take pointers c functions arguments avoid having call python callable on each point of input array. in nutshell : define function called my_function somewhere in c module return pycobject &my_function pointer , (optionally) void* pointer pass global data around the related api method pycobject_fromvoidptranddesc , , can read extending ndimage in c see in action. i interested in using cython keep code more manageable, i'm not sure how should create such object. any, well,... pointers? just in cython same thing in c, call pycobject_fromvoidptranddesc directly. here example link ported cython: ###### example.pyx ###### libc.stdlib cimport malloc, free cpython.cobject cimport pycobject_fromvoidptranddesc cdef int _shift_function(int *output_coordinates, double* input_coordinates, int output_rank, int input_rank, double *shift_data): cdef double shift =...

oracle10g - How can I delete similar rows with very specific criteria among similar rows? -

in oracle 10g, have table no exact duplicates, many similar rows. ok, want delete rows 1 specific criteria in collection of similar rows. criteria multiple accounts associated 1 practice_name. delete records null acct value when there multiple accounts practice_name. however, if there 1 instance of practice_name, , acct null, want preserve record. sample data: acct practice_name state phone ======================================= null pract1 mi 111-1111 1523 pract1 mi 111-1111 6824 pract1 mi 111-1111 null pract2 mi 222-2222 8945 pract2 mi 222-2222 null pract3 mi 333-3333 1486 pract4 mi 444-4444 this result like: acct practice_name state phone ======================================= 1523 pract1 mi 111-1111 6824 pract1 mi 111-1111 8945 pract2 mi 222-2222 null pract3 mi 333-3333 1486 ...

xamarin - MvvmCross assembly referenced from Cirrious.MvvmCross.dll could not be loaded: System -

i'm trying set mvvmcross application project , run unit tests against (namely view models in it). i'm using xamarin studio on os x (v. 4.0.4, latest @ time of writing). the mvvmcross app set portable class library. test assembly set plain mono/.net assembly (not pcl) referencing nunit framework. when trying execute tests, fail system.typeloadexception . i have run tests mono binding log on. here's output: mono: following assembly referenced /users/jr/dev/rowinginmotion-cross/rowinginmotion.mobile.boatapp.tests/bin/debug/cirrious.mvvmcross.dll not loaded: assembly: system (assemblyref_index=3) version: 2.0.5.0 public key: 7cec85d7bea7798e system error: invalid argument mono: failed load assembly cirrious.mvvmcross[0x559960] mono: not load file or assembly 'system, version=2.0.5.0, culture=neutral, publickeytoken=7cec85d7bea7798e, retargetable=yes' or 1 of dependencies. is test setup not supported= ...

php - Get facebook user email -

i have facebook app , i'm trying user's email, uncaught oauthexception: unknown path components: /email on using following code: $email= idx($facebook->api('me/email'),'data',array()); function idx(array $array, $key, $default = null) { return array_key_exists($key, $array) ? $array[$key] : $default; } what doing wrong? that's way use normally: $user_profile = $fb->api('/me'); $email=$user_profile['email']; so can it: $email=idx($facebook->api('/me'),'email',array());

java - Hibernate NonUniqueObjectException on merge() , update() -

i errror while updating objects using method update() org.springframework.orm.hibernate3.hibernatesystemexception: different object same identifier value associated session when use method merge() error org.hibernate.nonuniqueobjectexception: different object same identifier value associated session. please help. you need implement 'hashcode' , 'equals' methods right, see here . take care not use id unique property -> separating object id , business key.