Posts

git merge - Git Subtree Merging reports conflict when merging a simple upstream change -

i'm getting started learning subtree merging in git 1.8.2. have created simple example test change third party repo migrating main project. i'm following 6.7 git tools - subtree merging example. the 'sub' project included subdirectory in 'main' project. after make change 'sub' project, git reports conflict when try merge change 'main' project. test summary created repos projects 'main' , 'sub' (sub instead of rack) add remote named sub_remote main refers sub track sub_remote using sub_branch change , commit 1 line in file in 'sub' project pull changes sub on main/sub_branch merge main/sub_branch main/master. the merge fails conflict. merge confused version of changed line keep. <<<<<<< head main ======= main upstream change >>>>>>> sub_branch main.git sub sub.git tm complete test script #!/bin/sh # initialize empty repos in main sub rm -rf $i{,.g...

haskell - Interpreting unsigned integers as signed while widening -

suppose i've got lot of values of type word8 , word16 , , word32 lying around. want widen them, interpreting signed , unsigned, can store them in [int64] . know can write following function, first argument specifies whether want interpret word8 signed or not: convert8 :: bool -> word8 -> int64 convert8 false = fromintegral convert8 true = fromintegral (fromintegral :: int8) this gives me result want: *main> convert8 false 128 128 *main> convert8 true 128 -128 the double fromintegral feels inelegant me, though. there nicer way "interpret word signed integer , stick in bigger int "? from recall, ghc stores integers 1 machine word. (in other words, 32-bit ghc stores integers 32 bits. 64-bit ghc stores them 64 bits.) if request 8-bit integer, stores 32 bits anyway, uses first 8 bits. because of this, i'm sure widening or narrowing using fromintegral no-op @ run-time; change type signature, no run-time cost. (converting unsigned si...

Python - Capture exit status of command executed via SSH -

i need way capture exit status command run through ssh. exit status end within variable. cannot seem working though. command simple like: os.system("ssh -qt hostname 'sudo yum list updates --security > /tmp/yum_update_packagelist.txt';echo $?") anyone have idea? i've tried has either not worked @ all, or ended giving me exit status of ssh command, not underlying command. you want use ssh library paramiko (or spur , fabric , etc.… google/pypi/so-search "python ssh" see options , pick 1 best matches use case). there demos included paramiko want do. if insist on scripting command-line ssh tool, (a) want use subprocess instead of os.system (as os.system docs explicitly say), , (b) need bash-scripting (assuming remote side running bash) pass value (e.g., wrap in one-liner script prints exit status on stderr ). if want know why existing code doesn't work, let's take @ it: os.system("ssh -qt hostname 'sudo y...

iphone - Why are my images not displayed -

i have class inherits uiviewcontroller lets call 'controller' outlet uicollectionview. class inherited uicollectioncell lets call 'a' , uiimage lets call 'b', has outlet of b i wrote following code in 'controller': - (uicollectionviewcell *)collectionview:(uicollectionview *)p_collectionview cellforitematindexpath:(nsindexpath *)p_indexpath { uicollectionviewcell* cell = [self getuicollectionviewcellfromcollectionview:p_collectionview atindexpath:p_indexpath]; if([cell iskindofclass:[imagecollectionviewcell class]] == yes) { //draw image inside view imagecollectionviewcell* imagecell = (imagecollectionviewcell*)cell; nsstring* imageurl = self.objecttoshow.imagesurl[p_indexpath.item]; uiimage* currentimage = [[uiimage alloc] initwithcontentsoffile:imageurl]; imagecell.imageview.image = currentimage; } return cell; } everything initialized correctly images not displayed, have no clu...

python - Issue with Purchase Requisition Module - OpenErp -

i got error when click on "confirm requisition" button in module "purchase requisition" file "c:\program files\openerp 7.0-20130321-002353\server\server\openerp\addons\purchase_requisition\purchase_requisition.py", line 215, in wkf_confirm_order attributeerror: 'purchase.order' object has no attribute 'signal_purchase_cancel' the error code in 'purchase_requisition.py' follows: class purchase_order(osv.osv): _inherit = "purchase.order" _columns = { 'requisition_id' : fields.many2one('purchase.requisition','purchase requisition') } def wkf_confirm_order(self, cr, uid, ids, context=none ): res = super(purchase_order, self).wkf_confirm_order(cr, uid, ids, context=context) proc_obj = self.pool.get('procurement.order') po in self.browse(cr, uid, ids, context=context): if po.requisition_id , (po.requisition_id.exclusive=='exclusive'): order i...

java - JOptionPane Multidimensional Array output -

ok have multidimensional array want display in joptionpane.showmessagedialog . know when using system.out.println , use loop. array size determined user input, therefore have use incrementor. for example: userinput[k] next usernumber[k] next row userinput[k+1] next usernumber[k+1] the trouble having using loop, each set 1 @ time in separate windows , not in table in 1 window. for (int k = 0; k < userinput.length; k++){ joptionpane.showmessagedialog(null, userinput[k]); } (int k = 0; k < 2; k++){ joptionpane.showmessagedialog(null, usernumber[k]); } build output single string . you can use html tags provide additional formatting stringbuilder sb = new stringbuilder(64); sb.append("<html><table>"); (int ui = 0; ui = < userinput.length; ui++) { sb.append("<tr><td>"); sb.append(userinput[ui]); sb.append("</td>"); (int k = 0; k < 2; k++){ sb.append("<td...

c++ - Why isn't a vector of a vector guaranteed to be contiguous? (or is it?) -

i know std::vector elements guaranteed contiguous in memory. so why can't expect vector containing other vectors have total collection contiguous? the vector supposed guarantee contiguous memory layout enclosed items, , if enclosures vectors, i'd expect full contents of top-most vector in contiguous memory. but there seems contention on issue whether or not true. can 1 safely rely on or not? folks seem go out of way achieve this, while i'd think guaranteed. each of vector inside vector of vectors individual object, , such responsible it's storage. so, no, no means guaranteed contiguous, in fact can 't see situation happen data stored in outer vector , it's inner vectors 1 contiguous block of memory ever.