Posts

Showing posts from June, 2015

Identifying content displayed inside QTP -

i trying identify content displayed inside frame using qtp. asking page frames match description , collection of frames. take first frame collection reason seems object doesn't exist, , therefore can't reach content displayed inside. idea how can extract content inside frame, , why doesn't qtp recognize an existing object? (remark: intentionally didn't use repository identify frame cause frame has unique location in page dynamic indexes identify location) thanks, nathan code description: set targetpage= browser(...).page(...) set objdesc = description.create() objdesc("micclass").value = "frame" objdesc("html id").value = "id" objdesc("html tag").value = "iframe" objdesc("name").value = "id" set framescollection = targetpage.childobjects(objdesc) print framescollection .count-> prints number >0 set firstframe=framescollection(0) firstframe.exist-> returns false

iphone - OpenGL 3D Collision Detection -

i done quick search collision detection opengl things come 2d examples using cgrectintersectsrect. use cgrectintersectsrect 3d detection to? making basic 3d maze game , want stop people walking through walls squares (made triangles) opposed imported objects (yep, new this). thanks, simon you struggle. consider using unity3d , allow access nvidia physx , type of 3d physics solution want. conversely, start scratch this! http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.4.5881&rep=rep1&type=pdf conversely, become expert in something this http://www.ode.org/ can conceivably use opengl, http://www.ogre3d.org/about/features , etc. here important clarification regarding comments on "images": images utterly unrelated collision detection. opengl has utterly no relationship, whatsoever in way collision detection or physics of kind. images have absolutely no connection, whatsoever, collision detection. there no connection, zero, between openg

MySQL: SELECT an extra column categorizing another column based on IF statements -

suppose command: select sessionid, sessionlength mytable; generates table: +-----------+---------------+ | sessionid | sessionlength | +-----------+---------------+ | 1 | 00:20:31 | | 2 | 00:19:54 | | 3 | 00:04:01 | ... | 7979 | 00:00:15 | | 7980 | 00:00:00 | | 7981 | 00:00:00 | +-----------+---------------+ 7981 rows in set (0.92 sec) but want generate table this: +-----------+---------------+--------+ | sessionid | sessionlength | size | +-----------+---------------+--------+ | 1 | 00:20:31 | big | | 2 | 00:19:54 | big | | 3 | 00:04:01 | medium | ... | 7979 | 00:00:15 | small | | 7980 | 00:00:00 | small | | 7981 | 00:00:00 | small | +-----------+---------------+--------+ 7981 rows in set (0.92 sec) something big when it's sessionlength > 10 something medium when it's sessionlength <= 10 , sessi

Help with intent starting on Android -

i trying learn few things http://code.google.com/p/iosched/source/checkout . wanted see how implemented ui patterns talking on i/o. in homeactivity use code fire notesactivity : /* launch list of notes user has taken*/ public void onnotesclick(view v) { startactivity(new intent(intent.action_view, notes.content_uri)); } notes class in schedulecontract class , looks : public static class notes implements notescolumns, basecolumns { public static final uri content_uri = base_content_uri.buildupon().appendpath(path_notes).build(); public static final uri content_export_uri = content_uri.buildupon().appendpath(path_export).build(); /** {@link sessions#session_id} note references. */ public static final string session_id = "session_id"; /** default "order by" clause. */ public static final string default_sort = notescolumns.note_time + " desc"; public static final string content_type =

Javascript regex to find a base URL -

i'm going mad regex in js: var patt1=/^http(s)?:\/\/[a-z0-9-]+(.[a-z0-9-]+)*?(:[0-9]+)?(\/)?$/i; if give input string "http://www.eitb.com/servicios/concursos/516522/" regex it's supossed return null, because there "folder" after base url. works in php, not in javascript, in script: <script type="text/javascript"> var str="http://www.eitb.com/servicios/concursos/516522/"; var patt1=/^http(s)?:\/\/[a-z0-9-]+(.[a-z0-9-]+)*?(:[0-9]+)?(\/)?$/i; document.write(str.match(patt1)); </script> it returns http://www.eitb.com/servicios/concursos/516522/,,/516522,,/ the question is: why not working? how make work? the idea implement regex in function null when url passed not in correct format: http://www.eitb.com/ -> correct http://www.eitb.com/something -> incorrect thanks i'm no javascript pro, accustomed perl regexp, i'll give try; . in middle of regexp might need escaped, can map / , j

asp.net user control scroolIntoView is scrolling entire page -

i there i'm using asp.net user control tree view. when load page want scrool user control selected node in tree view. i'm using js function .scrollintoview(true). scrolling entire page (not inside user control) here's code //js function scrooltofirstselectedcheckbox(ctrlid) { event.observe(window, 'load', function() { var tree = document.getelementbyid(ctrlid + '_mytreeview'); var checkboxes = tree.getelementsbytagname("input"); var checkboxescount = checkboxes.length; (var = 0; < checkboxescount; i++) { if (checkboxes[i].checked) { checkboxes[i].scrollintoview(true); break; } } } ); } //aspx.cs page.clientscript.registerclientscriptblock(this.gettype(), "scrolltoselectedcheckbox", string.format("scrooltofirstselectedcheckbox('{0}

version control - Lightweight versioning system for standalone development -

