Posts

Showing posts from March, 2011

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.

I am trying to display 2 totals calculated in a php function using a mouseover event with Ajax. How do I do this? -

this school project. have far. totally new , totally lost. appreciate help. ajaxfunctions.js function getxmlhttp() { var xmlhttp try { //firefox, opera 8.0+, safari xmlhttp = new xmlhttprequest(); } catch(e) { //internet explorer try { xmlhttp = new activexobject("msxml2.xmlhttp"); } catch(e) { try { xmlhttp = new activexobject("microsoft.xmlhttp"); } catch(e) { alert("your browser not support ajax!") return false; } } } return xmlhttp; } function makerequest(product) { var xmlhttp = getxmlhttp(); xmlhttp.onreadystatechange = function() { if(xmlhttp.readystate == 4){ if(xmlhttp.status == 200){ handleresponse(xmlhttp.responsetext); } } } xmlhttp.open("get", "prodtotal.php?product=+_product", true); xmlhttp.se

iphone - Drawing a custom button -

i drawing custom button: uibutton *mybutton = [uibutton buttonwithtype:uibuttontypecustom]; mybutton.frame = cgrectmake(10,10,44,70); [mybutton settitlecolor:[uicolor whitecolor] forstate:uicontrolstatenormal]; [mybutton settitle:@"order" forstate:uicontrolstatenormal]; when tapping on button ground color not changing. need use different images normal , selected state? trick here? yes, need use different images different states: [mybutton setbackgroundimage:someuiimageref forstate:uicontrolstatenormal]; [mybutton setbackgroundimage:someotheruiimageref forstate:uicontrolstatehighlighted];

python - using BeautifulSoup to insert an element before closing body -

what efficient way insert element last 1 in body of html page? see answer previous question along same lines: extract <script> tags in html page , append bottom of document the following should insert fine: soup.body.insert(len(soup.body.contents), yourelement)

imagemagick - Paperclip my Image is not recognized by the 'identify' command. (Running Windows) -

im using paperclip size images keep getting error ( 1 error prohibited project being saved: image c:/docume~1/hp_adm~1/locals~1/temp/stream,5584,0.jpg not recognized 'identify' command. ) ive tried pretty found online: adding paperclip.options[:command_path] = "c:\imagemagick-6.6.6-q16" development.rb doing changes project.rb (removing single quotes) i'm running windows latest ruby/rails , paperclip 1.3.3 im getting rails , have no idea do. know common problem of answers have come across havent helped. thanks in advance. i able work on windows xp (my dev environment - deployment heroku worked fine) doing following: installing imagemagick c:\imagemagick editing config/environments/development.rb , adding following paperclip.options[:command_path] = "c:/imagem~1" kill , restart dev server pick new config. i not able work using "long" windows paths. '~1' monstrosity. so, thing might have change pap

android - How can you detect which view you are passing over when performing a touch event? -

i want know how can detect child views if move view 1 viewgroup viewgroup, particularly when doing touch event. there method can call let me know views i'm "hovering" over? what i'm doing right when detect action_move event on view i'm raising top level parent can move , drawn within entire window ( , not inside it's original parent bounds ), want move view across different viewgroup , on action_up attach view viewgroup. inspired ami's response, discovering motionevent#getx()/gety() along view#gettop()/etc return coordinates wrt parent view, ended doing following below operate in screen coordinates, allowing me work across viewgroups: private boolean inregion(float x, float y, view v) { v.getlocationonscreen(mcoordbuffer); return mcoordbuffer[0] + v.getwidth() > x && // right edge mcoordbuffer[1] + v.getheight() > y && // bottom edge mcoordbuff

Need a php script to upload bitmapdata into a mysql table (BLOB) from Flash AS3 -

i need in php script. have spent half day searching high , low couldnt work. basically, want sample php script, can let me call flash, save bitmap data record mysql table! thanks... as far flash concerned, need turn bitmapdata object bytearray look zend amf or amfphp communication php, both allow pass bytearray variable . zend amf lee brimelow | zendamf video tutorial as php script, bytearray variable in php, it's straightforward mysql connection , need save data blob. store images in mysql tutorial

java - Proper way of coding -

i new in developing android applications. want create android application(using eclipse) needs login page user needs put his/her username , password , when username , password correct application open main page. made layout login page. question is, proper put function codes of login , main page in same package? ideally define login activity handles login action, save in preferences etc , have start main activity when user logged in.

python - How to program to have all processors on your machine used? -

i running single-threaded python program performs massive data processing on windows box. machine has 8 processors. when monitor cpu usage in performance tab under windows task manager, shows using small fraction of processing power available me. 1 processor being used fullest , rest idle. should ensure processors used? multithreading solution? multithreading cannot make use of processors or cores. you should spawn new processes instead of new threads. this tool far simplest among have come across: parallel python overview: pp python module provides mechanism parallel execution of python code on smp (systems multiple processors or cores) , clusters (computers connected via network). it light, easy install , integrate other python software. pp open source , cross-platform module written in pure python

string - Getting a substring of an attribute in XPATH -

given <foo> <bar baz="hello, world!"> </foo> how last 4 characters of @baz? 1 of attempts was: /foo/bar/@baz[substring( ., 0, -4 )] use : substring(/foo/bar/@baz, string-length(/foo/bar/@baz)-3) do note 3 in expression. the following wrong : substring(/foo/bar/@baz, string-length(/foo/bar/@baz)-4) because returns last 5 characters of string value of baz attribute.

mfc - How enable resizing for a child of CMDIChildWnd? -

i have change old mfc-application, uses dialogs derived cmdichildwnd. style of dialog set ws_child | ws_clipchildren | ws_clipsiblings | ws_visible | ws_sysmenu | ws_thickframe | ws_minimizebox. resizing support implemented via on_wm_size() , onsize(). as expected window not have maximize button in title bar. when window minimized onsize() called after request dialog restore original size. nonetheless i'm not able resize dialog. if add ws_maximizebox dialog's style, of course maximize button in toolbar, disabled. after using title bar's popup menu resize dialog once, works fine - can change size of dialog. what have change enable resizing these dialogs (without using popup menu of course ;-)? add ws_sizebox (or possibly ws_thickframe) .rc file. resizing enabled!

networking - c# launch .exe from a remote folder -

Image
i made .exe program in c# , locally works fine... if put .exe remote path, when launch, gives error.. use framework 2.0 how can solve this? thanks edit: error: and if launch program locally, works fine ( copied folder directories...) that "code access security"; random network share has very little trust core engine default. 2.0, options are: use clickonce instead (execute .application , not .exe ) use caspol.exe (on every client) tell trust share don't deploy way (i.e. use installer) with of later service packs (it might sp 2, can't remember), mapped shares more trust, i.e. \\server\share won't have enough trust default, h: (which mapped \\server\share ) will run. my preference clickonce deployment since works on versions.

string - what is c++(stream) equivalent of vsprintf? -

consider code sample /* vsprintf example */ #include <stdio.h> #include <stdarg.h> void printferror (char * format, ...) { char buffer[256]; va_list args; va_start (args, format); vsprintf (buffer,format, args); perror (buffer); va_end (args); } int main () { file * pfile; char szfilename[]="myfile.txt"; int firstchar = (int) '#'; pfile = fopen (szfilename,"r"); if (pfile == null) printferror ("error opening '%s'",szfilename); else { // file open fclose (pfile); } return 0; } i want avoid using new , char* in function printferror, thinking of ostringstream not take arguments in same form vsprintf. there vsprintf equivalent in c++?? thanks short answer there isn't, boost::format provides missing functionality. typically streams take different approach, if not sure, have basic tutorial on c++ io streams.

xcode - Refreshing a ViewController with UITabBar application -

i'm using common tabbar application got 1 viewcontroller calculus , 1 make drawings these results. it works quite first time viewdidload method. doesn't refresh other time when change values in first tab , switch tabs. the viewwillappear method doesn't seem called when come again in graph viewcontroller. the drawing values shared sigleton , can refresh lame push button now. know how trigger refresh automatically ? thank in advance. viewwillappear gets called ...before receiver’s view displayed onscreen , before animations configured showing view. -apple documentation so assuming using text fields receive data user, yes? if so, need refresh user "enters" text text field, either pressing return button on ios keyboard or other means(which ever way have set up). if can provide more information glad further assist you.

debugging - How can I write to console in PHP? -

is possible write string or log console? what mean just in jsp, if print system.out.println("some") there @ console not @ page. firefox on firefox can use extension called firephp enables logging , dumping of information php applications console. addon awesome web development extension firebug . http://www.studytrails.com/blog/using-firephp-in-firefox-to-debug-php/ chrome however if using chrome there php debugging tool called webug or chrome logger . more clockwork in active development extends developer tools adding new panel provide useful debugging , profiling information. provides out of box support laravel 4 , slim 2 , support can added via extensible api. using xdebug a better way debug php via xdebug . browsers provide helper extensions pass required cookie/query string initialize debugging process. chrome - xdebug helper firefox - the easiest xdebug opera - xdebug safari - xdebug toggler

c# - Web Service Singleton object problem -

i creating singleton object in first request web service , keeping in memory. this works fine first few seconds. if make request 5 minutes later, can see singleton object created again? singleton object getting disposed after x no of minutes ? how can make increase life-time of object forever ? public sealed class singleton { static serverinstance instance = null; static readonly object padlock = new object(); singleton() { } public static serverinstance instance { { lock (padlock) { if (instance == null) { instance = new serverinstance(); } return instance; } } } ~singleton() { #if debug exceptionfactory.fatal("~singleton() called!"); #endif } } [webmethod] public string onreceiveevent(string obj

java - How to build a jar using an own MANIFEST.MF in Eclipse -

Image
i have custom manifest.mf in java-project in eclipse. when exporting project jar, choose use existing manifest workspace extracting .jar shows eclipse generated own manifest. my manifest: manifest-version: 1.0 main-class: de.somehow.tagpdf.main class-path: lib/itext-5.0.2.jar;lib/jxl.jar;lib/jai_codec.jar;lib/jai_core.jar how can fix this? you can make use of build.xml build jar file you. then run build.xml ant task. see if want build.xml run automatically every time build eclipse project, can add builders list. see below sample build.xml custom manifest used: <?xml version="1.0" encoding="utf-8"?> <project basedir="." name="example" default="run_build"> <property name="guijar" value="../../library/<jar-name>.jar"></property> <target name="run_build" depends="delete_old_jar,create_dirs,create_manifest,copy_all_class_f

c++ - List the drawback (performance/maintenance etc.,) in having all setter functions as SLOTS in Qt? -

is there drawback (performance/maintenance etc.,) in having setter functions slots in qt? some of disadvantages see are, 1) unnecessary call of moc , unnecessary moc files created during compile time 2) break in exception handling chain, since exceptions not passed in signal-slot connection 3) unnecessary complexity in debugging, since harder debug signal-slot thatn direct method call. can list other disadvantages (if any)? if call setters directly, can avoid of drawbacks mention. behave other normal call. drawback in case longer compiler time , bigger bin size. if call setters emitting signals, then: 1) more complex code; since have remember connect signals slots every set. 2) small performance hit. negligible gui app; there. 3) less deterministic code. i.e. depending on way signals connected, call might passed directly callee, or sent through event system. further complicates debugging, besides you've mentioned already. 4) ide issues. if not us

