Posts

Showing posts from January, 2010

postfix and prefix in printf and for function (C) -

this question has answer here: what difference between ++i , i++? 17 answers i'm sorry, i'm still noob @ c. wonder why post , prefix have different effect in "printf" have same effect in "for"or maybe in other loop ? example : #include <stdio.h> main() { int number = 0; printf("%d.\n", ++number); //it prints 1 return 0; } ............... printf("%d.\n", number++); //it prints 0 ............... but in "for" #include<stdio.h> main() { int number; (number = 0; number < 5; ++number); { printf("%d\n", number); //it prints 0,1,2,3,4 } return 0; } ............. (number = 0; number < 5, number++); { printf("%d\n", number); //it prints 0,1,2,3,4 } ......................... in for , result of third exp

terminal - BMDCapture (bmdtools) capture with Ultrastudio Mini recorder results is color problems -

Image
i'm trying blackmagic ultrastudio mini recorder stream via avconv hls. test, it's hooked appletv , command i'm using: ./bmdcapture -m 14 -c 0 -f nut -f pipe:1 | avconv -vsync passthrough -y -i - -vcodec copy -pix_fmt yuyv422 -strict experimental -f hls -hls_list_size 999 +live -strict experimental out.m3u8 however, colors messed up; suggesting color format set incorrectly. input format 1280x720 @ 59.94 fps (which correct) , i've set format yuyv422 (though nothing else i've set has fixed error). got it! the mini recorder shoots @ 10 bits rather 8 (which assumed considering adobe's live encoder said 8). here fixed code: ./bmdcapture -m 14 -p yuv10 -c 0 -f nut -f pipe:1 | avconv -vsync passthrough -y -i - -vcodec copy -pix_fmt uyvy422 -strict experimental -f hls -hls_list_size 999 +live -strict experimental out.m3u8

vb.net - WCF webservice with custom certificate validation -

i hosting wcf webservice custom certificate validation, not able configure properly. when try wsdl of webservice, compilation error below. doing wrong? thanks edit: i've looked into: custom certificate validation in wcf service , authentication of clientcertificate element , how to: create service employs custom certificate validator , x.509 certificate validator , none of links describe issue having. compilation error message: could not load file or assembly 'service' or 1 of dependencies. system cannot find file specified. description: unhandled exception occurred during execution of current web request. please review stack trace more information error , originated in code. exception details: system.io.filenotfoundexception: not load file or assembly 'service' or 1 of dependencies. system cannot find file specified. source error: unhandled exception generated during execution of current web request. information regarding origin , location of e

internet explorer - Strange IE11 HTML5 Video Issue -

i have been stumped before, never quite this. please bear me. i have embedded mp4 video web page using html5 video tag follows: <video poster="/media/video/cick_away_poster.png" controls width="560" height="315"> <source src="http://www.lpcsc.k12.in.us/media/video/click_away.mp4" type="video/mp4" /> <p>your browser not support video.</p> </video> the page hosted in house, on our corporation website. tried both relative , absolute links, used complete url video troubleshooting on different servers outside of our network. more on later. i didn't think there issue until few people in our corporation informed me not see video in ie11 on pc. i had them try in chrome , worked fine. i double-checked in both ie11 , chrome on pc , works fine i tried on freshly cast, updated windows 7 pc, , did not work , shows "your browser not support video." i tried in chrome on new pc, , works fine

user interface - Start and stop loop in javascript with start and stop button -

this question has answer here: implementing pause , resume mechanism javascript loop execution 2 answers i have start button when clicked runs function loops. how stopbtn.onclick stop running loop? https://jsfiddle.net/vduxbnkj/ startbtn.onclick = function(){ runloop(); } function runloop(){ while(condition true){ getfoldercontentsloop(); } } function getfoldercontentsloop(){ //loop through folders & files looking .txt file , if "finished" delete files , folders } if you're running simple for (..) loop, cannot stopped via external influence. happening on same thread in javascript, unless code "ends" @ point , returns control browser while no ui interaction can happen. easiest way have "loop" via settimeout or setinterval : interval = null; startbtn.onclick = function () { var = 0;

javascript - JQuery catch an event on Paragraph change -