i develop lot of prototypes while trying out stuff. wish have lightweight versioning system keep backup of these , make easy me find them next time. me in keeping track of various techiniques have tried solving particular problem. i know suggestions on using right tool job. update: simple google have given me names of version control apps , git preferred choice. know lightest app job , why. dont want single repo take gbs of space. git efficient in handling space thats claim. check link below https://git.wiki.kernel.org/index.php/gitbenchmarks#git.2c_mercurial.2c_bazaar_repository_size_benchmark

c# - Set The "NonSerializedAttribute" To An Auto Property -

this cannot done in c#. way it? ... laugh , in case little pun wasn't understood, mean is: how can mark property in c# nonserialized? of course, when property contains logic, it's natural unable it, auto-properties serializable, and, such, expect have way allow me prevent serialization. edit * : auto implemented properties backed anonymous field don't have access to, attributes designed controlled reflection based mechanism. these fields cannot referenced reflection mechanism (because anonymous). compiler feature require lot of changes generation of auto-properties... require compiler treat auto-properties fields purpose of marking field attributes onto them. to answer more fundamental part of question - point auto-properties serialized , there should way control serialization. you're right - auto properties meant shorthand , never designed give full flexibility, rather allow extend functionality "long" way if ever needed it. i added mor

Do Ruby's "Open Classes" break encapsulation? -

in ruby, programmers allowed change predefined classes. bad programmer like: class string def ==(other) return true end end obviously, no 1 quite dumb, idea more subtle changes predefined class cause problems in already-working code seems me violate principle of encapsulation. four questions: first, this, in fact, violate oo principle of encapsulation? second, there way, programmer, can guarantee in code working unmodified version of class? third, should ever "opening" classes in code, reason? finally, how sort of thing handled in large-scale, production coding environment? in other words, people in programming industry in code others use? or if don't, how ensure plugin author somewhere isn't doing ruin essential part of program? i know subjective question, i'd know how wider programming community feels called "monkey patching." first, this, in fact, viol

Replacing a HTML tag using JQuery -

ok after ajax request 'success' called , string 'data' passed, contains html of site requested. want extract in <body> tag of current site , replace in <body> tag that's stored in data string. how done? i tried var b = $(data).find('body'); , .replacewith(b) b apparently object. thanks help! edit; ajax: $.ajax({ type: "get", url: "managefiles.php", datatype: "html", success: function(data){ ... } }); all need replace html() of body tag $("body").html($(data).find("body")); http://api.jquery.com/html/

iphone - Navigate to specific page in scrollView with paging, programmatically -

how navigate specific page programmatically. have app scrollview populated bunch of subviews (tableviews in case). when clicking on subview zooms in , user can edit , navigate table, when zoom out reload entire view in case there changed made user. of course reloading view sends user page 0. i've tried setting pagecontrol.currentpage property change dot of pagecontrol. mean wrong or need else well?? all controlling page scrolling method: - (void)scrollviewdidscroll:(uiscrollview *)sender { cgfloat pagewidth = self.scrollview.frame.size.width; int page = floor((self.scrollview.contentoffset.x - pagewidth / 2) / pagewidth) + 1; self.pagecontrol.currentpage = page; nsstring *listname = [self.wishlists objectatindex:self.pagecontrol.currentpage]; self.labellistname.text = listname; } you have calculate corresponding scroll position manually. scroll page i: [scrollview setcontentoffset:cgpointmake(scrollview.frame.size.width*i, 0.0f) animated:yes];

command line - Problem with spaces in a filepath - commandline execution in C# -