.net - How to get "name" of a server control just like "ClientID" in javascript? -

i want apply validation through jquery in forms , require "name" attribute of textboxes on form generated asp.net automatically. there way can name of elements in javascript like: <script> '<%= txt.clientid %>' </script> i using following type of jquery validation: $(".selector").validate({ rules: { // simple rule, converted {required:true} name: "required", // compound rule email: { required: true, email: true } } }) you might this... <script> var textbox = '<%= txt.uniqueid %>'; </script> or even... <script> $('#<%= txt.uniqueid %>').doyourthing(); </script>

jsf - Best way to check for record existence in editor form -

i'd implement record detail page, user can call using url like: http://somewhere.foo/detail.jsf?recordid=1 now if record specified identfier can found, actual editor page should displayed, if cannot found error page should displayed instead. what's best way achieve behaviour using jsf 2.0 , facelets? i thought of (in pseudocode): detail.xhtml <if #{!recordbean.recordfound}> <ui:include detailnotfound.xhtml> <else> ... show regular edit form here ... <endif> are better or "more accepted" ways of doing this? use rendered attribtue this. assuming #{recordbean.list} returns list , here's example: <h:panelgroup rendered="#{empty recordbean.list}"> <ui:include src="detailnotfound.xhtml" /> </h:panelgroup> <h:panelgroup rendered="#{not empty recordbean.list}"> ... </h:panelgroup> or, if both include pages, use conditional operator ?

c# - ASP.Net Button not raising postback -

i've simple page in 1 of our web applications, has following markup: <%@ page language="c#" autoeventwireup="true" codebehind="newupload.aspx.cs" inherits="mass_upload.newupload" masterpagefile="~/master" title="document mass upload" %> <asp:content id="content1" contentplaceholderid="head" runat="server"> <link rel="stylesheet" type="text/css" href="./../css/scrollingtable.css" /> <script type="text/javascript" src="../help/helppopup.js" /> </asp:content> <asp:content id="content2" contentplaceholderid="centerh1" runat="server"> document mass upload <a href="javascript:loadhelpvid(5)"><img style="border:none;" src="../help/help_icon.gif" /></a> </asp:content> <asp:content id="content3" conte

c# - Is there anything like webrick for ASP.NET? -

this might seem bizarre question, go me second. when install rails, have opportunity test development on webrick, simple web server (or can use mongrel if have gem installed). i know when developing asp.net can use built-in server comes visual studio, wondered if there have if didn't have copy of visual studio or didn't know how configure iis still wanted run asp.net web application, on home pc or laptop. as said, bizarre question, thought i'd ask. you use iis express lightweight free version of iis.

How to kill all running threads in Silverlight? -

how kill running threads in silverlight? you can't, abort method of thread object marked security critical , can't called in silverlight code. if want kill running of own code use backgroundworker class run code , place reasonable checks in code cancellationpending being set. other code can call cancelasync terminate it.

java - Map ArrayList with Hibernate -

i coded first hibernate examples. the database connection works , understand how can map string pojo database field: private string firstname; and in mapping file: <property name="firstname" type="java.lang.string"> <column name="firstname" /> </property> but how can map arraylist database? simpl example mapping xml file appreciated. cheers update i switched list instead of arraylist found example. map follows: <list name="test" inverse="false" table="contact" lazy="true"> <key> <column name="id" /> </key> <list-index></list-index> <element type="java.lang.string"> <column name="test" /> </element> </list> unfortunately, exception not understand: exception in thread "main" org.hibernate.mappingexcepti

php - Disable the enter key on a jquery-powered form -

i have form using form jquery plug in handel posting of data. in example working data psoted php file reades database , echos result displayed below from. the code works 1 glitch. if hit enter button while text filed selected cleared including result has been written screen. possible disable enter key , prevent doing this? form: <html> <head> </head> <p>enter code here <form name="form" action="" method=""> <label for="name" id="name_label">name</label> <input type="text" name="name" id="name"/> <input type="button" value="get" onclick="get();"/> </form> <div id="age"></div> </p> </body> </html> script: function get() { $.post('data.php', {name: form.name.value}, function(output) { $('#age').hide().html(output).fadein(

Different results for command line and CGI for perl web form script -

the code sub: sub put_file { my($host, $placement_directory, $tar_directory, $filename, $user, $pass) = @_; $ftp = net::ftp->new($host) or die "cannot connect localhost"; $ftp->login($user, $pass) or die "cannot log in"; $ftp->cwd($placement_directory); print $tar_directory."/".$filename; $ftp->put("$tar_directory/$filename") or die "cannot put file ", $ftp->message; print "file has been placed \n"; } so when sub called test script(that runs command line) uses same config file , of same things cgi script, no errors found , file placed correctly. when sub called cgi script script output $tar_directory."/".$filename not "file has been placed \n" , ftp->message outputs "cannot put file directory changed." seems come cwd line before it. other info: have tried running test script multiple users same result. use strict , warnings. tar file be

java - Struts 2 decorator question -

i'm building website struts 2. got decorator layout of website , fill content according action. want use column tools login, latest messages, etc. i'm pretty new struts , don't have idea design like. best guess sort of second action. don't have clue how add 2 actions decorator. design approach 1 , if how should implemented? struts 2 uses 1 action per page. nested actions possible. other option use ordinarily includes.

php - Jquery Ajax using json is getting a undefined value -

$.ajax({ type: "post", url: "check.php", data: "checkit=" + $("#checkemail").val(), success: function(response){ $("#usercheck").html(response.status); if(response.status == true){ alert("yay"); }else{ alert("dsfds"); } } }, 'json'); someone here suggested doing ajax returns using json... here php file returning json.. $data = {success:true}; echo json_encode($data); im getting undefined return. perhaps here point me mistake? you missing datatype: 'json' and php wrong: $data=array('status'=>true); update here few suggestions try: 1) 'datatype' (case-sensitive believe) 2) try using 'contenttype' option so: contenttype: "application/json; charset=utf-8" i'm not sure how it's used in request post url, not in response. see arti

bash recursive xtrace -

is there way run bash script x if x call executable bash script y y starts 'sh -eux'? x.sh: ./y.sh y.sh: #!/bin/sh echo ok it possible make subshell run using same shell options set in parent exporting shellopts environment variable. in case x.sh , y.sh cannot edited, i'd create wrapper script exports shellopts before calling x.sh . example: #!/bin/sh # example x.sh calls y.sh ./y.sh . #!/bin/sh # example y.sh needs called using sh -eux echo $shellopts . #!/bin/sh -eux # wrapper.sh sets options sub shells export shellopts ./x.sh calling x.sh directly shows -eux options not set in y.sh [lsc@aphek]$ ./x.sh braceexpand:hashall:interactive-comments:posix calling via wrapper.sh shows options have propagated subshells. [lsc@aphek]$ ./wrapper.sh + export shellopts + ./x.sh + ./y.sh + echo braceexpand:errexit:hashall:interactive-comments:nounset:posix:xtrace braceexpand:errexit:hashall:interactive-comments:nounset:posix:xtrace t

java - Broken Package links for ksoap2 .jars? -

i'm trying build little application on android using webspace problem ist if want download ksoap2 package (e.g. ksoap2 dependencies 2.5.2 here ) filesize 21.6kb after downloading. table says 141kb. this resulting printing out errors when try import external library (not compatible dalvik) un derstandable because archive corrupt/broke. can give me link can download proper .jar-archive? (2nd question: how use javadocs? have set them path if click on external libraries dialog->ksoap2...->javadoc ?) thanks in advance i've uploaded latest ksoap2 version. can downloaded 10 times. http://rapidshare.com/files/434471358/ksoap2-android-assembly-2.5.2-jar-with-dependencies.jar but see, you've alredy fixed it. ;)

Using Dozer framework for object mapping in java -

i using dozer framework object mapping in java. now got stuck because of following problem: following classes: public class basequestion { public string question = ""; public string answer = ""; /** * getter question */ public string getquestion() { return question; } /** * @setter question */ public void setquestion(string question) { this.question = question; } /** * getter answer */ public string getanswer() { return answer; } /** * @setter answer */ public void setanswer(string answer) { this.answer = answer; } } public class questionsmap { question[] question; public void setquestion(question[] question) { this.question = question;

java - JPA 2.0: TYPE expression exception -

i have inheritance structure classes, let's parent (as root class) , child subclass. so jpa 2.0 no can select parent class using select p parent p type(p) = parent this should return entries of parent , not entries of child. but eclipselink 2.1.1 , mysql on glassfish v3, following error: "invalid type expression on [my.domain.parent]. class not have descriptor, or descriptor not use inheritance or uses classexctractor inheritance". additionally, define no orm-mapping hand. done automatically on deployment, think. is there have add parent /child class (an annotation i.e.) declare inheritance structure? (but think shouldn't necessary, because inheritance declared java, it?) edit: 1 important aspect i've didn't mentioned i'm using inheritance method "table_per_class". forget said before. work single_table strategy: @entity @table(name="person") @inheritance(strategy=inheritancetype.single_table) @disc

c# - MVC .NET forms with a domain-driven design -

the pattern see in majority of .net mvc examples have model object passed between controller , lower layers , form-bind directly those. opted domain-driven approach have domain objects passed between layers. idea these objects passed views. the problem i'm running when comes pages forms. intending have separate objects forms bind on way (which contain validation annotations). keeping separate domain object because single object possibly updated different pages, each page having it's own validation requirements (for example person's address might not shown on 1 page, required on another, validation wouldn't work on universal domain object). complicates things once postback form , need display errors. take example update page. i'd type view domain person object , page have it's field values populated that. postback action take form object page , validate that. if passed use automapper copy values domain object off form , save. works. breaks down re-displ

iphone - iOS Animation within DrawRect() -

i'm trying animate cgcontext drawings within drawrect method of view. code snippet //initial attempt [uiview animatewithduration:10 animations:^{ cgrect marker = cgrectmake(leftlinex-5.0, ycoord-5.0, 10.0, 10.0); cgcontextsetstrokecolorwithcolor(c, _barcolor.cgcolor); cgcontextsetfillcolorwithcolor(c, _labelcolor.cgcolor); cgcontextfillellipseinrect(c, marker); cgcontextstrokeellipseinrect(c, marker); }]; //next approach cgrect marker = cgrectmake(255.0, 255.0, 10.0, 10.0); uiview * markerview = [[uiview alloc] initwithframe:marker]; [self addsubview:markerview]; cgcontextaddellipseinrect(c, marker); cgcontextsetstrokecolorwithcolor(c, [uicolor redcolor].cgcolor); cgcontextsetfillcolorwithcolor(c, [uicolor bluecolor].cgcolor); cgcontextfillellipseinrect(c, marker); cgcontextstrokeellipseinrect(c, marker); [uiview animatewithduration:3 animations:^{ markerview.alpha = 0.0; [markerview setneedsdisplay]; }]

asp.net - How to use findcontrol in createuserwizard1 complete step ...? -

is right declaration of findcontrol complete step of createuserwizard1 ? dim username textbox = createuserwizard1.createuserstep.contenttemplatecontainer.findcontrol("label11") but when use shows error object expected ! what problem ? you can't set value of textbox generic control (especially 1 label). plus forgot new keyword when initializing username. depending on you're trying do, may want try following... 'this set textbox's text label's text. dim username new textbox username.text = ctype(createuserwizard1.createuserstep.contenttemplatecontainer.findcontrol("label11"), label).text or 'this cast label new label control define in code. dim username new label username = ctype(createuserwizard2.createuserstep.contenttemplatecontainer.findcontrol("label11"), label)

“Could not create the file”, “Access is denied” and “Unrecoverable build error” in building setup project in VS 2008 -

when building setup project message: error setup build: error 27 not create file 'c:\users\myname\appdata\local\temp\vsi1e1a.tmp' 'access denied.' i have tried following (from http://support.microsoft.com/kb/329214/en-us ) regsvr32 "c:\program files (x86)\common files\microsoft shared\msi tools\mergemod.dll" the dll registers not fix problem. also, tried clean build, deleting temp folder, ran vs2008 administratror, restart pc occurs every time. have no anti-virus software running , running on windows 7 64-bit. operation worked fine until recently. have read many other users see found no solution. the half solution found edit setup properties , switch package files loose uncompressed files . works not ideal need full installer. its protective feature of anti virus u might using. had same problem while using kaspersky. paused "real time protection" temporarily, , build, rebuild, worked perfectly. resumed av services sanit

model view controller - Deploying asp.net Mvc Web application -

when running application vs every thing goes ok deployed application , run iis7 on machine run windows 7 website run ok icons , images in content folder dosn't appear in webpages when try navigate image told me files not found it's small things overlook when programming (and deploying) make sure virtual directory pointed correct place make sure content published make sure permissions on virtual directory correct more information determine going on though.

Which Delphi version supports RTTI for public methods? -

by default, rtti in versions below 2010 created published class members. i have read in 2006 blog (http://hallvards.blogspot.com/2006/09/extended-class-rtti.html) using $methodinfo (or $m), public , published methods included since delphi 6. correct? the blog entry said: "for websnap, “new” $methodinfo on compiler directive (which undocumented in d6 , d7) used generate extended rtti public , published methods." ... "updated (27. oct 2007): $methodinfo first available in delphi 7, not delphi 6." the new rtti in delphi 2010 , supports want. you're out of luck in delphi 2009 , below.

iphone - App store homepage image -

i uploaded app country's app store, , reached first place in top free in 2 days! well, not bragging, since nobody here cares anyway :p but! think app deserves have picture on home page (the large image previews applications in 600x300 pixel rectangle [the size approximate :p] ) where can include design in next update, apple see , consider posting it? what size? (is question clear? :p) if have app well, apple contact , ask prepare special images app store homepage. blog post lists out specs of august 31st, 2009. it looks you'll need prepare 2 images: 600x600 title treatment, , 900x530 layered psd background treatment. (this file see rotating around on app store background.) from post: title treatment this 600 x 600 image of logo/title. background should transparent , should exclude tag-lines if text not legible @ small scale. background treatment this 900 x 530 layered psd. put in file open. apple states: “the

java - Code signing, do I need to generate a keystore? -

i trying sign app using keytool, dont have keystore file. do need generate file myself or should receive from code signing authority ? if files require generate keystore file ? thanks the key store database keys. process of "signing" app (e.g. jarsigner) following: you create private/public key pair keytool. you create csr (certificate signing request) a ca (certification authority) processes request , gives certificate. you have import ca response keystore. you may create self signed certificate feeling of process. may use openssl. cheerz!

xml - Meaning and definition of xmlns="" -

in wpf , silverlight when using xaml has declared @ begginning of xaml file xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions" xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" but,where can find every entry means?, far know similar using in c# or imports in vb, definition of class or "namespace"? thanks lot!!! xmlns=... namespace declaration . see xml namespaces: http://en.wikipedia.org/wiki/xml_namespace

php - "At sign" @ in SimpleXML object? -

this output of print_r() run on typical simplexmlelement object: simplexmlelement object ( [@attributes] => array ( ) ) what @ sign mean? this simplexmlelement object. '@attributes' row internal representation of attributes xml element. use simplexml's functions data object rather interacting directly.

user - Setting REMOTE_USER in JSP -

we're attempting front web software we've purchased vendor our organization's single-signon authentication. software expects cgi environment variable remote_user set in jsp user id before forward control welcome page. (their technical manual describes in way: "...the http response object should populate remote user attribute username of authenticated user.") getting value easy haven't found straightforward method in google searches of setting it. we're confident it's possible. suggestions. you can't set cgi variable remote_user programmatically. webserver-controlled variable based on user name extracted authorization http request header. original header set client (webbrowser) after client has entered credentials http basic authentication. i don't understand manual means setting attribute in http response. doesn't make sense. setting custom attribute on request make bit more sense if it's java servlet based api. reque

php - dompdf and img tag, image wont show -

here html before $dompdf->render() , $dompdf->output() called: <img src="http://www.example.com/images/logo.png" /> all other invoices display image fine when viewing in browser, or printing it, or emailing html. when click 'generate pdf' inside of our application, renders invoice in pdf, except logo missing. have put debugging line in email me raw html sends render(), , looks fine me. does have idea why dompdf won't display image? an idea: if providing full uri image treated external, defined costant dompdf_enable_remote must set true.

sql server - SSIS result set fed in parallel to stored procedure -

i have 2 stored procedures ... stored proc #1 returns list of products based on range of criteria stored proc #2 accepts single productid , performs complex query logic , writes results table my problem there on 30,000 products , going through result set stored proc #1 1 @ time slow , can't integrate entire batch call stored procedure #2 my question follows: using ssis there way setup task take result set stored procedure #1 , call stored procedure #2 in parallel each row. example of stored proc 1 result set ----------------------------------- product id ---------- abc123 xyz987 aaabbb cccddd eeefff need setup ssis call following in parallel: ------------------------------------------------------- exec storedproc2 'abc123' exec storedproc2 'xyz987' exec storedproc2 'aaabbb' exec storedproc2 'cccddd' exec storedproc2 'eeefff' ouch, that's many executions of sp #2. can though. create data flow task. add ole db s

python - How to use map function on nested lists and converting strings to integers? -

i need use map function in python(2.4.4) add 1 each item in list, tried converting strings integers. line=[['10', '13\n'], ['3', '4\n'], ['5', '3\n'], ['1', '13']] map(lambda x:(x+1),int(line)) is not working because of \n , nests? well intent not clear not due \n. see : >>> line=[['10', '13\n'], ['3', '4\n'], ['5', '3\n'], ['1', '13']] >>> map(lambda x:([int(x[0])+1, int(x[1]) +1]),line) [[11, 14], [4, 5], [6, 4], [2, 14]]

c# - HttpWebRequest with caching enabled throws exceptions -

i'm working on small c#/wpf application interfaces web service implemented in ruby on rails, using handcrafted httpwebrequest calls , json serialization. without caching, works it's supposed to, , i've got http authentication , compression working well. once enable caching, setting request.cachepolicy = new httprequestcachepolicy(httprequestcachelevel.cacheifavailable); , things go awry - in production environment. when connecting simple webrick instance, things work fine, http/1.1 304 not modified expected , httpwebrequest delivers cached content. when try same against production server, running nginx/0.8.53 + phusion passenger 3.0.0 , application breaks. first request (uncached) served properly, on second request results in 304 response, webexception stating " the request aborted: request canceled. " invoke request.getresponse() . i've run connections through fiddler , hasn't helped whole lot; both webrick , nginx return empty entity body,

oracle - what datasource to use intead of jboss one's? -

we removing jboss spring-based application , considering datasource use instead of jboss's 1 oracle. used such properties (in oracle-ds.xml) as min-pool-size max-pool-size blocking-timeout-millis prepared-statement-cache-size etc... didn't find analog params in basicdatasource, apache connection pool. have @ c3p0 . should fit needs. here configuration details .

android - Create a custom View by inflating a layout? -

i trying create custom view replace layout use @ multiple places, struggling so. basically, want replace this: <relativelayout android:id="@+id/dolphinline" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_centerinparent="true" android:background="@drawable/background_box_light_blue" android:padding="10dip" android:layout_margin="10dip"> <textview android:id="@+id/dolphintitle" android:layout_width="200dip" android:layout_height="100dip" android:layout_alignparentleft="true" android:layout_marginleft="10dip" android:text="@string/my_title" android:textsize="30dip" android:textstyle="bold" android:textcolor="#2e4c71" android:gravity="center"/> <button android:id="@+id/dolphinminusbutton" android:layou

Using php, prompt user to re-authorize at session timeout? -

i'm working using session authorize users. works fine long move between pages, , we've got timeout set 2 hours, won't issue. however, users work with, can imagine them getting preoccupied after doing work on single page, letting sit 2 hours. if session times out, lose work, , i've had testers unhappy me because session timed out (only 24 minutes then, though). is there way run script when session times out, can @ least ask user login again? know can via javascript -- if modify every single 1 of more 100 .php scripts used website. have single auth script, , if run there, nice. thanks, sean. prompting user using php or other server-side scripting language not possible without refresh. you're asking server serve browser didn't request, why not possible. know can use javascript job done. edit: the following not set in stone or true in cases might apply situation. run script when session times out have : test session time out. to te

javascript - Detect Plugin or Command Existence in TinyMCE -

does tinymce's api support method finding whether or not plugin active, or better, whether given command registered? specifically, creating plugin call mceautoresize command @ periods, in order prefer detect whether command exists or not. know can searching plugins parameter, wanted know if there api-supported way (to limit chances plugin break on tinymce update). to see if plugin or command active there seems no real api functionality. can see if plugin loaded use var plugin_is_usable = tinymce.get(editor_id).plugins.pluginname; to check if given command (in case mceautoresize) available may use var mceautoresize_is_usable = tinymce.get(editor_id).execcommands.mceautoresize; it not ever change in tinymce.

c# - Azure WorkerRole Stopping Immediately After Starting -

i have azure workerrole stopping (no exceptions being thrown) no apparent reason. stops in same spot every time, code executing process takes 20 seconds run. can postulate why happening? there timeout on onstart() method i'm not aware of? here's breakdown of happening in worker role: onstart() -> diagnostics configured run() -> a timer set (60) trigger meat of application a new thread started load default settings (takes ~30 seconds) the code never gets meat of #1. for #1 above, i've tried , without timer (no difference). #2 above, i've tried , without starting new thread (no difference). here's debug output worker role: waworkerhost.exe information: 0 : deployment(108).apiazure.workers.0 - workers.onstart() microsoft.windowsazure.serviceruntime information: 202 : role entrypoint . completed onstart() thread 'role initialization thread' (0x29fc) has exited code 0 (0x0). microsoft.windowsazure.serviceruntime information: 203 : rol

hibernate - JPA 2.0 orphanRemoval=true VS on delete Cascade -

i little confused jpa 2.0 orphanremoval attribute. i think can see needed when use jpa provider's db generation tools create underlying database ddl have on delete cascade on particular relation. however, if db exists , has on delete cascade on relation, not enough cascade deletion appropriately? orphanremoval in addition? cheers orphanremoval has nothing on delete cascade . orphanremoval entirely orm-specific thing . marks "child" entity removed when it's no longer referenced "parent" entity, e.g. when remove child entity corresponding collection of parent entity. on delete cascade database-specific thing , deletes "child" row in database when "parent" row deleted.

How do you layout a form that scrolls in Android SDK? -

i need have user form larger screen. layout consists of fixed "title area", form (in scrollview possibly) , button on bottom. have created 3 layouts , middle layout scrollview vertically-oriented linearlayout. unfortunately, form pushes buttons off screen?! is there simple example this? i suppose can use listview, think scrollview easier manage. here layout ... <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > <!-- title area on top --> <linearlayout android:id="@+id/layout_form" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content" > <linearlayout android:orientation=&q