i make script that, when text of paragraph change, start function, tried follow don't think method change() works paragraph $("#myparagraph").change(function(){......}) you wrap tag or "paragraph" in container, , bind container event possibly. using length of "text" property. during triggered event, check state different. can write example if need one. 1 place @ //global variable. store in hidden field if like. var currentval = $('element').text(); $('element').bind("domsubtreemodified",function(){ var newval = $(element).text(); if(currentval != newval) { //call function here. } }); this basic , simple, give idea.

jquery - Make top section fill screen above the header in a onepage website -

i'm trying make onepage website splash page @ top scroll down header. i want top section fill whole screen header @ bottom hidden when user first loads page. place link on splash page scroll down header. how can this? my website www.sleepn9.com/home.htm my css top section is: .stop {height: 100%;background: url('img/top_bg.jpg') center no-repeat;} because using percentage,you need give parent (probably html, body in case) height section knows of 100%: js fiddle html, body { height: 100%; width: 100%; margin: 0; }

javascript - I need a customized Numeric keypad for mobile -

i'm developing hybrid app , want app open customized numeric keypad looks same on devices. there angularjs directive? i ran same problem before needed consistent numeric keypad looks same on devices , ended creating one. can find on github: code demo it's module composed of numeric keyboard directive should 1 copy in whole app, it's template actual keyboard numeric keyboard input directive, it's clickable directive opens keyboard, need attach editable element want input be. numeric keyboard service, handles communication between 2 directives. angular.module('numerickeyboard').factory('numerickeyboardservice',numerickeyboardservice); angular.module('numerickeyboard').directive('numerickeyboard', numerickeyboard); angular.module('numerickeyboard').directive('numerickeyboardinput', numerickeyboardinput);

ios - WatchKit Force Menu Custom Icons Blurry -

Image
i'm creating custom icons watchkit force menu. documentation says use 80 x 80 size image drawing area of 54px square. works fine, image, when displayed in button, looks blurry compared built-in button images. i'm creating them in illustrator @ 80px square. saving .png image documentation says. sizing correct when saved @ 72 dpi. if higher causes image in button large. cannot find way scale image. has run this? seems want use higher resolution image here or vector graphics. you need save file @2x in filename support retina displays. so if filename myicon.png rename myicon@2x.png . in code use myicon name, xcode automatically picks correct size. for iphone 6, @3x required... i recommend use images.xcassets in xcode maintaining images. there templates needed resolutions (@1x, @2x, @3x, ...). create icons in these several resolutions , drag files finder placeholders. later in code use name of image set in xcassets.

algorithm - What is the performance of arbitrary ordering in PostgreSQL? -

in postgres in possible perform order so select * mytable id in (8, 6, 7, 5, 10, 24) order id=8 desc, id=6 desc, id=7 desc, id=5 desc, id=10 desc, id=24 desc; to select arbitrary data in arbitrary order. i have figured if sorting algorithm has has o(log n), , naively indexof sort so: data.sort(function(a, b) { return indexof(a) < indexof(b); }); then each sorting operation may take o(2n), making our total algorithmic time o(n log n). we can create simple index of values positions instead of resorting each time. assuming has worst time of o(log n) well, get, our sorting algorithm, o((log n)(log n)) or o((log n)^2). not great performance algorithm. what algorithm, performance, postgres use? if better o((log n) * the_sort_algorithms_performance), implement sorting outside of db. alternatively, if algorithm 1 can port java may still not sorting in postgres. tldr; not going details broad question. sort algorithms complex field. as query : if provide list

php - PHPExcel insert array formula -

i want insert array formula: {=sum(if(frequency(if(t9:t977=1,match(u9:u977,u9:u977,0)),row(u9:u977)-row(u9)+1),1))} but when i'm using: $sheet->getcell("c1")->setvalue("{=sum(if(frequency(if(t9:t977=1,match(u9:u977,u9:u977,0)),row(u9:u977)-row(u9)+1),1))}"); it doesn't work, i've checked documentation, still haven't found anything. i couldn't find answer went through phpexcel , made myself solution: in /phpexcel/cell.php @ row 251 in switch($pdatatype) add this: case phpexcel_cell_datatype::type_formula_array: $this->_value = (string)$pvalue; break; in /phpexcel/cell/datatype.php add constant: const type_formula_array = 't'; at last in /phpexcel/writer/excel2007/worksheet.php i've added in switch beginning @ row 1095: case 't': // array formulae $objwriter->startelement('f'); $objwriter->writeattribute('t', 'array'); $objwriter->