i building gui commandline program. in txtboxurls[textbox] file paths entered line line. if file path contains spaces program not working properly. program given below. string[] urls = txtboxurls.text.tostring().split(new char[] { '\n', '\r' }); string s1; string text; foreach (string s in urls) { if (s.contains(" ")) { s1 = @"""" + s + @""""; text += s1 + " "; } else { text += s + " "; } } system.diagnostics.process proc = new system.diagnostics.process(); proc.startinfo.createnowindow = true; proc.startinfo.filename = @"wk.exe"; proc.startinfo.arguments = text + " " + txtfilename.text; proc.startinfo.useshellexecute = false; proc.startinfo.redirectstandardoutput = true; proc.start(); //get program output string stroutput = proc.standardoutput.readtoend(); //wait process finish proc.waitforexit(); for example i

java - smartgwt - make window background transparent / no color -

we've tried make background of smartgwt window transparent no success :/ setting transparent image backgroundimage yields nor directly setting custom style class transparent background setting yields no success. is there possibility change default background color : #ffffff or rgb(255,255,255) transparent? thank in advance, dave i think #setopacity(int) should trick... see #setdragopacity(int) .

pdf - How to handle non-ASCII Characters in Java while using PDPageContentStream/PDDocument -

i using pdfbox create pdf web application. web application built in java , uses jsf. takes content web based form , puts contents pdf document. example : user fill inputtextarea (jsf tag) in form , converted pdf. unable handle non-ascii characters. how should handle non-ascii characters or atleast strip them out before putting on pdf. please me suggestions or point me resources. thanks! since you're using jsf on jsp instead of facelets (which implicitly using utf-8), following steps avoid platform default charset being used (which iso-8859-1, wrong choice handling of majority of "non-ascii" characters): add following line top of jsps: <%@ page pageencoding="utf-8" %> this sets response encoding utf-8 and sets charset of http response content type header utf-8. last instruct client (webbrowser) display , submit page form using utf-8. create filter following in dofilter() method: request.setcharacterencoding("utf-8")

In Web Development - What ASP.net can do that PHP cannot do? -

just thinking if it's necessary learn asp.net. also, faster develop? if learn asp.net now.. i using 1 of languages first web application. thanks! i think best answer can given type of question simply: try both , decide yourself i have know devs swear php , others swear asp.net. there many hate php love asp.net. your question subjective, cannot answered unless dive more specific details, "does php threading?" etc. we cannot tell you develop faster in, don't know skill level @ grasping / using new language, assumption have new both. however since biased php, recommend php try with, opinion.

iphone - crash on deleteRowsAtIndexPaths -

my application crashes when i'm deleting row table. here sources bug detected , stack trace. thanx! //delete row database - (void)tableview:(uitableview *)tableview commiteditingstyle:(uitableviewcelleditingstyle)editingstyle forrowatindexpath:(nsindexpath *)indexpath { nslog(@"\ncommiteditingstyle"); //delete user users table specified id if(editingstyle == uitableviewcelleditingstyledelete) { //get object delete array. [dbmanager open: @db_file_name]; //get userid array usersidlist[row] = userid! nsnumber *usersid = [usersidlist objectatindex: [indexpath row]]; [dbmanager deleteuserwithid: [usersid intvalue] table: @table_users fieldname: @"userid" ]; [dbmanager close]; //delete object table. [self.tableview deleterowsatindexpaths: [nsarray arraywithobject: indexpath] withrowanimation: uitableviewrowanimationfade]; } } - (void)deleterowsatinde

php - Want hyperlink in XML file -

i want set hyperlink in image in xml file. here code of xml file.. <logos> <logo id="1" name="abc" path="abc.jpg" x="23" y="4" height="10" width="60"/> <logo id="2" name="xya" path="xyz.jpg" x="50" y="`4" height="20" width="40"/> </logos> i want set hyperlink in image. thanks in advance. kanak vaghela xml generic data format. doesn't have hyperlink capabilities. specific xml application can (xhtml, example, has a element). if xml application using doesn't include describe hyperlinks, need change it, possibly importing namespace (such xlink ). the software consumes application have updated add support change make language.

php - Memory leak at .csv download -

is possible creation of rather largge (20mb) .csv download creates memory leak in case user stops download/export before file has been saved on machine? if yes, how catch , counter problem? it's possible imagine cleared eventually. either way, httpds lot more efficient @ serving files server side language. if you're worried, save file (i assume we're talking dynamically generated file) filesystem (somewhere server can see it) , redirect user url. for security (albeit through obscurity), make filename hideous (eg hash of username , description of file) , make sure people can't directory listing of dir lives in. might make sense date-tag file (eg: filename-year-month-day.ext) can run automatic clean files after 24 hours.

c# - Crystal Reports - Create Multiple PDFs from One Report -

is possible print report in crystal reports multiple pdfs, example if had invoice report needed exported individual pdf documents? i know can done manually, set automatically create these pdfs based on criteria set up. according thread , it's not possible. but, write little application enumerate pages , call reportdocument.printreport each page, configure pdf printer save them automatically generated file names.

git - assembla and github -

i using assembla , github , have set correct post-receive urls (service hooks) link 2 services , use powerful commit messages. have following issue. i have have 3 spaces post-receive urls (service hooks) set on github, 3 spaces receive commit messages. 1 space associates commit messages appropriate ticket. e.g. have set ticket in each space called "test commits" using commit message "test commit re #1" each space pick commit , can see in stream. 1 space associates commit ticket. the thing can tell different 2 don't work have commits against branch , 1 work has commit against master. any suggestions? thanks strange, since branch shouldn't factor. if reproducible, can start trac assembla ticket . (which op lizard did: issue 654 ) it appears issue on assembla side : at moment we not processing commit message if commit located in non-main branch (in git, master) . you've mentioned topic, decided review our decision, ,

django addition -

how increment value of variable in template..?? {% s in list%} {% subject in s%} {% sub in subject %} <div id="{{ sub| getid:i }}"></div> # here want increment value of {% endfor %} {% endfor %} {% endfor %} if want increase i on nested loops, can pass stateful context variable, such i=itertools.count() , , in template, use <div id="{{ sub| getid:i.next }}"></div> the django documentation on template language design states philosophy of template language that the template system meant express presentation, not program logic. and means cannot manipulate state directly filters. achieve state changes, have create own stateful variables state can altered via function call.

php - Posting Twitter/Facebook-Status without authenticating? -

i'm working way through facebook-iphone-sdk , mgtwitterengine , i'm wondering why has hard. i'm not planning access data 2 social networks, allow users of app post message status/update. now after installed facebook-iphone-sdk realized send safari authenticate @ facebook , app. seems overly complicated users of app, if want post don't have go back. isn't there way, call like http://api.twitter.com/version/statuses/update?text="this new status text" ? edit: first answer http://twitter.com/home?status=[url encoded tweet]. is need. unfortunately works on laptop, though if not logged in on iphone, presented a screen 1 has press "login" once. (at url "mobile.twitter.com/home?status=[]"). pressing login there links "mobile.twitter.com/session/new" without status argument , once authenticated status message lost. the url you're looking is: http://twitter.com/home?status=[url encoded tweet]. th

maven 2 - How to ensure signing of test-jars in package phase? -

i have multi-module project parent pom specifies (in profile) configuration , use of maven-jarsigner-plugin sign jars project produces. <profile> <id>sign</id> <build> <plugins> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-jarsigner-plugin</artifactid> <version>1.2</version> <executions> <execution> <id>sign-jars</id> <goals> <goal>sign</goal> </goals> </execution> </executions> <configuration> <keystore>/tmp/certificates.ks</keystore> <alias>jarsign</alias> <storepass>password</storepass&g

PHP Open Source "Property Selling Web App" -

have come across situation have php property selling web app? or if know can search please let me know great! if you're ok using wordpress core, can use real estate , rental plugins available have , running in little 30 minutes. great real estate pretty good: http://wordpress.org/extend/plugins/great-real-estate/ i have made in past , willing share source code if you're looking more basic.

android - getting Failure [INSTALL_FAILED_MISSING_SHARED_LIBRARY] while trying to install Layar401.apk -

i have downloaded layar401.apk file web , trying install android device (htc magic, android 2.2). every time i'm trying install saying: adb install layar401.apk 1098 kb/s (1855698 bytes in 1.649s) pkg: /data/local/tmp/layar401.apk failure [install_failed_missing_shared_library] from other posts figured out there might missing shared library of google maps api in manifest.xml file. tried view manifest.xml file , gave me following: package: name='com.layar' versioncode='27' versionname='4.0.1' uses-permission:'android.permission.access_network_state' uses-permission:'android.permission.internet' uses-permission:'android.permission.access_coarse_location' uses-permission:'android.permission.access_coarse_updates' uses-permission:'android.permission.access_fine_location' uses-permission:'android.permission.access_wifi_state' uses-permission:'android.permission.camera' uses-permission:'a

wpf - Cache ContentControl/ContentPresenter Bound to ViewModel -

if have contentcontrol/contentpresenter content set viewmodel - , have type-referential data template viewmodel - there clean, mvvm-compliant way take "snapshot" of contentcontrol/contentpresenter when has rendered everything? the idea have 3 or 4 viewmodels "open" @ given point in time, , have listbox bound collection of viewmodels. there 1 contentcontrol/contentpresenter displaying "current" view model being viewed. if user moves mouse on 1 of viewmodels in listbox, want display scaled down preview of viewmodel them. rather rendering content everytime, want cache content viewmodel once has been displayed in main contentpresenter. has seen before? chris you can create bitmap of visual using rendertargetbitmap. bitmap include entire visual tree of visual. http://msdn.microsoft.com/en-us/library/system.windows.media.imaging.rendertargetbitmap.aspx http://msdn.microsoft.com/en-us/library/aa969775.aspx

ajax - Jquery/struts 1 combobox dynamic -

i have 2 combobox linked i.e if select 1 , combobox have corresponding data. using jquery call struts action via ajax. struts actions side, sending latest data based upon valuse selcted first copmbobox not reflected on page. have refresh whole page/form? if yes, point of using ajax? $(document).ready(function() { $("#marketchange").change(function() { var marketcode = $(this).val(); //var marketcode1 = document.getelementbyid("marketcode").value(); //alert(marketcode1); $.ajax({ type: "get", url: '<%=contextpath%>/managerangesaction.do?actiontotake=getislandsformarket', data: ({ market: marketcode }), success: function(data){ alert(data) } }); }); the data in form not updated. struts side arraylist second combobox changed not refreshed on

c++ - Is there any efficient way to dynamically change the compress_matrix in boost? -

i using ublas::compressed matrix work umfpack, sparse linear solver. since doing simulation, every time linear system constructed differently might involve enlarging/shrinking coefficient matrix , sparse matrix multiplications. scale of linear system around 25k. even there binding patch boost work umfpack, still need change matrix time time, figuring out number of non-zero values time-consuming(ideally, have give number of non-zero values when initialize matrix). also, use ublas::range append columns/rows dynamically. so question is: there efficient way this? right it's slow me. transposing matrix dimension 15k costs 6s , appending 12k rows fast(because guess it's row-major matrix), appending same number of columns matrix can cost 20s(i guess same reason above, used column-major matrix total time required same). kinda getting desperate here. suggestion welcome. cheers. i not familiar packages, why (ideally) have specify number of non-zero elements in matrix

c# - Improving performance of Castle's DynamicProxy? -

i'm trying implement aop system add automatic audits decorated attributes of objects (done extended version of inotifypropertychanged ). automatic audit contains propertyname it's old value , new value. i'm using castle's dynamicproxy2 there excellent tutorials (namely one:: http://kozmic.pl/archive/2009/04/27/castle-dynamic-proxy-tutorial.aspx ) on how use tool. generate delegate each property decorated type. expression tree generates this:: (note figure easier pasting expression tree code code relies on type-safe reflection library , lots of static variables) .lambda #lambda1<system.action`1[castle.dynamicproxy.iinvocation]>(castle.dynamicproxy.iinvocation $invocation) { .block( dutchtest.mixintest $target, system.object $argument, system.datetime $newvalue, system.datetime $oldvalue) { $target = (dutchtest.mixintest).call $invocation.get_invocationtarget(); $newvalue = .unbox($argument = .call $invocat

Simple GET request with PHP cURL to send SMS text message -

i'm creating quick web app needs send php-created message within php code. curl apparently tool job, i'm having difficulty understanding enough working. the documentation api i'm dealing here . in particular want use simple get-based sms notification documented here . latter resource states api simply: http://sms2.cdyne.com/sms.svc/simplesmssend?phonenumber={phonenumber}&message={message}&licensekey={licensekey} and indeed, if type following url browser, expected results: http://sms2.cdyne.com/sms.svc/simplesmssend?phonenumber=15362364325&message=mymessage&licensekey=2134234882347139482314987123487 i trying create same affect within php. here attempt: <html> <body> <?php $num = '13634859126'; $message = 'some swanky test message'; $ch=curl_init(); curl_setopt($ch, curlopt_url, "http://sms2.cdyne.com/sms.svc/simplesmssend?phonenumber=".urlencode($num)."&message=".urlencode($message).&

Perl: how can I put all my inline C code into a separate file? -

this problem simple can feel rtfm's coming. however, i've been looking @ docs ( inline , inline-c , inline-c-cookbook ) morning , can't figure out how solve problem. i want use inline c, don't want have c code in same file perl code. (emacs doesn't having 2 languages in 1 file. in principle matter of convenience, in practice i'm having edit c in 1 file copy-paste perl script.) here working perl: #!/usr/bin/perl use inline c => data; use strict; use warnings; use list::util qw(sum); use feature qw(say); @array = (1..10); "native perl: ", sum(@array), ", inline c: ", sum1(\@array); __end__ __c__ double sum1(av* array) { int i; double sum = 0.0; (i=0; i<=av_len(array); i++) { sv** elem = av_fetch(array, i, 0); if (elem != null) sum += svnv(*elem); } return sum; } (thanks mobrule getting me far.) i want move of c code (or as possible) separate header file. what can put sum1 header, , this

hibernate - JPA criteria query, order on class -

is there way jpa criteria queries order on class ? imagine following domain objects: abstract class hobby { ... } class coding extends hobby { ... } class gaming extends hobby { ... } using regular ql able do from hobby h order h.class but when apply same logic on criteria query, runtime exception "unknown attribute" occurs. criteriaquery<hobby> criteriaquery = builder.createquery(hobby.class); root<hobby> hobbyroot = criteriaquery.from(hobby.class); criteriaquery.orderby(builder.asc(hobbyroot.get("class")); list<hobby> hobbies = entitymanager.createquery(criteriaquery).getresultlist(); jpa implementation used: hibernate-entitymanager v3.5.5-final jpa 2.0 introduces new type expression allow query restrict results based on class types. you can use type expression criteria api using path#type() . try : criteriaquery criteriaquery = builder.createquery(hobby.class); root hobbyroot = criteriaquery.from(hobby.class); crite

asp.net - Redirect subdomain to subfolder of another subdomain -

what want take traffic going shop.mywebsite.com , redirect or rewrite (i'm not sure of terminology) domain www.mywebsite.com/shop. both shop.* , www.* separate web applications (nopcommerce , umbraco respectively) don't seem cooperate when i've tried nest them. both applications in server 2008 r2/iis 7.5 environment. i've searched around stackoverflow , i've found lot of answers mapping other direction (ie subfolder subdomain) that's not i'm looking far understand problem. the end goal combine seo reputation of shop subdomain www subdomain. readily admit might have backwards , willing try suggestions i'm offered. thanks. i think looking url rewriting . url rewriting process of intercepting incoming web request , redirecting request different resource. when performing url rewriting, typically url being requested checked and, based on value, request redirected different url edit: may want check url rewrite extension

winforms - Location of user files with a ClickOnce application -

i have winforms app trying deploy clickonce. consists of executable , dependent dll, plus bunch of loose xml files in folder called "map". xml files seem present , correct in generated clickonce package , included in .manifest file. however, when install , run, using following code gives me directory not found exception: string apppath = path.getdirectoryname(application.executablepath); string mappath = path.combine(apppath, "maps"); foreach (string xmlfile in directory.getfiles(mappath, "*.xml")) when in "apppath" (which c:\users\mark\appdata\local\apps\2.0\0h6zlxxn.30v\3tno49oj.8jh\midi..tion_5194807c0e95e913_0000.0004_b9d52c73fd4d58ad\ ), there app executable , dll, maps folder not there. what doing wrong? correct way bundling files application? maps folder somewhere user can access , add own files anyway. ok, found code snippet helped me out. xml files being put clickonce "data directory" (this can configured u

multithreading - How do I block access to a method until animations are complete -

i have silverlight app. has basic animation rectangle animated new position. animation consists of 2 doubleanimation() - 1 transforms x, other transforms y. works ok. i want block other calls animate method until first 2 animations have completed. see doubleanimation() class has completed event fires haven't been successful in constructing kind of code blocks until both have completed. i attempted use monitor.enter on private member when entering method, releasing lock 1 of animations completed event, attempts @ chaining 2 events (so lock isn't released until both have completed) haven't been successful. here's animation method looks like: public void animaterectangle(rectangle rect, double newx, double newy) { var xiscomplete = false; duration duration = new duration(new timespan(0, 0, 0, 1, 350)); var easing = new elasticease() { easingmode = easingmode.easeout, oscillations = 1, springiness = 4 }; v

Calling Controller from Tiles Template using Spring 3 -

i set apache tiles 2 in spring mvc 3 application. i created template : <definition name="baselayout" template="/web-inf/jsp/baselayout.jsp"> <put-attribute name="title" value="template"/> <put-attribute name="header" value="/web-inf/jsp/header.jsp"/> <put-attribute name="menu" value="/web-inf/jsp/menu.jsp"/> <put-attribute name="body" value="/web-inf/jsp/body.jsp"/> <put-attribute name="footer" value="/web-inf/jsp/footer.jsp"/> </definition> and welcome page : <definition name="welcome" extends="baselayout"> <put-attribute name="title" value="welcome"/> <put-attribute name="body" value="/web-inf/jsp/home.jsp"/> </definition> and properties tile : welcome.(class)=or

android - Is there a problem with ksoap2 and soap Version 12? -

i tested calling soap 12 webservices ksoap2. used code call webservice: soapobject request = new soapobject(namespace, name); request.addproperty("id", id); request.addproperty("name", "test@test.de"); request.addproperty("pw", "password"); request.addproperty("listid", 501); soapserializationenvelope envelope = new soapserializationenvelope(soapenvelope.ver12); envelope.setoutputsoapobject(request); androidhttptransport client = new androidhttptransport(url); try { client.call(namespace + name, envelope); object response = envelope.getresponse(); } catch (ioexception e) { log.e(getclass().getsimplename(), "io problem", e); } catch (xmlpullparserexception e) { log.e(getclass().getsimplename(), "parser problem", e); } i following exception: org.xmlpull.v1.xmlpullparserexception:expected: start_tag {http://www.w3.org/2001/12/soap-envelope}envelope (position:start_tag <{http://sche

mod rewrite - Having a problem with mod_rewrite adding a trailing slash -

i'm using mod_rewrite turn friendly urls ( site.com/page/ ) script friendly ( ?page=page ) working except 1 thing. if leave off trailing slash on url breaks , gets 404. i tried using solution in this post (slightly modified), doesn't appear working. reference here .htaccess rewrite; <ifmodule mod_rewrite.c> rewriteengine on options +followsymlinks options +indexes rewriteengine on rewritebase / #force trailing slashes on real directories rewritecond %{request_filename} -d rewritecond %{request_uri} !(.*)/$ rewriterule ^(.*)$ $1/ [r] rewriterule ^images - [l] rewriterule ^([^/]*)/$ /?page=$1%{query_string} [l] </ifmodule> so want last/skip on directory test - guessing - , need modify: rewriterule ^([^/]*)/$ /?page=$1%{query_string} [l] into either 2 of them - dealing / , non-slash case - or one rewriterule ^([^/]*)/?$ /?page=$1%{query_string} [l] assuming that want. propably want bit more likel rewriterule ^([^/.]+)/?$ /?page=$1&a

gwt - Writing to a new window -

im trying simple javascript working in gwt keep failing. the code: public static native void createwindow() /*-{ var wndref = $wnd.open('','edit'); var divtag = document.createelement("div"); divtag.id = "div1"; divtag.setattribute("align","center"); divtag.style.margin = "0px auto"; divtag.innerhtml = "blah blah blah"; wndref.document.body.appendchild(divtag); }-*/; i trying open new window , write content it the problem: code opens new window empty. how write content ? doing wrong or expecting gwt? context: end goal open new window , have form panel , various widgets inserted in via java methods. gwt compiled javascript, gwt can js can do. if want open new window , inject content right way: var win = window.open("", "win", "width=300,height=200"); // window object win.document.ope

android - How to Check Login Status? -

i have login app. after login, if correct, want show tabview with: my stats upload photo mapview this code login activity public class loginactivity extends activity { /** called when activity first created. */ @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); string url, user, pwd, user_field, pwd_field; url = "http://myurl.com/login/"; user_field = "username"; pwd_field = "password"; user = "myuser"; pwd = "mypass"; list<namevaluepair> mylist = new arraylist<namevaluepair>(2); mylist.add(new basicnamevaluepair(user_field, user)); mylist.add(new basicnamevaluepair(pwd_field, pwd)); final httpparams params = new basichttpparams(); final httpclient client = new defaulthttpclient(params); final httppost post = new httppost(url); //final httpresponse end = null; //string

asp.net mvc 2 - C# MVC2 Jqgrid - what is the correct way to do server side paging? -

i have jqgrid database table has few thousand rows, jqrid shows 15 @ time. it should displaying (it doesnt take long query 15 rows). instead takes 10 - 20 seconds, indicates retrieving entire table each time. the grid defined this: $("#products").jqgrid({ url: url, mtype: "get", datatype: "json", jsonreader: { root: "rows", page: "page", total: "total", records: "records", repeatitems: false, userdata: "userdata",id: "id"}, colnames: ["product id","product code", ... etc ], colmodel: [{ name: "id", ... etc}], viewrecords: true, height: 400, width: 800, pager: $("#jqgpager"), rownum: 15, rowlist: [50, 100, 200], autowidth: true, multiselect: false and server side (mvc2 action) this: var model = (from p in products select new { p.id, p.productcode, p.productdescription, allocatedqty = p.warehouseproducts.sum(wp => wp

What is the best lisp/scheme for unix scripting? -

the title pretty says all. use clojure major projects it's not scripting language because jvm has slow startup , doesn't interface unixy things. i'm looking lisp work scripting language, example having interface managing unix processes, use things async io, etc. scsh (it stands "scheme shell") can gotten @ http://www.scsh.net . it's "a variant of scheme 48 (an r5rs compliant new-tech scheme system) ... designed writing real-life standalone unix programs , shell scripts." a nice introduction system administration in can found @ http://www.theillien.com/sys_admin_v12/html/v11/i01/a2.htm .

jquery - Tracking goals on AJAX calls in Google Analytics -

on website goal want track attached ajax call rather specific url. there anyway track in google analytics? note: using jquery. the solution can think of @ moment having tiny iframe somewhere on page , loading goal url frame. however, doesn't sound clean , mess pageviews. have taken @ google analytics event tracking ? i've used before ajax based comments success. on page use similar following track url in google analytics: <input type='button' onclick="javascript:pagetracker._trackpageview('/goal/comment.html') />

parallel processing - How to create an async method in C# 4 according to the best practices? -

consider following code snippet: public static task<string> fetchasync() { string url = "http://www.example.com", message = "hello world!"; var request = (httpwebrequest)webrequest.create(url); request.method = webrequestmethods.http.post; return task.factory.fromasync<stream>(request.begingetrequeststream, request.endgetrequeststream, null) .continuewith(t => { var stream = t.result; var data = encoding.ascii.getbytes(message); task.factory.fromasync(stream.beginwrite, stream.endwrite, data, 0, data.length, null, taskcreationoptions.attachedtoparent) .continuewith(t2 => { stream.close(); }); }) .continuewith<string>(t => { var t1 = task.factory.fromasync<webresponse>(request.begingetresponse, request.endgetresponse, null) .continuewith<string>(t2 => {

c++ - udp packet fragmentation for raw sockets -

follow-up of question packet fragmentation raw sockets if have raw socket implemented such: if ((sip_socket = socket(af_inet, sock_raw, ipproto_raw)) < 0) { cout << "unable create sip sockets."<< sip_socket<<" \n"; return -3; } if ( setsockopt(sip_socket, ipproto_ip, ip_hdrincl, &one, sizeof(one)) == -1) { cerr << "unable set option raw socket.\n"; return -4; }; how can set iphdr->fragment_offset (16 bits including 3 bit flags) if have packet of size 1756 (not including ip header)? need prepare 2 packets-one of size 1480 , of size 276, , slap ip headers on both packets? can point example code this? yes, need prepare 2 packets, each own ip header. if put 1480 bytes of data in first packet , 276 in second, ip headers should identical, except these fields: fragment offset : set 0 in first packet, , 1480 in second; total length : set 1480 plus he

php - Matching a list of words with a sentence -

i have list of "bad" words having around 450 words in it. i'm trying check sentence with <?php $sentence = "a quick brown fox jumps on lazy dog"; foreach($words $word) { $check = strstr($sentence,$word); if(!empty($check)) return false; } return true; ?> is there faster , better approach this? you try using preg_split , array_intersect <?php $sentence = "a quick brown fox jumps on lazy dog"; $sntce_wrds = preg_split('/\s+/', $sentence); return count(array_intersect($sntnce_words, $words)) > 0;

c# 4.0 - problem executing multiple SQLite statements from a single file -

i've been writing thin wrapper around sqlite using p/invoke, , i'd give ability read statements file (for bootstraps, etc.). wrote following in file: create table test (col1 integer, col2 text); insert test (col1, col2) values (1, 'test1'); insert test (col1, col2) values (2, 'test2'); this file read via file.readalltext(), prepared via sqlite3_prepare(), , executed via sqlite3_step(). process has prepared , execute single-line sqlite statements. what happens table created, neither insert statement run. need in order able insert multiple statements in single string? figured out. turns out sqlite3_step() steps through 1 statement @ time. result, need call sqlite3_step() once each statement in string. gets little involved, since return code sqlite_done returns no matter how many statements you've executed; i'm doing semicolon count before execute string. alternatively, can use sqlite3_exec() if don't want deal looping busine

tsql - How to incorporate the use of SSRS Dataset parameters with Timestamp escape clause? -

i've following clause of sql query string in ssrs dataset: where "input_date" >={ts '2009-01-01'} , "input_date" < {ts '2009-12-31'} and now, i'd use report parameter wrap dates in sql statement, i.e. @indate1, , @indate2. i've tried this, error occurs: where "input_date" >={ts @indate1} , "input_date" < {ts @indate2} please kindly advise. thanks. what have done add these parameters? assume have altered dataset query changes have posted in question. there 2 more steps need perform make work: define new parameter parameters folder. right click parameters folder , choose add parameter. specify values want user able select. repeat second parameter. add parameters dataset using report. can done in parameters section when edit dataset. add 2 parameters names @indate1 , @indate2 , , set each parameters value parameters defined in step one. alter sql statement described in post.

PHP GD Stronger Antialias -

i'm using gd plot simple charts array point data.. trying optimize appearance - using imageantialias , there still notice-able jag in line between points. what's better way php gd antialias line between 2 points? there number of limitations gd , many awkward workarounds. i'd suggest using imagemagick instead better drawing tools without trouble.

c# - exception handling in the multi thread environment -

i want know if try/catch can catch exceptions thrown children threads. if not, what's best practice handling exceptions thrown in child thread. you can listen application.threadexception , appdomain.unhandledexception events catch uncaught exceptions thread. best catch , handle exceptions in threads themselves. should last resort graceful shutdown / logging.

php - How to limit upload speed for MAMP -

i using mamp test javascript/flash based website locally. uses small php script running on mamp (apache 2.0.63) receive file uploaded via post client. in order test upload progress without using huge files know if there fairly easy way limit bandwidth data upload of apache server in mamp, or better solution? in advance help. i've used speed limit app slow down internet connection enough test loading screens , file progress bars: http://mschrag.github.com/ apparently there's xcode app called network link conditioner similar. see thread: where network link conditioner prefpane in osx mountain lion , xcode 4.4

How can I encrypt with AES in C# so I can decrypt it in PHP? -

i've found few answers encrypt in php, , decrypt in c#, yet have been unable reverse process... the background want to: in c#: aes encrypt file's contents. upload data (likely via http via post) server. in php: receive , save file. and in php (at later date): decrypt file. i want encrypt outside of using ssl/tls (though might have well), need know file remains encrypted (and decryptable!) when stored on server. to encrypt in c# i'm using: rijndael rijndaelalg = rijndael.create(); rijndaelalg.keysize = 128; rijndaelalg.mode = ciphermode.cbc; cryptostream cstream = new cryptostream(fstream, rijndaelalg.createencryptor(key, iv), cryptostreammode.read); and decrypt in php: mcrypt_cbc(mcrypt_rijndael_128, $key, $buffer, mcrypt_decrypt, $iv); generally depends on selecting right options on both sides: plaintext character format how plaintext characters encoded in bit string padding how pad plaintext e

Grep does not show results, online regex tester does -

i unexperienced behavior of grep. have bunch of xml files contain lines these: <identifier type="abc">abc:def.ghi/g1234.ab012345</identifier> <identifier type="abc">abc:def.ghi/g5678m.ab678901</identifier> i wanted identifier part after slash , constructed regex using regexpal : [a-z]\d{4}[a-z]*\.[a-z]*\d* it highlights wanted. perfect. when run grep on same file, don't results. , said, don't know grep, tried different combinations. grep [a-z]\d{4}[a-z]*\.[a-z]*\d* test.xml grep "[a-z]\d{4}[a-z]*\.[a-z]*\d*" test.xml egrep "[a-z]\d{4}[a-z]*\.[a-z]*\d*" test.xml grep '[a-z]\d{4}[a-z]*\.[a-z]*\d*' test.xml grep -e '[a-z]\d{4}[a-z]*\.[a-z]*\d*' test.xml what doing wrong? your regex doesn't match input. let's break down: [a-z] matches g \d{4} matches 1234 [a-z]* doesn't match 5 also, believe grep , family don't \d syntax. try either [0-9] or [:di

known types - Is the usage of the WCF KnownType attribute always a hack? -

i have ever seen being used 'overcome' diferences between oop , soa. it's mechanism allowing serializer informed of types used web service correctly emitted in wsdl , known clients. consider whatever want: hack, feature, ... consider way make clients know possible types.

ruby on rails - Paperclip Processor Operate on S3 -

i trying create custom paperclip::processor integrates external web service (the processor call web service whenever new file uploaded). external service needs file present in s3 , handle uploading processed versions s3 automatically. can done using custom paperclip::processor or should done activerecord callback? if paperclip::processor work, best way trigger upload? ideally i'd processor, requirement original file must uploaded s3 first. have taken @ using after_create calls, seems conflict after_create used in paperclip. thanks. you can create local copy of file. if it's on s3 downloaded. tmp_file = @model.attached_file.to_file => tempfile<...> you can operations on tempfile. when you're don: @model.attached_file = tmp_file @model.save edit: misread question. can use before_post_process , after_post_process hooks perform tasks before or after file processed. class model < ar::base has_attached_file :avatar after_post_proc

android - How to handle switch from 3G to WIFI? UrlConnection TimeOut does not throw Exception -

my application needs download big files. use service download show progress in notification. problem during download time user can switch 3g wifi. in case progress stops no exception thrown. how handle situation properly? url url = new url(myurl); urlconnection conexion = url.openconnection(); conexion.setreadtimeout(10000); conexion.setconnecttimeout(10000); conexion.connect(); int lenghtoffile = conexion.getcontentlength(); // downlod file inputstream input = new bufferedinputstream(url.openstream()); outputstream output = new fileoutputstream(targetfilepath); byte data[] = new byte[1024]; long total = 0; while ((count = input.read(data)) != -1) { total += count; // publishing progress.... updateprogress(downloadnm, downloadnotification, (int)total*100/lenghtoffile); output.write(data, 0, count); } output.flush(); output.close(); input.close(); take @ httpclient-library. provides more options url class, , might problem. http://developer.android.com/

.net - Two Audio Files Merged in one file, and save in the disk -

i'm trying develop basic program editing audio , i'm having following problem. pick 2 songs - separate files, no matter format - , joining them one. in case, merge of these 2 files. responsible , sound lowest , 1 loudest sound in foreground. would still need merge these 2 files, final song saved disk. know me, recommending library could, code, or article? thanks. have @ naudio project on codeplex. , here's article on how merge mp3 files naudio using c# , python. http://mark-dot-net.blogspot.com/2010/11/merging-mp3-files-with-naudio-in-c-and.html also check out article mixing wav tracks in c# - once have final wav file can encode mp3 if that's format of choice.

Deploying Liferay in Virgo( Springsource dm server ) -

i getting following exception when tried deploy liferay war file virgo server. can 1 me please? [2010-11-10 06:24:16.647] start-signalling-3 system.out loading jar:file:/d:/vgp/servers/spike-liferay inside virgo/virgo-web-server-2.1.0.release/virgo-web-server-2.1.0.release/work/osgi/configuration/org.eclipse.osgi/bundles/36/data/store/org.eclipse.osgi/bundles/63/1/bundlefile/web-inf/lib/portal-impl.jar!/portal.properties [2010-11-10 06:28:21.647] start-signalling-3 system.out 06:28:21,553 error [contextloader:220] context initialization failed [2010-11-10 06:28:21.662] start-signalling-3 system.out org.eclipse.virgo.util.osgi.manifest.parse.bundlemanifestparseexception: error parsing bundle manifest header [jsr 286] [2010-11-10 06:28:21.662] start-signalling-3 system.out hp005w:[col 3]: unexpected space found [2010-11-10 06:28:21.662] start-signalling-3 system.out hp013e:[col 4]: expected semicolon found '286' [2010-11-10 06:28:21.662] start-signalling-3 system.out [