Posts

Showing posts from May, 2015

Selenium get dynamic ID XPath -

i'm new on selenium, new here , english not best. i'm using selenium .net ... i have html page number of events different: <div id="eventcontent" style="text-align: center;"> <div class="event" id="event-8971062"> <ul> <li ...></li> <li ...></li> <li ...></li> </ul> </div> <div class="event odd" id="event-9224880"> <ul> <li ...></li> <li ...></li> <li ...></li> </ul> </div> </div> i need check datas in different divs count dynamic , (event)id dynamic too. i'm trying find out count of divs @ first does'nt work. try this: defaultselenium selenium = new defaultselenium(..

asp.net mvc - different db provider without recompile my dll -

hi working on asp.net mvc app now. want put db logic mydbprovider.dll the problem in design, how can change db provider name in web.config without recompile own dll ? use such .net providers (oracle,mssql,postrgree) thanks , sorry bad english as change web.config site's appdomain restart. unavoidable , happens in following scenarios: change of web.config change bin folder trigger of numrecompilesbeforeapprestart what need able swap dal layers program interfaces. there interface implements correct methods want use , associated dal layer (mysql, sqlserver, oracle) implement methods hopefully mean not bound specific implementation of dal paul

performance - ActionScript - Profile Speed Of Script From Code? -

i'm trying cave-man-profile speed of code code using date class , trace statements. it's not working out well. package { import flash.display.sprite; public class test extends sprite { public function test() { var now:date = new date(); var profilespeedmark:number = now.getmilliseconds(); var myarray:array = new array(); (var i:number = 0; < 1000000; i++) myarray.push(math.random()); var profilespeedresult:number = now.getmilliseconds() - profilespeedmark; trace(profilespeedresult); } } } the idea here able compare different ways of coding functions , determine 1 faster. unless i'm on super slow computer i'm not sure if possible, short functions. the problem way you've done things in example code date class has fixed value -- you're comparing time before tests time before tests again. try instantiating date object after tests , taking time that:

java - Exceptions as public classes vs. public static inner classes -

i have 2 options (which technically same, understand) declare custom exception class thrown particular class com.xxx.foo : as public class in package: com.xxx.customexception as public static inner class: com.xxx.foo.customexception which option better? in case exception specific foo class, don't mind keeping public nested class. , whenever seems time extract out, extract out. in general practice, have never seen nested class defined exception, though. don't know if 1 exist in java api.

javascript - &#34; changes to double quotation mark -

my problem right have piece of text in function call inside onclick. can swear double quotation mark encoded &#34; whole thing breaks down because changes somehow normal double quotation mark. usshow("lcd tv 0-23" sony"); i have add built dynamically in js. does js changes encoded characters original form on fly, or there i've never understood coding? usshow("lcd tv 0-23\" sony"); simple, huh? there's solution: usshow('lcd tv 0-23" sony');

database - Wordpress: difference between site_id and blog_id? -

i'm trying understanding of how wordpress works , while inspecting database found that, in multisite installation, there table called wp_site seems holding single record corresponding site_id . cannot understand (nor find on internet) use of site_id when multisites seem use wp_blogs , corresponding blog_id identifying different sites.( http://codex.wordpress.org/database_description ) can shed light on should understanding of site_id ? thanks giuseppe site reference network of blog s. there efforts under way allow wordpress support multiple networks in addition multiple blogs, right that's not stock feature (which why wp_site table contains 1 value. the wp_blogs table contains of blogs entire installation, each identified site it's associated with. this gives clean separation between networks, , (eventually) you'll able have different "groups" of blogs on 1 wordpress installation behave distinct multisite installations.

INNER JOIN in UPDATE sql for DB2 -

is there way use joins in update statements db2? google has let me down on one this i'm trying achieve (... except working ....) update file1 inner join file2 on substr(file1.firstfield,10,20) = substr(file2.anotherfield,1,10) set file1.firstfield = ( 'bit of text' concat file2.something ) file1.firstfield 'blah%' cheers you don't platform you're targeting. referring tables files, though, leads me believe you're not running db2 on linux, unix or windows (luw). however, if are on db2 luw, see merge statement: for example statement, written as: merge file1 using (select anotherfield, file2) b on substr(a.firstfield,10,20) = substr(b.anotherfield,1,10) when matched , a.firstfield 'blah%' update set a

c# - Need suggestion for accessing remote machine in asp.net -

i want access places on remote machine.the folder want access have full control everyone. code given below used access network path. system.io.directoryinfo locationinfo = new system.io.directoryinfo(backuplocationtxt.text); if (locationinfo.exists) { // operations } the application run fine if both host computer , remote computer accessed having os windows xp .the application run fine if application running inside visual studio . then problems ,any 1 of machine( server , remote machine)having os newer windows xp( windows 7, server 2008) locationinfo.exists false. but if application running inside in visual studio, work fine independent of os i searched lot in net. didnt find exact solution yet. suggests impersonation. dont know how it. impersonations solution problem ?? or there better ideas?? any appreciated you have interesting problem, null. how have configured sites directory security? if's anonymous access

jquery toggle text -

function toggle(div) { $("#"+div).toggle(); $("#l_detail").html('hide'); } <a href=""><label id="l_label>details</label></a> how change text details in toglee function you can this: function toggle(div) { $("#"+div).toggle(); var txt = $("#"+div).is(':visible') ? 'hide' : 'details'; $("#l_detail").text(txt); }

.net - Certificates in WCF mutual certificates authentication -

should x.509 certificates used in wcf client , wcf service signed certificate authority (verisign)? or can signed windows root authority? they can self-signed if corresponding public keys available parties.

php - How to retrieve certain value(s) through foreign key linking in MySQL? -

sorry unclear title couldn't come better. my dilemma this: i have 1 innodb table in database called "meetings" following structure: meeting_id (primary key, auto_increment) user1_id (foreign key pointing user_id in table called "users") user2_id (foreign key pointing user_id in table called "users") time (type datetime) location (type varchar(200)) the table "users" basic , looks this: user_id (primary key, auto_increment) first_name (type varchar(30)) last_name (type varchar(30)) i have php file aim print out description of meeting, e.g.: you saved following meeting information: user 1 | user 2 | time & date | meeting location john doe | jane doe | 2010-10-10 10:10:10 | new york now, want use meeting id, call database (only "meetings" table) , able first_name , last_name of user1 , user2. right now, non-working code looks this: $query = "select * meetings meeting_id = " . $mid; $d

actionscript 3 - Problems in looping an AdvancedDataGrid -

i need loop through advanceddatagrid's tree. can explain me things? this code: var adg : advanceddatagrid; var dp : groupingcollection2 = adg.dataprovider; var cursor:iviewcursor=dp.createcursor(); now issue don't know how access objects here. advanceddatagrid has dataprovider groupingcollection2 has xml source, , grouped "project_name" field xml. any advice? something this? var dp:object=mydg.dataprovider; var cursor:iviewcursor=dp.createcursor(); while( !cursor.afterlast ) { // access each column field like: cursor.current.myfieldname trace(cursor.current.myfieldname); // don't forget move next row: cursor.movenext(); } source this might useful: http://help.adobe.com/en_us/flashplatform/reference/actionscript/3/mx/collections/iviewcursor.html this example useful: http://blog.flexexamples.com/2008/04/15/creating-a-view-cursor-on-an-arraycollection-in-flex/

c++ - Solving the Visual Studio 2010 AlwaysCreate rebuild issue -

i've c++ project i'm porting vs2008 vs2010. when build project, visual studio 2010 reports build successful if press f5 start debugger i'm told project not date. if ignore warning, can continue debugging ok, if press ok, whole project (many hundreds of source files), gets rebuilt scratch. output contains following; 1>------ build started: project: sccw-vc2010, configuration: debug win32 ------ 1>build started 15/11/2010 14:47:40. 1>initializebuildstatus: 1> creating "debug\sccw-vc2010.unsuccessfulbuild" because "alwayscreate" specified. 1>midl: 1> outputs up-to-date. 1>clcompile: 1> tinedit.cpp 1> _win32_winnt not defined. defaulting _win32_winnt_maxver (see winsdkver.h) 1> automatically linking sfl504d.lib 1> automatically linking ot1104d.lib 1>c:\program files\rogue wave\stingray studio 10.4\include\toolkit\sectndlg.h(134): warning c4996: 'strcpy': function or variable may unsafe. consider usin

android - onPostExecute() gets called but it wont dismiss my dialog -

i have class extends asynctask, intended serve generic task manager class application. problem :the strange behavior progress dialog shows up, never dismissed. i sure onpostexecute() gets called every task instance, log.d("","") statements fire if placed in here, toast messages show within method, not able dismiss static dialog. i understand asynctask(s) have access ui thread @ 2 places [onpreexecute() , onpostexecute()], think trying dismiss dialog in runonuithread() unnecessary. all calls executetask() made different oncreate() methods of different activities need fetch data on network before populating of ui elements, , pass current activity's context tasks. as not switch activities until after related tasks completed, believe activity context objects still valid (am wrong have assumed this???) have never found of them null while debugging. could timing issue? have observed of times ddms shows tasks completed before activity displayed. if

Playing Live streamed audio through Java -

are there java libraries out there can handle live streamed audio such internet radio stream can played using java? i've looked stuff xuggler/ffmpeg i'm not sure if can handle fact i'm trying play live stream. have able handle most/all of formats internet radio stations stream in. thanks lot. you can have @ jmf - java media framework http://en.wikipedia.org/wiki/java_media_framework http://www.oracle.com/technetwork/java/javase/tech/index-jsp-140239.html on wikipedia site list of alternatives: freedom media in java (fmj) api-compatible jmf alternative ! javasound quicktime java ibm toolkit mpeg-4 jffmpeg jvlc vlcj gstreamer-java cortado, complete player ogg vorbis , theora in java applet directshow <> java wrapper fobs4jmf jlayer mp3 library xuggler video4linux4java

objective c - iphone SDK :How to add more string after an static URL? -

first...if no 1 can answer question it's ok... because don't know how ask question in correctly description my program plist data url , show on iphone tableview my colleagues give me 2 url plist data so have 2 tableviews( tableview1,tableview2 ) two urls( url1,url2 ) my tableview1 via url1 plist1 ,and tableview1 has 3 contents in first 3 rows ex.(row0 id1),(row1 id2),(row2 id3) when select row0 ,it jump tableview2 , title id1 on navgation bar so far can do... but @ tableview2 ,it need url like: www.url2.php?id=1 =>that means... i have add tableview title after url2 to right plist related id 1 my question ....... url2 static,how make dynamic right url address ??? well.....first time thought colleagues give me data array of array but it's not...i never try use url dynamic... this code in tableview1 let me plist url nsurlrequest *therequest=[nsurlrequest requestwithurl:appdelegate.url1//i declare url @ appdelegate.m reason

git - Is it safe to interrupt a dcommit call that appears to be hung up? -

i'm using git-svn bridge , have reshuffled large number of files around in repository it's organized bit better. i ran git svn dcommit put changes @ svn server , process appears hung up. i'm getting no cpu use , no network use dcommit call past 45 minutes. output stuck at: > git svn dcommit ...snip... r zlib/vs2005/zconf.h => tools/zlib/vs2005/zconf.h r zlib/vs2005/zlib.h => tools/zlib/vs2005/zlib.h r zlib/vs2005/zlib_ds.lib => tools/zlib/vs2005/zlib_ds.lib r zlib/vs2005/zlib_ds.pdb => tools/zlib/vs2005/zlib_ds.pdb r zlib/vs2005/zlib_s.lib => tools/zlib/vs2005/zlib_s.lib r zlib/vs2005/zlib_s.pdb => tools/zlib/vs2005/zlib_s.pdb and that's it's been 45 minutes now. edit: ended saying https connection timed out. took hour , half happen. i can't seem find definitive information on happen if interrupt dcommit call , i'd need before attempt resubmit changes agai

c - How to deal with memory leak from someone else's driver -

i running c program on centos 5.5 computer. program runs loop performs tests on , on until told stop external source. by necessity using old driver pci card communicates test system. since upgrading centos 4.5 5.5 have noticed can loop through program 175 times. @ time program halts error allocating heap memory. can watch memory being used in chunks of 10 20 mb each time program loops , system runs out of memory. when exit program using cntrl-c memory freed. i have used valgrind indicates memory leaks in old driver. company wrote driver supports windows , haven't upgraded driver in on 5 years. without source code there way can free memory used driver each time loop through program? thanks. if declare access test system through driver inside loop, should put out of scope on each iteration. something following: char readbuf[512]; (int = 0; < countloops; i++) { int fd = open("/dev/com1", o_rdwr); readbuf = read(fd, sizeof (readbuf)); clo

asp.net - how to call cross domain WebService/WCF in JQuery -

update1: here getting when copy , paste service url in ie browser: http://myservername/myservices.svc?wsdl - <wsdl:message name="ilodge_getcountfor"> <wsdl:part name="parameters" element="tns:getcountfor" /> </wsdl:message> - <wsdl:message name="ilodge_getcountfore"> <wsdl:part name="parameters" element="tns:getcountfor" /> </wsdl:message> - <wsdl:message name="ilodge_getcountfor_input"> <wsdl:part name="parameters" element="tns:getcountfor" /> </wsdl:message> - <wsdl:message name="ilodge_getcountfor"> <wsdl:part name="parameters" element="tns:getcountfor" /> </wsdl:message> http://myservername/myservices.svc?xsd=xsd0 - <xs:element name="getcountfor"> - <xs:complextype> - <xs:sequence> <xs:element minoccurs="0" name="

java - Android: Resources don't contain package for resource number 0x -

i'm writing on custom view in android. uses png's, provided resources in drawable-folder (i put in of drawable folders now, make sure) of project. unfortunately, when startup app, force close , last thing log says is: "warn/resourcetype(261): resources don't contain package resource number 0x7f020002" (the hex-number first icon intend load). now curious thing: graphical layout-editor of eclipse adt plugin has no problems whatsoever loading displaying icons in design view. it's when start actual app (emulator or actual cellphone), android can't find resources. i tried cleaning project , refreshing file structure. didn't quite work out -.- edit: realized can't load string resource. problem seems exist resources. have something, before resources become available? hope can me, thx in advance some times when adding resource files res dir, generated r class gets out of sync assets. if compiling on command line ant, try navigatin

Are there too many asserts in this unit test? -

are there many asserts in 1 unit test? [fact] public void send_sends_an_email_message() { using (var server = new mocksmtpserver()) { server.start(); using (var client = new emailclient("localhost")) { string = "john.doe@example.com"; ienumerable<string> = new[] { "jane.doe@example.com" }; string subject = "test"; string body = "test."; client.send(from, to, subject, body); var session = server.sessions.firstordefault(); assert.notnull(session); var message = session.messages.firstordefault(); assert.notnull(message); assert.notnull(message.from); assert.equal(message.from.address, "john.doe@example.com"); assert.notnull(message.to); var recipient = message.to.firstordefault(); assert.notnull(recipient); assert.equal(r

javascript - process a page on UnLoad? -

i need php file process when user click link/go back/exits page. part of saving user info process. if jquery unload how fire php file load , process. jquery(window).bind("unload", function() { // should add? }); $(document).ready(function() { $(':input',document.myform).bind("change", function() { setconfirmunload(true); }); // prevent accidental navigation away }); function setconfirmunload(on) { // avoid ie7 , prior jquery version issues // directly using window.onbeforeunload event window.onbeforeunload = (on) ? unloadmessage : null; } function unloadmessage() { if(confirm('you have entered new data on page. if navigate away page without first saving data, changes lost.')) { $.ajax({ type: "post", url: "some.php", data: "name=john&location=boston", success: function(msg){

flex - What undocumented alchemy is necessary to get parentApplication to work -

i load swf swfloader. within loaded .swf, this.parentapplication returning null. been searching internet 8 hours. code listing requested: <?xml version="1.0"?> <mx:application xmlns:mx="http://www.adobe.com/2006/mxml" initialize= "init();" visible="false" > <mx:script> <![cdata[ import flextrace.dumper; private var txt_event:textevent = new textevent(textevent.link,false,false,"next.xml"); private var timer:timer = new timer(10000); private function init():void { timer.addeventlistener(timerevent.timer,timer_handlr); timer.start(); } private function timer_handlr(event:event) { dumper.info("timer_handlr"); if (this.parentapplication == null) dumper.info("null"); parentapplication.dispatchevent(new textevent(textevent.link,fa

android - Java - best way to implement a dynamic-size array of objects -

i novice java. i have implement array of objects changes in size during execution. the code writing going ported on android, too. according experience, what's best class implement that? thanks, dan java has inadequate template capability. long want array of objects, arraylist<t> good. primitives, it's awful. assuming have hierarchy of objects want put in list, arraylist ideal: arraylist<vehicle> vehicles = new arraylist<vehicle>(); vehicles.add(new car(...)); vehicles.add(new truck(...)); i'm assuming in above example vehicle base class, , car , truck subclasses. on other hand, if want list of numbers, java highly inefficient. each object reference (really 4 byte pointer) 12 byte chunk of memory, plus you're using. since arraylist cannot apply int, means creating list of numbers means: creating list of integer, object wrapper int. converting objects every time pull out number. done automatically these days, take

java - Seam centralized exceptions -

i'm using seam 2.2, primefaces view presentation layer. write kind of infrastructure in order capture exceptions. example put in facelets following piece of code: <p:commandbutton actionlistener="#{myseamcontroller.amethod()}" in myseamcontroller class, above method: public void amethod() { throw new nullpointerexception(); } in controller write method: @observer("myapp.exceptions.exception") public void onsystemexception(exception e) { system.out.println("a exception occurred"); } i write class catch exceptions: @scope(scopetype.application) @bypassinterceptors @install( precedence = install.mock, classdependencies = "javax.faces.context.facescontext") @name("org.jboss.seam.exception.exceptions") public class exceptionhandler extends org.jboss.seam.exception.exceptions{ private static final long serialversionuid = 1l; @logger log log; public void handle(exception e) throws exception {

sql - Reversing a 1:many relationship between two tables -

i have 2 mysql tables a , b . table a has member ref foreignkey reference b.id . makes 1:many association between b , a . this has been in production few weeks, i'm adding more features code , have realized got original mapping wrong. needed many:1 relationship between b , a . is, b.ref should point a.id , not other way around. wasn't problem until because 1:1 mapping far. how migrate data new schema? i'd guess: alter table b add column ref integer constraint foreign key (a.id) -- add column first run sql equivalent of " for row in a: row.ref.ref = row " alter table drop column ref attempting in sqlalchemy fails circular reference error. need in sql, not familiar necessary select+update syntax. help? for step 2: update b, set b.ref = a.id a.ref = b.id

php - Can I extend the codeigniter core system, to use my custom functions on multiple sites? -

i using codeigniter support 1 site, main purpose display multiple editable tablekit tables, , handle ajax arrives when edit them. kind of phpmyadmin [very] lite. has number of core helpers , controllers, run main workings of site, mixed in site specific controllers , helpers. i restructure site can reuse core code-base in site. however, still have default controller functions , cutsom functions in same controller; i.e. in system file somewhere: class my_core extends controller{ /* lots of base functions */ } and on 1 site: class site_1 extends my_core{ /* site specific functions */ } then on other site: class site_2 extends my_core{ /* site specific functions */ } does have guidance on how can this? thanks, lemiant if using codeigniter 2.0 can achieve of with packages. let load helpers, libraries , models anywhere, in each application configure package loaded shared folder. as core libraries (which my_controll

Using a Filesystem (Not a Database!) for Schemaless Data - Best Practices -

after reading on other question, using relational database schema-less data , began wonder if filesystem more appropriate relational database storing , querying schemaless data. rather building file system on top of mysql, why not save data directly filesystem? indexing needs figured out, modern filesystems stable, have great features replication, snapshot , backup facilities, , flexible @ storing schema-less data. however, can't find any examples of using filesystem instead of database. where can find more resources on how implement schemaless (or "document-oriented") database layer on top of filesystem? using modern filesystem schemaless database? yes filesystem taken special case of nosql-like database system. may have limitations should considered during design decisions: pros: - - simple, intuitive. takes advantage of years of tuning , caching algorithms easy backup, potentially easy clustering things think about: richness of metada

java - rename refactor in eclipse -

while developing eclispe plugin, able programmatically rename class-field using following code. renamesupport renamesupport = renamesupport.create(field, newname, renamesupport.update_references); renamesupport.perform(workbench.getshell(), workbench); but applies changes actual source files. there anyway can prevented? need renamed code internally (for performing other computations), must not change actual source. please suggest. you copy temporary file file.createtempfile() , rename code in temporary file, if renamesupport lets that. if doesn't, can copy original temporary file , copy once other computations finished.

python - urllib2 redirect empty page (though code is 200 and geturl() points to new page) -

i trying access web page using urllib2 , automatic redirect in urllib2 not seem retrieve entire page. here code: request = urllib2.request(link) request.add_header('user-agent','...') opener = urllib2.build_opener() page = opener.open(request) print(page.code) print(page.geturl()) print(page.read()) a) when link = 'https://www.google.com'. prints 200 https://www.google.com <!doctype...> etc. etc. </script> b) when link = 'https://www.xyz.com/a_link_which_is_redirected.html'. prints 200 https://the_new_link <blank> however, if access 'link' in b) via internet browser, correctly displays page form. view source of google page - end script tag. leave off of closing tags because browsers can still interpret correctly , saves bandwidth. here test redirect pages . of not work you?

python - Why does Sqlite tell me no such column exists when I plainly created it? -

in python 2.6.5 sqlite3.version 2.4.1, use following code: c = conn.cursor() # create table c.execute('''create table stocks (date text, trans text, symbol text, qty real, price real)''') # insert row of data c.execute("""insert stocks values ('2006-01-05','buy','rhat',100,35.14)""") # save (commit) changes conn.commit() c.execute('''insert stocks values(date=?, trans=?, symbol=?, qty=?, price=? )''', ('08-26-1984', 'sell', 'gogl', 3, 400.00)) # can close cursor if done c.close() and throws error: traceback (most recent call last): file "dbtest.py", line 18, in <module> c.execute('''insert stocks values(date=?, trans=?, symbol=?, qty=?, price=?)''', ('08-26-1984', 'sell', 'gogl', 3, 400.00)) sqlite3.operationalerror: no such column: date my question - heck??? crea

xml - Magento - Layout and block -

are there reference materials describe magento's key layout elements such as: <block>, <default>, <xxx type='catalog/product_price_template'>, etc. thank you i link often, explains magento's layout good: http://magebase.com/magento-tutorials/demystifying-magentos-layout-xml-part-1/

Can I run Wine on an Android slate? -

i run small windows program on android slate. runs fine under wine in ubuntu, unsure how install & run wine on android slate. sorry if it's not strictly programming question. if want so, rephrase "will have write delphi code again java in order run on android slate?" i don't believe work because trying run x86 software on non-x86 processor. start need binaries compiled arm processor.

How to add TFS bindings to a Visual Studio 2010 project? -

there's question discussing how add project/solution bindings tfs , seems apply visual studio 2008 (i unable find "change source control" dialog in vs2010). i have solution , source code on local machine in tfs, not have tfs bindings (the thing produces padlock icon in visual studio solution explorer , allows automatic checkout). how can add bindings existing tfs project using visual studio 2010? in vs2010 check tools>options>source control , see if set tfs. if not might why don't see file->source control->change source control.

Parse XML Libxmljs (Node.js) -

i'm attempting parse xml string libxmljs (https://github.com/polotek/libxmljs) . i'm having issues though. need apply logic i'm parsing , return based upon what's defined , isn't. because of don't see sax-style parser being valid option. i'm willing @ other alternatives if can achieve i'm looking for. being able select elements domparser xmldoc.getelementsbyid('firstname')[0].childnodes[0].nodevalue awesome... libxmljs supports dom sax style parsing. var xmldoc = libxmljs.parsexmlstring('<item><data id="firstname">your name</data></item>'); var xmldoc2 = libxmljs.parsexmlfile('mydata.xml'); the api custom , doesn't follow w3c/browser spec (it's on list). want use xpath query document content want. xmldoc.find("//[@id='firstname']")[0].childnodes()[0].text() notice childnodes , text function calls. take @ docs. https://github.com/polotek/libxmlj

html - stop downloading images and code from website -

possible duplicate: how prevent downloading images , video files website i developing own website. in website need add feature prevents downloading images , code. is possible prevent downloading of images , code form website ? please reply. thanking , kindly regards the way prevent people downloading things website not put them on site in first place. here's how website works: computer: hey, example.com server, can send me page "cupcakerecipes.html"? example.com server: why, sure can. here's page. computer: see page includes image "deliciouscupcake.jpg" — can send me image can show user delicious cupcake? example.com server: oh, yeah, here ya go, buddy. computer: hey, sorry bug again, see page wants me run script "animatesprinkles.js" — can send can run it? example.com server: of course! see, @ each step of way, user's computer downloading resources needs. if not allow user&

.net - EWS error when updating an item Category -

i following error when calling update() method on item in vb .net application using ews (logged on exchange 2007 sp1): property update did not succeed what cause? i'm hoping not due ews requiring exchange 2010 update categories on item. update made item add category. edit: also, following code, makes copy of message , updates category works fine. looks it's changing category property existing messages that's problem. dim itmmessage2 = itmmessage.copy(itmmessage.parentfolderid) itmmessage2.categories.add(strcategoryname) itmmessage2.update(conflictresolutionmode.alwaysoverwrite) cheers, dave i have no idea why solution worked, makes me think broken either api installation, or on exchange 2007 sp 1 server i'm connecting to: i sent through bind() request asking every itemschema property exchange 2007 supports (so not uniquebody etc. 2010 specific). now original code working fine. and stays working fine after remove property requests! go

javascript - Is there a quicker way to write conditional statements? -

i have statement this: if(window.location.hash != '' && window.location.hash != '#all' && window.location.hash != '#') can write have mention window.location.hash once? the obvious way is: var h = window.location.hash; if (h != '' && h != '#all' && h != '#')

iphone - How to append two audio files? -

i want append 2 audio files in iphone. please me this. i got solution; following sample code it. avmutablecomposition* composition = [avmutablecomposition composition]; avurlasset* audioasset1 = [[avurlasset alloc]initwithurl:[nsurl fileurlwithpath:filepath1] options:nil]; avurlasset* audioasset2 = [[avurlasset alloc]initwithurl:[nsurl fileurlwithpath:filepath2] options:nil]; avmutablecompositiontrack *audiotrack1 = [composition addmutabletrackwithmediatype:avmediatypeaudio preferredtrackid:kcmpersistenttrackid_invalid]; [audiotrack1 inserttimerange:cmtimerangemake(kcmtimezero, audioasset1.duration) oftrack:[[audioasset1 trackswithmediatype:avmediatypeaudio] objectatindex:0] attime:kcmtimezero error:&error]; [audiotrack1 inserttimerange:cmtimerangemake(kcmtimezero, audioasset2.duration) oftrac

How to set the max execution time of script in php when the server is in safe mode? -

i want upload , download files server. server in safe mode not allowing increase execution time of script. cant increase time limit script timing out. appreciated. there ugly hack remember server environments cannot control timeout. here goes - when process starts, set processid in db you timeout page , reload page before timeout happens using javascript, on each such load (using javascript), pass processid stored in db on page load, check if processid exists in db , accordingly restart script left (i not sure how work in case of upload/download, can break file pieces). on completion of job, delete processid db. as mentioned ugly hack, please use if left no other choice or if else cannot suggest better option. let know how goes or if need details.

Reload configuration after Rails initializer -

in environment.rb , rails configured in initializer block: rails::initializer.run |config| config.action_mailer.smtp_settings = settings end this propagates push various config settings framework classes actionmailer::base.smtp_settings. if need reconfigure outside initializer.run block, can set: rails.configuration.action_mailer.smtp_settings = new_settings but in case it's not picked in actionmailer::base.smtp_settings. is there way make rails "push" updated configuration again? or best reconfigure actionmailer::base directly , not worry rails.configuration out of sync it? you should use actionmailer::base class. point of using rails.configuration able set various options before actual code loaded. if need change afterwards, there no need use rails.configuration.

CSS a:hover image borders -

i have bunch of linked images in table, padding. when try add img:hover or a:hover border attribute, when border appears, moves on amount of pixels border thick. there way stop behavior? img { border: solid 10px transparent; } img:hover { border-color: green; }

c# 3.0 - what is use of creating property in separate class for each entilty? -

i learning code practice that's why going through code, thing not understand in it. has made property in separate class each entity in userclass has property #region public properties private int uid; public int userid { { return uid; } set { uid = value; } } private string uname; public string username { { return uname; } set { uname = value; } } private string pwd; public string password { { return pwd; } // set { pwd = value; } } private string uaddress; public string useraddress { { return uaddress; } set { uaddress = value; } } private string fname; public string firstname { { return fname; } set { fname = value; } } private string lname; public string lastname { { return lname; } set { lname = value; } } private string uphone; public string userphone {

objective c - Add hotkey when editing a NSTextField -

is possible add hotkeys when you're editing nstextfield? example, when you're in text field if pressed command + 1 inserted 1 string, , command + 2 insert text string, etc, when you're editing nstext field. i tried adding keydown method subclassed nstextfield, didn't seem ever fired. if changed keyup gets fired, not if command key held down. it seems when i'm searching hotkeys information find on global hotkeys (ones activate when app isn't visible) isn't i'm looking for. if had menu item keyboard shortcut, implement validateuserinterfaceitem: enable when field in responder chain. i'm not sure whether work hidden menu item.

c# - the comparison between as and cast -

possible duplicate: direct casting vs 'as' operator? anyone can give comparison between , cast? a straight cast fail if object being casted not of type requested. as -cast instead return null. example: object obj = new object(); string str = (string)obj; // throws classcastexception however: object obj = new object(); string str = obj string; // sets str null when object being casted is of type casting to, result same either syntax: object casted. note should avoid "as-and-invoke" pattern: (something sometype).foo(); because if cast fails, throw nullreferenceexception instead of classcastexception. may cause chase down reason something null, when it's not! uglier, better code ((sometype)something).foo(); will throw classcastexception when object referenced something cannot converted sometype , , nullreferenceexception when something null.

c# - How should internal classes and methods be tested? -

possible duplicate: testing internal class i have test classes in separate assembly, , causing problem testing internal classes. since internal classes , methods visible inside of assembly test assembly can't see classes , methods. effective way test classes? need use reflection access methods wan't test? you can use internalsvisbleto attribute. see question: how allow assembly (unit testing one) access internal properties of assembly?

apache2 - How can I process http responses with XSLT in Apache webserver? -

i have php application want publish different , feel. we've chosen using xslt. way don't have touch php application , run risk introducing instability in original. that's important since we're close production. i've looked ways of doing xslt processing in apache webserver. , seems available xslt module hasn't been updated since 2005. hoping use xslt mod in filter chain accomplish want. unsupported module won't do. option can think of xslt processing using servletfilter in java application server. seems rather roundabout have http request arrive @ apache webserver, forwarded java application server forwarded apache webserver php processing, , reverse way response... so question is: there way xslt processing in apache webserver? there way this? thank in advance. i not know of way in apache. php using its xsl(t) module , though.

c# - DateTime.ParseExact not working at all, why? -

i attempting parse following string datetime object in c#: datetime.parseexact("20101108 230125", "yyyymmdd hhmmss", null) although value looks correct parseexact method keeps giving me following: string not recognized valid datetime. can tell me why , how can parse above string without having manual way? isn't parseexact supposed kind of occasion? you got format hours wrong, should uppercase: datetime.parseexact("20101108 230125","yyyymmdd hhmmss", null) lowercase hh specifies time uses 12-hour clock (with am/pm). uppercase hh 24 hour clock time. for detailed info, check documentation of custom datetime format strings .

visual studio - Passing MSBuild options when calling devenv -

is there way pass command line switches devenv passed as-is when calls msbuild? you can achieve /property (/p) key of msbuild. open .csproj in text (with notepad.exe): combinations $(somename) properties of msbuild. can passed in command line of msbuild via /p:somename=somevalue, can passed devenv through environment variable. example: start visual studio command prompt, in command prompt type: set semename=somevalue devenv visual studio start. load solution of choice, property "somename" passed projects in solution value "somevalue".

hibernate - How to auto increment data on new record insertion -

i add user defined column auto increment on new record insertion, how should this? runs on h2, mysql @entity public class parent { @onetomany list<child> children; } @entity public class child { int sortorder; } e.g. parent1 has child{1, 2, 3} parent2 has {1, 2} note: values within each parent needs auto incremented not outside. set id type identity, , db tbale should handle identity insertion. sample, <id name="daytypeid" column="day_type_id" type="int"> <generator class="identity"> </generator> </id>

c - What are the Compiler Options & Other mechanism for reducing the static library size? -

what compiler options & other mechanism reducing static library size? os : vxworks compiler : gcc language : c use -os optimise smaller code size, , leave out -g , other debug options.

How to create a Photo Gallery on Android? -

i want create photo gallery on android. i'm using gallery , baseadapter create scrollable gallery. want add action when image of gallery shown (each image's width same screen width), need index in image array. question how index of image shows on screen? i want index of image shows on screen, not on click event. i've tried current image position in getview() , result strange: i scroll image02 position=2 (should 1). when scroll back, image02's position=0 (should 1). public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); gallery g = (gallery) this.findviewbyid(r.id.gallery); g.setadapter(new imageadapter(this)); } public class imageadapter extends baseadapter { private context mcontext; private integer[] mimageids = { //each image's size 320x60 r.drawable.btm01, r.drawable.btm02, r.draw

javascript - How to select a list of elements by name? -

i want select elements start particular sequence. sequence work_xxxxxx. how achieve this? i providing answers in both jquery , javascript best option use jquery because javascript have loop throught elements , match desired patteren time consuming process preference use jquery: finds inputs attribute name starts 'work_' , puts text in them. <input name="newsletter" /> <input name="work_man" /> <input name="work_boy" /> <script> $('input[name^="work_"]').val('work here!'); </script> http://api.jquery.com/attribute-starts-with-selector/ http://api.jquery.com/category/selectors/ with javascript no builtin keyword this, can loop through elements , check match of desired pattern, way: var idstart = "work_"; var componentcontainer = document.getelementbyid("containertable").getelementsbytagname("div"); (var = 0; < componentcontainer.leng

jquery nextAll and skip first element -

i need add click event on fist child td each tr class “ toprow” toggle next tr rows class “subrow” skiping first tr under tr.toprow. table example <table> <tr class="toprow"> <td>text</td> <td>text</td> <td>text</td> </tr> <tr class="otherrow"> <td colspan="3">text</td> </tr> <tr class="subrow"> <td>text</td> <td>text</td> <td>text</td> </tr> <tr class="subrow"> <td>text</td> <td>text</td> <td>text</td> </tr> <tr class="toprow"> <td>text</td> <td>text</td> <td>text</td> </tr> <tr class="otherrow"> <td colspan="3">te

Sharing an object between instances of a C++ DLL -

good morning all, forgive me if title not clear, i'll try explain more here: i working asi vbs2. vbs2 executes functions vbs2 dll plugin. have own application want use modify variables within plugin whilst being used, change being executed vbs2. began by, foolish may be, directly changing variables application whilst vbs2 program running. when did not work tested , found vbs2 program using different instance of "message" object, in storing variable, 1 being accessed application. what have application access same instance of object being accessed vbs2. have experimented bit #pragma data_seg(".testseg") message msg; void foo(...); //etc. #pragma data_seg() but reason or still appears there 2 instances being used. i appreciate , help, , add c++ new language me please gentle. :) thanks, m you need use linker flags tell linker place segment in sharable memory. see http://msdn.microsoft.com/en-us/library/ms933104.aspx i belive need add

scripting - How to remove header and footer records of a flat file using UNIX shell script? -

i having flat file give below. how delete header , footer file using unix shell script , rewrite same file. 9 20050427 header record 0000000 00000 000000000 123456 00 654321 datarecord 0000000 00000 000000000 123456 00 654321 datarecord 0000000 00000 000000000 123456 00 654321 datarecord 0000000 00000 000000000 123456 00 654321 datarecord 6 20050427 trailer record thanks, arun this ugly, seems work, @ least on input: f='test.txt'; g=`wc -l $f`; h=`echo $g | cut -d ' ' -f1`; head -n $((h-1)) $f | tail -n $((h-2)) f name of file. couldn't work out quicker way rid of filename output of wc. should able beat this. if want rewrite same file, redirect output of command: f='test.txt'; g=`wc -l $f`; h=`echo $g | cut -d ' ' -f1`; head -n $((h-1)) $f | tail -n $((h-2)) > $f

sql - Principal server status when it comes back after failure (Mirroring) -

i have 2 servers set in mirroring without witness - transaction safety off databases , safety full on critical. know failover scenarios when principal or mirror server fails , needs done bring db's online never tested 1 specific scenario: the principal server has crash, unexpected shutdown, or reboot. no dba on duty manage failover the mirror server take disconnected principal , set status "disconnected" each mirrored db's. the principal server restarted after while (2-3 minutes interval bigger mirroring timeout) the questions is: after restart of principal - gets normal , former principal , mirror take past places? mirroring on principal suspended , must resumed? i think need manually fail on principal, can going right clicking on database -> task -> mirror , click failover

c# - Textbox Auto Complete - Winform + LINQ -

i'm building simple win form application 1 datagrid, 1 textbox. have 10k records of names. what want implement sort of auto complete feature when user types textbox, datagrid updated display matches accordingly. just test out, have 1 datacontext object returns names table , put code in textbox1_textchanged event reset data source this.datagrid1.datasource = (from p in connectionwrapper.getconnectionobj.patientsnormalizeds p.name.contains(textbox1.text) select p).take(30); this works fine on local connection when pulling data off remote sql server of course slow, typing becomes sluggish , unacceptable users. just wondering if can done out changing design. can of course load entire table list or datatable @ form_loading , run search against cause form stop responding 3 seconds or so... this simple developers i'm new. thanks! a couple of approaches spring mind. firs

What does "invalid statement in fillWindow()" in Android cursor mean? -

i see error in logcat output, cursor: invalid statement in fillwindow(). it happens when press key , goes default android listview before going custom listview . what mean? how solve it? because not point line of code problem coming from. when dealing listactivities, issue has cursor objects, cursoradapter objects, , database objects not being closed when activity stops, , not being set when activity starts or resumes. i had make sure closed simplelistadapter, cursors, , database objects in respective order, in onstop method of activity called when tabactivity resumes. i had been closing cursor , database objects, had not been closing simplelistadapter cursor. /** * onstop method * * perform actions when activity hidden view * * @return void * */ @override protected void onstop() { try { super.onstop(); if (this.mysimplelistadapterobj !=null){ this.mysimplelistadapterobj.getcursor().close(); this.my

php - Finding Pagerank in google -

i know algorithm find out page rank in google search. currently using php , curl method. starting 0 - until found or time limit submit google different start index. i know if there way or not? google no longer uses pagerank algorithm rank search results. may still generate number, it's largely irrelevant. better means of judging site use woorank or similar. pagerank value literally useless. hope puts on right path.

c++ - illegal user defined conversion? -

here code , comment: template<class t> struct b { b(){} template<class t1> operator t1() { return t1(); } // define macro if compiler fails. #if (defined use_more_tidous_way) // (defined _msc_ver) template<class t1> explicit b(b<t1> const& ) {} template<class t1> operator b<t1>() { return b<t1>(); } #else template<class t1> b(b<t1> const& ) {} #endif #if 0 ////// explanation: // firstly, want have convserion ctor : template<class t1> b(b<t1> const& ) {} // , conversion function : template<class t1> operator t1() { return t1(); } // may t1 general, hide above // conversion ctor compilers (msvc8~10 fail, gcc 4.4.0~ ok) // overcome such case, add conversion function : template<class t1> operator b<t1>() { return b<t1>(); } // , not use conversion ctor, while can still have ctor upon b<t1> template<

java - List files in a path which having wildcards using DirectoryScanner -

im using apache directory scanner scan files in path having wildcards. directoryscanner scanner = new directoryscanner(); scanner.setincludes(new string[]{"*/*.java"}); scanner.setbasedir("c:/temp"); scanner.setcasesensitive(false); scanner.scan(); string[] files = scanner.getincludedfiles(); the problem here if use above code display java files inside sub directories of temp , not java files directly in temp folder. also have notice if use (new string[]{"*.java"}) list java files in temp folder , (new string[]{"**/*.java"}) list java files inside sub directories of sub directory. question here is, 1) standard wild card syntax apply every where? mean **/ means directories , */ means sub directories? 2)how files in temp directory directly , inside sub directoroes (not again inside sub directories use **) 3)now can see when using directoryscanner have base directory , relavanat wildcard syntax. but suppose have wildcards in middl