sorting - C++ - invalid operands to binary expression -

i trying use std::sort sort list of structs. getting error: invalid operands binary expression ('std::__1::__list_iterator<process, void *>' , 'int') __sort3<_compare>(__first, __first+1, __j, __comp); struct: struct process { int process_id; int cpu_cycles; int mem_footprint; }; main function: int main() { list<process> process_list; init_process_list(process_list); sort(process_list.begin(), process_list.end(), compare_pid); } init_process_list: void init_process_list(list<process> &p_list) { cout << "\n>> generating process list..."; generator generate; // random number generator class process p; for(int = 0; < process_count; i++) { p.process_id = i; p.cpu_cycles = generate.rand_num_between(cycle_lbound, cycle_ubound); p.mem_footprint = generate.rand_num_between(mem_lbound, mem_ubound); p_list.push_back(p); } cout

javascript - Usage of call(), in chris coyers example of custom events -

i going through chris coyers examples of custom events , come across following code : $.fn.faq = function(options) { return this.each(function(i, el) { var base = el, $base = $(el); console.log(options); base.init = function() { // initialization stuff $base .find("dd") .hide() .end() .find("dt") .click(function() { var ans = $(this).next(); if (ans.is(":visible")) { base.closeq(ans); } else { base.openq(ans); } }) }; base.openq = function(ans) { // open panel ans.show(); // callback options.qopen.call(); }; base.closeq = function(ans) { // open panel ans.hide(); // callback options.q

Python Regex re.sub not working in For loop -

i unable replace particular occurrence of pattern edited text. have used for...loop come how specific occurrence of pattern unable use re.sub statement. this python 2 code: def split(content): count = 0 s = "" in re.finditer(r'(?s)(\\thinhline\n\\\\\[-16pt]\n)([a-za-z\s\(\)]+)(.*?)(\n *\\\\)', content): count= count + 1 x = len(re.findall('^\s*&', i.group(3), re.m)) if x < 6: break elif x >= 6: g = normalizationconstraints(i.group(3),i.group(2)) + "\n" s = str(g) + "\n" content = re.sub(i,s,content) return content the error on line: content = re.sub(i,s,content) since variable "i" apparently not regex. the error: typeerror: first argument must string or compiled pattern how can fix problem?? thanks. i'm not sure want, error telling right thing: i isn't regex pattern. re.findit

How to use the AND operater in javascript within an XSLT document -

i've got script in xsl document , it's throwing error when try , use javascript , operator (&&). if (input1=="" && input2==""){ alert ("test"); } the error comes is: xml parsing error: not well-formed , points && operator. how can around this? if writing xslt writing xml document , xslt code needs well-formed xml. either escape ampersands &amp;&amp; or use cdata section <script><![cdata[ if (input1 == "" && input2 == "") { alert("test"); } ]]></script> if trying create html or svg script elements in xslt of course third option make use of external scripts e.g. put javascript code .js file , reference <script src="file.js"></script> , way don't have take efforts escape script code according xml rules.

monetdb - Is concurrent query execution supported -

is concurrent query execution supported in monetdb? while testing simultaneous query execution found 1 query getting executed @ 1 time. rest of queries put of hold until first 1 gets completed. test database has 13 million records, trying run same query 3 clients connected same monetdb server. example of query: select field1,field2,count(*) def.testdata group field1,field2 i missing here. there multi user mode setting? i running on 2 cpu 16gb host parallel query execution (of course) supported. however, there bug might lead sequential behavior, in 2-cpu setting. see https://www.monetdb.org/bugzilla/show_bug.cgi?id=3665 . has been fixed, not released yet. checkout oct2014 branch our source repository ( hg clone http://dev.monetdb.org/hg/monetdb/; cd monetdb; hg update oct2014 ) , compile it.

python - Why doesn't it take a new value from the list -

i have problem taking new values list velocity. instead of taking new values each iteration, takes same value. have clue problem is? def average_wind(dia): wind_list=[] velocity=[20,1,1,30,1,1,1,98,1,1,1,1,1] t in range(1,13): r=0.2 area=klass.windpower.calc_area(dia) energy=1*klass.windpower.calc_wind_energy(area,velocity[t]) wind_list.append(energy) return (wind_list) another question, see wrong how coded formula, similar formula pa = 1/2*0.35*1.2*a*v^3: def calc_wind_energy(self,area,velocity): energy=(0.35*1.2*area*(velocity ** 3))*0.5 return energy

SQL Server - find the person(s) that are each in all of the specified groups -

declare @person_groups table (person_id int not null, group_id int not null) insert @person_groups(person_id, group_id) values (1000, 501) --sample data insert @person_groups(person_id, group_id) values (1001, 501) --sample data insert @person_groups(person_id, group_id) values (1001, 502) --sample data insert @person_groups(person_id, group_id) values (1001, 503) --sample data insert @person_groups(person_id, group_id) values (1002, 502) --sample data insert @person_groups(person_id, group_id) values (1002, 503) --sample data declare @tempgrouplist table (group_id int) insert @tempgrouplist(group_id) values (501) --sample data insert @tempgrouplist(group_id) values (502) --sample data insert @tempgrouplist(group_id) values (503) --sample data i need find person ids in table @person_groups each in every group listed in @tempgrouplist pseudo code group list of 501, 502, 503,... : select person_id @person_groups person_id member of group #501 , same person member of grou

Java with a for loop with in for loop -

i not sure why isn't working questionhave use 1 dimensional integer array count number of times each possible sum appears in 36000 rolls. however problem keep getting 0.0 instead of 1200000 or 700000. import java.util.arrays; import java.util.random; public class stocksim { public static void main(string args[]) { double data[] = new double[10]; system.out.println(percentgen()); double percent; (int = 0; < data.length; i++) { percent = percentgen(); data[i] = data[i] + (data[i] * percent); } } (int = 0; < data.length; i++) { system.out.println(data[i]); } } public static double percentgen() { random rand = new random(); return randomnum; } } it simple fix, forgot actual percentage dividing random percentage 1 hundred. substitute return randomnum return randomnum/100 . besides that, tested code ,

java - How to download file from URL all * files -

i download *.dmg files particular url using java code. e.g. http://testurl.com/filerepository/ host *.dmg , *.dmg files original file names using java program , store them original file name local drive. i able download individual files if know file name problem don't know file names, know these files dmg files. please answer. below sample program public static void main(string[] args) throws ioexception { string filename = "mypackage.dmg"; //the file saved on computer url link = new url("http://mytesturl/filerepository/"+filename); //code download inputstream in = new bufferedinputstream(link.openstream()); bytearrayoutputstream out = new bytearrayoutputstream(); byte[] buf = new byte[1024]; int n = 0; while (-1!=(n=in.read(buf))) { out.write(buf, 0, n); } out.close(); in.close(); byte[] response = out.tobytearray(); fileoutputstream fos = new fileoutputstream(filename);

ember.js - Ember data - computed property not firing when model is updated with createRecord -

for reasons beyond scope of question, have populate ember data model named activity in searchroute using ember.$.getjson in model hook this: app.searchroute = ember.route.extend({ model: function (params) { // create promise return model hook. promise return ds.recordarray. var modelpromise = new ember.rsvp.promise(function (resolve, reject) { // make ajax call retrieve activities match search criteria ember.$.getjson('/services/activities?query=' + params.q).then(function (data) { data.activities.foreach(function (activity) { // if current activity not exist in store... if (!this.store.hasrecordforid('activity', activity.id)) { // add activity store this.store.createrecord('activity', { id: activity.id, title: activity.propertybag.title });

Executing Mozart-Oz code in command line -

i'm trying use mozart oz . download execution binary source forge: http://sourceforge.net/projects/mozart-oz/ . when launching mozart.app, emacs (aquamacs mac os x) starts coding within it. for example, can type in {browse 'hello world'} , execute oz -> feed buffer result in tcl/tk browser. then, how can build or execute oz code in command line python or ruby? i found binaries in bin directory. /applications/mozart2.app/contents/resources/bin ├── oz ├── ozc ├── ozemulator ├── ozengine └── ozwish however, when execute code ozc -c hello.oz , got %** variable browse not introduced error. might wrong? you must use browser.browse actually, every function must imported/created when building application in oz. when import browser, record functions browser object class export. (see https://mozart.github.io/mozart-v1/doc-1.4.0/browser/node2.html ) thus, code is functor import browser define {browser.browse 'hello

swift - Implicitly unwrapped multiplication and division -

i've isolated following code in playground. in playground, noted compile time errors: class myclass { var weight: double! func toounces() { weight *= 0.035274 // 'double!' not identical 'uint8' weight = weight * 0.035274 // works } func tograms() { weight /= 0.035274 // 'double!' not identical 'float' weight = weight / 0.035274 // works } } i following example online using nscoder, decodedoubleforkey() double? being used, hence implicitly unwrapped optional var weight: double! . i'm debating how correct do, , fixed in code. my question is, why these compile time errors? why multiplication compare uint8 , division compares float? there i've been missing years regarding *= , /= ? i'm still learning this, i'm missing basic property. you can make *= operator work explicitly unwrapping optional first so: func toounces() { weight

tomcat - Vaadin web app stops responding until I clear browser data or use Chrome incognito -

i have vaadin web app (servlet version 3.0 websocket push) compile war file , deploy on tomcat 8 (on linux 64-bit rhel 6 webserver). use google chrome on home network try connect it. description after fresh deployment, using google chrome connect it, app works fine (and responsive) first 15-20 minutes of use. after that, stops responding. reload bar gets stuck, , trying reconnect page doesn't work (new tab, new browser instance). chrome stuck on "waiting (host)...". when clear browsing data (all of it), can connect web app normal. also, if use chrome incognito mode (with no browsing history), web app works fine. same true firefox attempted solutions in tomcat i tried adding following parameters tomcat context.xml: <context cachingallowed="false" cachemaxsize ="0" cachettl="1"> attempted solutions in vaadin i tried connecting webapp ?restartapplication option vaadin i tried 3 different implementations of push (web

css - Full-page / holy Grail layout with flex -

i trying use flexbox latest browsers (ff 36, chrome 41, opera 28, safari 8) achieve full-page holy grail layout. i've gotten working in firefox. the page split vertically header, main, footer. main split horizontally 3 panels. each panel should scroll independently if content overflows bounds. firefox 1 not this. here example: http://jsfiddle.net/bpnjx3v9/1/ html, body { margin: 0; height: 100vh; width: 100vw; display: flex; flex-direction: column; background-color: blue; } #header, #footer { flex: 0 0 100px; background-color: blue; } #main { background-color: yellow; flex: 1 0 0px; /** don't set parent of component auto */ display: flex; flex-direction: row; } .panel { display: flex; flex-direction: column; flex: 1 0 auto; overflow: auto; } what don't understand after reading spec how make #main use height allocated them parent. instead ff seems make "intrinsic height

php - Connecting database to android using json -

as new application development using json connect database using php having error following code: public class mainactivity extends activity { edittext etemail, etpass; button login, register; textview terror; progressdialog pdialog; //textview ptodoc; private static string key_success = "success"; //private static string key_error = "error"; private static final string key_referred_as = "referred_as"; private static final string key_email = "email"; private static final string key_card = "card"; private static final string key_address = "address"; private static final string key_contact_no = "contact_no"; private static final string key_id = "id"; private static final string key_dateofbirth = "dateofbirth"; @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); // set

angularjs - How to access $scope from $resource -

i need splice array on success. how call out $scope.list in order remove item list array? how should or there better way? bubbling "update" or something? var phonecatservices = angular.module('phonecatservices', ['ngresource']); var urlbase = 'http://example.com/api/'; function resourceerrorhandler(response) { console.log("error"); } function resourceresponsehandler(response) { console.log($scope.list); $scope.list.data.splice(index, 1); console.log("success"); } phonecatservices.factory('api_resource', ['$resource', function($resource){ return $resource(urlbase+':api_resource/:id.json', {}, { query: {method:'get', isarray:false}, save:{method:'post', isarray:false}, delete:{method:'delete', isarray:false, interceptor:{response:resourceresponsehandler, responseerror:resourcee

bash - Awk or Sed to join multiple lines separated with blank line -

i managed create file needs formatted csv import: here records: (202) 111-0000 1 full name street address city, state zip (212) 222-9999 2 full name street address city, state zip (312) 888-2222 3 full name street address city, state zip etc i looking transpose this: (202) 111-0000,1,full name,street address,city,state,zip (212) 222-9999,2,full name,street address,city,state,zip (312) 888-2222,3,full name,street address,city,state,zip notice how city state , zip have been comma delimited in desired output. any awk or sed gurus willing me out this? thanks much. i assume have access gnu awk , sed. in order zip part right, let's use sample input: $ cat file (202) 111-0000 1 full name street address city, state 10023 (212) 222-9999 2 full name street address city, state 10023 (312) 888-2222 3 full name street address city, state 10023 we can transpose follows: $ awk -v rs="" -f'\n' -v ofs=, '{$1=$1} 1' file | sed -r 

html - readonly textarea to fit the content with angularjs -

what easiest way make readonly textarea fit it's content (no scrollbar)? i'm using angularjs , want pure angualrjs, don't want use jquery. angular.module("app", []) .directive("autoheight", function () { return { restrict: "eac", link: function (scope, element, attrs) { element[0].style.height = (element[0].scrollheight < 30) ? 30 + "px" : element[0].scrollheight + "px"; } }; }); in html: <textarea auto-height> </textarea>

arrays - JavaScript: How to create new object properties/members and assign values inside a For Loop? -

i trying create function create , assign value object property/member . i'm getting error: uncaught typeerror: cannot read property 'id' of undefined the function suppose create property/member called 'id' , , suppose assign value newly created property/member. var add_ids = function(array,index) { for(var iii = 1; iii <= 3; iii++) { array[index+iii].id = (array[index].id * 4)+iii; } array[index].id *= 4; }; array array pass function. index position in array start on loop p.s. loop not overwriting important. element corresponds " array[index+iii] " empty. array[index+iii].id = (array[index].id * 4)+iii; in that, if array[index+iii] undefined before, array[index+iii].id give error you've mentioned. so before accessing id check whether property exists. if(!array[index+iii]) array[index+iii] = {}; // initializing if not present. array[index+iii].id = (array[inde

jquery - (Solved) Not work jqZoom in colorbox -

i want enable jqzoom ajax colorbox popup, not open. code: /*colorbox*/ $('.colorbox1').colorbox({ overlayclose: true, opacity: 0.5, rel: "colorbox" }); /*jqzoom*/ $('.jqzoom').jqzoom({ zoomtype: 'standard', lens:true, preloadimages: false, alwayson:false, zoomwidth: 250, zoomheight: 250 }); i found answer it. reason why not working: jqzoom render before image load colorbox popup, jqzoom not able count exact dimension (width x height) of image. i got solution below 2 solution solution 1: render/call jqzoom after timeout in colorbox popup settimeout(function(){ $('.jqzoom').jqzoom({ zoomtype: 'standard', lens:true, preloadimages: false, alwayson:false, zoomwidth: 250, zoomheight: 250 }); }, 1000); solution 2: call jqzoom after colorbox render $('.colorbox1').colorbox({ overlayclose: true, opacity: 0.5,

c++ - Is it safe to use spawn directly in an asio stackful coroutine? -

when use spawn start new stackfull coroutine in coroutine, valgrind says lot of using uninitialised value( valgrind output ). then use io_service.post invoke handler,and start new stackfull coroutine in it, every thing seems fine. i have searched , read documents, can't find how create new stackfull coroutine safely in stackfull coroutine. here code: #include <iostream> #include <boost/asio.hpp> #include <boost/asio/spawn.hpp> #include <boost/asio/system_timer.hpp> #include <chrono> using namespace std; int main() { auto use_post = false; boost::asio::io_service io_service; boost::asio::spawn(io_service, [&io_service, &use_post](boost::asio::yield_context yield){ if(use_post){ io_service.post([&io_service]{ boost::asio::spawn(io_service, [&io_service](boost::asio::yield_context yield){ boost::asio::system_timer timer(io_service);

vbscript - call standard function mid() -

how can call mid() complete path? sample: a = class.mid("bv",1,1) try putting mid in square brackets: a = class.[mid]("bv",1,1) this feature called bracket identifier , , allows using identifiers spaces, non-ascii characters, or identifiers names vbscript reserved words. more info: vbscript trivia: bracket identifiers , reserved word incompatibilities identifiers in square brackets

VSTO: How to add back the VSTO addin once removed being debugged from Visual Studio -

i working on vsto word addin in c#. recently, renamed project , directories, add-in failed load. removed add-in word hoping in next build/run added again. but, when run again, doesn't added anymore. how can debugging addin again? deleting bin , object directory project folder of visual studio forced add addin again in word application.

android - Proguard JavascriptInterface <print> -

i have problems proguard export apk. proguard says: proguard.parseexception: expecting class member name before ';' line : print; i need this in class: public class jiface { @javascriptinterface public void print(string data) { when removed progurad interface dont call. progurad: -keepclassmembers class * { @android.webkit.javascriptinterface <methods>; } -keepattributes javascriptinterface -keepattributes *annotation* -keepattributes javascriptinterface -keep public class com.imh.sos.webcpu_mail$jiface -keep public class * implements com.imh.sos.webcpu_mail$jiface -keepclassmembers class com.imh.sos.webcpu_mail$jiface { <methods>; } -keepattributes javascriptinterface -keep public class com.imh.sos.webcpu_mail$print -keep public class * implements com.imh.sos.webcpu_mail$print -keepclassmembers class com.imh.sos.webcpu_mail$print { <methods>; } -keepattributes javascriptinterface -keep public class com.imh.sos.w

python - Converting an array to a float, how to reverse the process? -

suppose start integer numpy array integers between 0 , 99, i.e. x = np.array([[1,2,3,1],[10,5,0,2]],dtype=int) now want represent rows in array single unique value. 1 simple way representing floating number. intuitive way rescale = np.power(10,np.arange(0,2*x.shape[1],2)[::-1],dtype=float) codes = np.dot(x,rescale) where exploit integers have @ 2 digits. (i'm casting rescale float avoid exceeding maximum value of int in case entries of x have more elements; not elegant) this returns array([ 1020301., 10050002.]) how can process reversed obtain x again? i'm thinking of converting codes string, split string every 2nd entry. i'm not familiar these string operations, when have executed on entries of array simultaneously. problem first number has varying number of digits, trailing zeros have added in way. maybe simpler possible using divisions or rounding, or perhaps represting rows of array in different manner. important @ least initial conversion fa

asp.net label over asp.net image -

i want palce asp.net label on asp.net image <asp:image id="image1" runat="server" imageurl="~/option.png" /> <asp:label id="label1" runat="server" text="labelsssssss"></asp:label> here come 1 after only. have use both asp controls no html controls allowed.how? if possible, remove image, put label in div, set background-image of div image.

php - Wordpress metabox drop down list isn't saving -

i have 2 custom post types named clients , casestudies . i'm trying build meta box on clients post type have drop down list featuring titles of posts casestudies post type. end page displaying featured image clients post type, hyperlink off relevant casestudies post if selection made drop down list. i have followed tutorial meta box put together: http://code.tutsplus.com/tutorials/how-to-create-custom-wordpress-writemeta-boxes--wp-20336 this meta box code have in functions.php file: add_action( 'add_meta_boxes', 'cd_meta_box_add' ); function cd_meta_box_add() { add_meta_box( 'my-meta-box-id', 'my first meta box', 'cd_meta_box_cb', 'clients', 'side', 'default' ); } function cd_meta_box_cb( $post ) { $values = get_post_custom( $post->id ); $selected = isset( $values['my_meta_box_select'] ) ? esc_attr( $values['my_meta_box_select'][0] ) : ”; ?> <p> <l

javascript - What does this sample map function in sample CouchDB Set mean? -

Image
couchbase comes big db of beers. 2ms fetch time impressive don't understand following map function does: function(doc, meta) { switch(doc.type) { case "brewery": emit([meta.id]); break; case "beer": if (doc.brewery_id) { emit([doc.brewery_id, meta.id]); } break; } } i can't wrap brain around it. meta thing coming from? i can't wrap brain around it. meta thing coming from? metadata supplemented couchbase server every stored document (json or binary). in view editor can see meta data in right pane of "preview random doc". example in screenshot question, meta.id " labbat_ontario_breweries_labbat_50 " seen on right side. meta.id actual key of document , present returned doc including views (even if not including key value explicitly view output) e.g. example view outputs doc.name, metadata still present returned row in view. can access meta.id element in json result. functi

verilog - How to use structural unit? -

i write verilog code using simple adder(inbiult in xilinx itself) want replace using rns adder code made , gives module rns(clk,rst,a,b,c) a,b input of rns adder , c output. and code using simple adder given below.in code using enable ,for have use block....but in structural modelling(when call rns adder) how deal enable? module output_adder_8(enable,s089,s318,s175,s250,s289,s118,s075,s350,s189,s218,s375,s050,s389,s018,s275,s150,r1,r3,r5,r7); input enable; input [13:0] s089,s175,s250,s318,s289,s118,s075,s350,s189,s218,s375,s050,s389,s018,s275,s150; output reg[15:0] r1,r3,r5,r7; reg [11:0] c,d,e,f,g,h,i,j; //reg [3:0] countp=4'b0000; always@* begin if (enable) c<= s089+s318; d<= s175+s250; r1<= c+d; e<= s289+s118; f<= s075-s350; r3<=f-e; g<= s218-s189; h<= s375+s050; r5<=g+h; i<= s018-s389; j<= s275-s150; r7<=i+j; end endmodule module shift_adder_8a( clk, z0, s018, s050, s075, s089,enable0 ); input clk; input [12:

asp.net - pfx file not found for Xero api -

i'm developing app accesses xero api , have works fine on development machine. when upload web server (arvixe) file not found error when trying load pfx file required authentication. i have verified file path correct , enabled permissions on file. could error masking else? ** update ** there no problem accessing file. changed code load pfx file byte array first works fine, use byte array parameter x509certificate2 constructor instead of filename. this error occurs, looks has problem creating temporary file or accessing certificate store. i think might problem on shared hosting. know workaround? ok, randomly started working today. had tried code before, after many other things, it's possible needed recycle application pool: x509certificate2 cert = new x509certificate2(); cert.import(hostingenvironment.mappath("~/public_privatekey.pfx"), "password", x509keystorageflags.machinekeyset); the key part storage flag of machineke

java - How exactly Spring use JDK proxy? -

Image
i have doubts related 2 kinds of proxies can use spring. so, have understand jdk proxy type default 1 used spring , based on interface implementation. from have understand (but absolutly not sure assertion, correct me if wrong) using jdk proxy both class of object "wrapped" proxy , proxy have implement interface. what represent interface? interface contains not implemented methods declaration. method are? studying on online documentation found link: http://docs.spring.io/autorepo/docs/spring/3.2.3.release/javadoc-api/org/springframework/context/annotation/enableaspectjautoproxy.html here shown example of jdk proxy use aop behavior have doubts related previous interface use. so, can see in link, there are: the appconfig configuration class @configuration @enableaspectjautoproxy public class appconfig { @bean public fooservice fooservice() { return new fooservice(); } @bean public myaspect myaspect() { re

jquery - Razor Checkbox change visibility of text fields & dropdowns -

simple one! i'm creating huge costing web application, contains huge input form loads of fields want checkbox standard: @html.checkbox("standard", false) to when clicked change visibility of my textfields input id="kid" type="text" value=@viewbag.kammid name="kammid" /> & #2 dropdownlists @html.dropdownlist("selectedfacing", (selectlist)viewbag.facingsheets) ive checked tons of forums nothing seems work, think need use jquery, nothing when put code @ bottom of view. <script type="text/javascript"> $(function () { $("#standard").click(function () { var checked = $(this).attr("checked"); if (checked) { $("kammid").show(); $("kammod").hide(); @viewbag.test = poo; } else { $("kammod").hide(); $("kammid").show(); @viewbag.test = wee; } }); }); </sc

ms access - Convert string to date using sql and vba -

i have query below in access , wanted use in vba... sql = "update sales set sales.order_date = cdate(right([data],2)+" / "+mid([data],5,2)+" / "+left([data],4));" i keep getting error due way building string execute. i have tried put & "/" & to build string error when executing sql... how should build string? thanks!!! you use dateserial if data field of table: sql = "update sales set sales.order_date = dateserial(left([data],4), mid([data],5,2), right([data],2))"

java - Why deadlock is not happening for implicit locks? -

what re-entrant lock , concept in general? says if lock non re-entrant grab lock, block when go grab again, deadlocking own process. public class implicitlock { synchronized public void test1() { system.out.println("enter test1"); test2(); system.out.println("exit test1"); } synchronized public void test2() { system.out.println("inside test2"); } } from main class , executed implicitlock lock1 = new implicitlock(); lock1.test1(); i got below output though expecting deadlock when call goes test2 per implicit lock description didn't enter test1 inside test2 exit test1 java synchronized lock reentrant. jakob jenkov blog: lock reentrance synchronized blocks in java reentrant. means, if java thread enters synchronized block of code, , thereby take lock on monitor object block synchronized on, thread can enter other java code blocks synchronized on same monitor object. here example: public class re