Posts

visual studio - Where to store the state of ribbon controls in a Word 2010 addin -

i'm using visual studio 2010 create word 2010 addin custom ribbon. has various checkboxes , editboxes on it. store state of checkboxes , values in editboxes when document closed? use exiting document property , de/serialize myself? or word have mechanism this? you use document properties, or might consider custom xml part, xml document containing whatever xml like, included in docx part.

Perl Get Parent Folder Name -

what solution name of parent directory using file::find. know how filename or directory path don't know how last containing directory. for example, if directory /dir_1/dir_2/dir_3/.../dir_n/*.txt need ' dir_n ' name. use strict; use warnings; use file::find; $dir = "some_path"; find(\&file_handle, $dir); sub file_handle { /\.txt$/ or return; $fd = $file::find::dir; $fn = $file::find::name; # ... } given directory path, apply file::basename (another core module) path obtain last portion of directory. use strict; use warnings; use file::find; use file::basename; $dir = "some_path"; find(\&file_handle, $dir); sub file_handle { /\.txt$/ or return; $fd = $file::find::dir; $fn = $file::find::name; $dir = basename($fd); # .... }

algorithm - Axiom resolution -

i try understand how axiom resolution works in prolog. let's assume define 2 basic operations on natural numbers: s(term) (stands successor) and add(term, anotherterm). the semantic of add given by add (0, x1) -> x1 add (x1, 0) -> x1 add(s(x1), y1) -> s(add(x1, y1)) then, solve equation add (x, add(y, z)) = s(0) i imagine 1 strategy to test if right hand side (rhs) of equation equal left hand side (lhs) if not see if solution can find looking general unifier if not try find axiom can used in equation. strategy doing job (for each axiom): try solve rhs of equation equals rhs of axiom. if there solution try solve lhs of equation equals lhs of axiom. if succeeds, have found right axiom. eventually, if there no solution , lhs , rhs of equation same operation (i.e. same signature not same operands), apply algorithm on each operand , solution found if solution found each operand. i think (simple) algorithm may work. however, know if has experien...

css - Padding/Margin for Images within a DIV -

ok. made updates website. http://annberingerart.com/index.php upon making minor changes seems margin , padding images on index page has changed. there equal padding both vertically , horizontally between images consistent margin. in addition, viewing website on friend's mac safari 5 installed , entire wrapper seemed have shrunk in size because not contain children had before made changes. you can take @ css in firebug lengthy , excessive post 400+ lines of css on here. any , criticism welcome, want advice on how fix issue. your horizontal margin caused spaces / new-lines because images inline elements (sort of inline-block really...). if float images, have more control on exact margins instead of depending on width of space / new-line. to solve problem, could: float images left; give wrapper left-padding, no right-padding , overflow:hidden ; give images right padding (the same left-padding of wrapper).

iphone - UIButton select state's image appears behind normal state's image -

i have uibutton has images set both normal , selected state. understand, when switch button.selected state yes / no, should toggle between 2 images. sure does. selected state image apear behind normal state one. the reason can see because normal state play button , middle triangle transparent. can see pause button appear behind it. anyone know problem and, maybe how fix it? thanks :) managed fix not using state variable it. i'm explicitly setting image each time. kinda lame works.

javascript - Use arrays to add up values based on the title or the alt attribute -

calculating form has options , based on client enters determines products load in sidebar. products given quantity directly reflects value of option. so per product there total price, total duration , total number of dives seen here. num1=number(document.getelementbyid('product_quantity_' + productid).value); num2=number(document.getelementbyid('product_price_' + productid).value); nums=num1*num2; document.getelementbyid('product_price_total_' + productid).value = nums; num1=number(document.getelementbyid('product_quantity_' + productid).value); num2=number(document.getelementbyid('product_duration_' + productid).value); nums=num1*num2; document.getelementbyid('product_duration_total_' + productid).value = nums; num1=number(document.getelementbyid('product_quantity_' + productid).value); num2=number(document.getelementbyid('product_dives_' + productid).value); nums=num1*num2; document.getelementbyid('product_...

Chrome HTML notifications not executing JavaScript -

i'm working on chrome extension uses notificaions api. i'm wanting use html notification build link need make callbacks background page data. problem none of javascript executing in notification page. know it's possible because use other extensions this. there special need enable this, in manifest? and answer make sure jquery plug-in file you're using isn't corrupted.