Posts

Showing posts from August, 2014

excel - ODBC connection to SQL Server 2008 through VPN failing -

i have excel add-in allows users run queries against sql server database , return results directly spreadsheet. works fine. there user in satellite office connecting our network (shared drive, etc.) through vpn connection. when uses same spreadsheets work in main office, gets following error: [dbnetlib] sql server not exist or access denied what strange if run individual query, works fine, seems running many queries in succession makes sheet crap out. it's little difficult diagnose excel add-in runs queries internally, possibly many of those. theory when db server sees many successive queries come in ip that's outside of network, there's point @ refuses return more data. is there validity theory? there configuration changes can make db allow remote odbc connections work well? in case interested, issue creating server-side cursor, , queries time out have pay network round-trip each cell in result set. started working fine when switched client-side cursor...

Java simplify the syntax -

what terse way in java check following condition int m, n; the condition check whether either m or n negative both shouldn't negative. i'm looking terse yet simple syntax (m < 0) ^ (n < 0) note in context, ^ logical xor operator (yes, mean "logical", distinct "bitwise").

Compile Linux application for Windows (C) -

can compile linux application, linux-only available libraries, windows ? i know author of nginx web server uses wine tools linux-based project working on win32, natively, how ? is mingw support create windows binaries linked linux-specific libraries/headers ? ps: not want use cygwin due big lost performance... using mingw32 environment, have find or build libraries on project want build depends (and libraries on libraries depend). you might end having implement functionality missing on platform. 1 of reasons cygwin slow hoops has jump through simulate unix-y things missing on windows.

hibernate - Join an association multiple times with different aliases -

i think, problem have bug in hibernate (already tracked - https://hibernate.onjira.com/browse/hhh-879 ). my question - there workaround join table multiple times grails criteria query? the sql straight forward: select s store s inner join s.products prod1 inner join s.products prod2 prod1.type = 'shoes' , prod2.type = 'shirts' when use "createalias" in grails criteria query (one prod1 , 1 prod2) i´am getting following error: org.hibernate.queryexception: duplicate association path: studytags ... one possibilty might by, query or (one single join , prod.type = 'shoes' or 'shirts') , filter result set. problem solution is, if specify limit criteria query (max results), real result (after filtering) might have less entries specified. any appreciated. thanks. ps: real code, experienced issue pretty complex. break problem down used example store , product... think query like store.withcriteria{ ...

r - creating one new data frame applying one function over existing one -

i'm trying create new data frame using existing 1 data in pairs targetid a1 a2 b1 b2 cg00000108 0.94483140 0.959417300 0.94427000 0.956393400 cg00000292 0.83331720 0.836168900 0.75568530 0.869691000 cg00001594 0.00000000 0.009319287 0.00318779 0.001852309 cg00003298 0.01775547 0.034981820 0.03380106 0.116663900 cg00003345 0.55442110 0.542106600 0.54762020 0.624028200 cg00004055 0.10287610 0.107147500 0.09293073 0.106663000 the idea 1 data frame results of subtraction between pairs,so getting finallythree final columns targetid a1-a2 b1-b2 i tried apply have no enough programming skills in r how function begin subtraction thanks in advance how simply: with(d, data.frame(targetid, a1-a2, b1-b2)) where d data frame.

sql server - SQL: Trigger is not performing -

i have created trigger set value of column of data type time null when time inserted less getdate() alter trigger [dbo].[null_time_trigger] on [dbo].[products] after insert update products set parkingstarttime = null products join inserted on i.parkingstarttime = products.parkingstarttime i.parkingstarttime < cast(getdate() time); the problem when i select * table record still having time rather being null . any ideas ? regards. rsenna has 1 option, , superior in many respects. here how play after insert version (asssume int pk): alter trigger [dbo].[null_time_trigger] on [dbo].[products] after insert declare @id int select @id = id inserted update products set parkingstarttime = null id = @id

Which programming language has this syntax? -

which programming language? $((1400+random%300)) i know generates random number between 1400 , 1699 i'd go bash. ole@servant:~$ echo $((1400+random%300)) 1672 http://tldp.org/ldp/abs/html/randomvar.html

core data - NSPredicate with localizedCaseInsensitiveCompare -

i have app coredata , need use nspredicate retrieve contacts city. the question "city" maybe written london or london or london. , user type london search, or london. what need use nspredicate localizedcaseinsensitivecompare, records retrieved. code: request.predicate = [nspredicate predicatewithformat: @"activitydeleted == %@ && (subquery(hasmembers, $sub, $sub.memberdeleted == %@).@count > 0) && (subquery(hasmembers, $sub, $sub.city == %@)", [nsnumber numberwithbool:no], [nsnumber numberwithbool:no], city]; the above nspredicate retrieves groups have contacts, not deleted, in city, have caseinsensitive problem... how can that? thanks, rl you don't need subquery here. entire predicate can instead be: @"activitydeleted == no , hasmembers.memberdeleted = no , hasmembers.city =[cd] %@", city

jquery - make these javascript functions more portable -

i'm missing fundamental understanding of javascript function flow control... i've created jquery slideshow. show broken down logical sections, each section controlled function (makes easy add sections later)... function myslideshow() { section1(); section2(); section3(); } each section has multiple functions composed of jquery statements, animations, timed stuff...so maybe.. function section1() { firstpart(); settimeout('secondpart()',5000); settimeout('thirdpart()',6000); } now here's issue... want define functions "firstpart(), secondpart(), thirdpart()" inside of section1(). want various reasons: each section may logically have own "parts" portability of section so keep section , of respective parts inside of section. i can't seem work... when define "parts" inside of section of functions ran @ same time. so ideally i'd have is: function section1() { firstpart()...

c# - Unable to correctly implement a binding between the property value of an object and the property value of a control -

i'm trying update textedit control through client class object databindings inotifypropertychanged implementation , can't work. object behind (datasource) updates textedit still remains blank. if type text editbox datasource gets updated. please? here's relevant code i'm using: public class client : notifyproperychangedbase { private string _firstname; public string firstname { { return this._firstname; } set { this.checkpropertychanged<string>("firstname", ref _firstname, ref value); } } } public client clienta = new client(); binding fname = new binding("text", clienta, "firstname", true, datasourceupdatemode.onpropertychanged); ultratexteditor_firstname.databindings.add(fname); clienta.firstname = "testn"; <== editbox remains blank ... am missing here? in advance, peter. i assuming base implemented along line...

C# Linq question -

i have text file in storing entries address book. layout so: name: contact: product: quantity: i have written linq code grab name plus next 4 lines, search name feature. want able search contact. challenge match contact info, grab next 3 lines, , grab line prior match. way if search contact used, full list of info returned. private void buttonsearch_click(object sender, eventargs e) { string[] lines = file.readalllines("c:/addressbook/customers.txt"); string name = textboxsearchname.text; string contact = textboxcontact.text; if (name == "" && contact == "") { return; } var byname = line in lines line.contains(name) select lines.skipwhile(f => f != line).take(4); //var bycontact = line in lines // line.contains(name) // ...

java - Why does the look-behind expression in this regex not have an "obvious maximum length"? -

given string containing number of square brackets , other characters, want find closing square brackets preceded opening square bracket , number of letters. instance, if string is ] [abc] [123] abc] i want find second closing bracket. the following regex (?<=[a-z]+)\] will find me second closing bracket, last one: ] [abc ] [123] abc ] since want find first one, make obvious change regex... (?<= \[ [a-z]+)\] ...and "look-behind group not have obvious maximum length near index 11." \[ single character, seems obvious maximum length should 1 + whatever obvious maximum length of look-behind group in first expression. gives? eta: it's not specific opening bracket. (?<=a[b-z]+)\] gives me same error. (well, @ index 12.) \[ single character, seems obvious maximum length should 1 + whatever obvious maximum length of look-behind group in first expression. gives? that's point, "whatever obvious m...

c++ - newtons methods implementation -

i have posted few hours ago question newtons method,i got answers , want everybody,now have tried implement code itself #include <iostream> #include <math.h> using namespace std; #define h powf(10,-7) #define pi 180 float funct(float x){ return cos(x)-x; } float derivative (float x){ return (( funct(x+h)-funct(x-h))/(2*h)); } int main(){ float tol=.001; int n=3; float p0=pi/4; float p=0; int i=1; while(i<n){ p=p0-(float)funct(p0)/derivative(p0); if ((p-p0)<tol){ cout<<p<<endl; break; } i=i+1; p0=p; if (i>=n){ cout<<"solution not found "<<endl; break; } } return 0; } but writes output "solution not found",in book after 3 iteration when n=3 ,it finds solution .7390851332 ,so question how small should change h or how should change code such that,get correct answer? ...

Reading from a URL and storing in an ArrayList in JAVA -

i'm trying read url below appears work when try store in arraylist gives me error. ideas on whats causing error? public abstract class itemlist implements itemlistinterface{ private static string inputline; private static arraylist<string> wordarray; public static void main(string[] args) throws exception { url wordlist = new url("http://dl.dropbox.com/u/18678304/2011/bsc2/phrases.txt"); bufferedreader in = new bufferedreader( new inputstreamreader( wordlist.openstream())); while ((inputline = in.readline()) != null){ system.out.println(inputline); wordarray.add(inputline); } in.close(); } } you forget instantiate arraylist<string> .

Automate Chrome To Phone/ Android Intent C2DM feature in windows application -

i have android mobile. have application running on laptop. windows application. have chrome installed in laptop chrome phone extension installed. when open link in browser , click on extension android intent or notification mobile. want automate this. i mean windows application written in .net must able operation me. mean on validations done need notification or kind of intent mobile. if has dome manually, application give message box alert. see alert message open chrome (or opened) , open link "www.google.com" , click on "chrome phone" extension. want done automatically. possible? if how? please let me know if there other ideas or tweaks can done achieve similar operation. trying alert windows application android mobile. kind of appreciated. thanks. the way chrome phone works through mid tier provider. in case appengine. if analyse source code, thing extension post service (http://chrometophone.appspot.com/_ah/channel/jsapi). if want imitate same...

c++ - a const member function, returning a pointer to a non const member variable, why would it be good? -

i work in large collaboration (of non-professional programmers, being 1 of them). regularly see examples of following void t::dochanges(i i); // make changes internal structure of t (non-const) v t::getvalue(); class { private: t* fmember; public: a(); t* getmember() const {return fmember;} } , use-case be a a; i; a->getmember()->dochanges(i); v v = a->getmember()->getvalue(); this practice violates tenant drilled me when took programming courses, i.e. const refers not bitwise structure of class instance, internal logical structure. under philosophy, member function should take following forms: t* getmember() {return fmember;} const t* getmember() const {return fmember;} i have heard people think const should refer members, speaking strictly using c++ terminology. how/why argue type of practice? making member function gives indication users of function not modify any class members. returned member may or maynot const making member functi...

javascript - touchend event in ios webkit not firing? -

i'm trying implement menu ios webkit based app in user touches/clicks , holds menu button ('.menu_item'), after 500ms sub menu opens (div.slide_up_sub_menu), , user should able slide finger/mouse submenu li item , release. <li class="menu_item"> asset management <div class="slide_up_sub_menu hidden_menu"> <ul class="submenu"> <li>unified naming convention</li> <li>version control</li> </ul> </div> </li> the application should able detect submenu item touchend/mouseup event happened on. i'm binding touchstart event menu item, waiting 500ms, , afterwards telling submenu show. when user releases finger touchend event should fire closing submenu. if user has stopped touch on submenu item should detected. detection of submenu item mouseup event happened on works in safari on desktop: $('ul.submenu li'...

Counting the number of elements in matlab -

i new matlab. suppose have vector x = [1 1 1 1 1 1 0 0 1 0]. want calculate total number of elements in vector , number of non 0 elements in vector. come ratio of both numbers. searching in matlab help. how count of elements, till didn't luck. if provide me help, of great help. in advance. you can number of elements numel(x) . you can number of non-zeros sum(x ~= 0) . so ratio 1 divided other.

regex - mod_rewrite problem with relative path css/js -

hi have problem. want requests redirect index file in main directory , i've achieved there problems relative paths. when put address like: mydomain.com/something works ok paths relative main directory. the problem when put like: mydomain.com/something/somethingelse. the .htaccess file: options followsymlinks rewriteengine on # ignore that's actual file rewritecond %{document_root}%{request_uri} !-f # redirect other traffic index page rewriterule . index.php [l] any ideas on how css/js working? edit: the problem css/js files aren't loaded when path entered have multiple slashes like:mydomain.com/something/somethingelse it no doubt better use absolute path static files (css, js, images etc). if lots of instances in several pages consider using html base tag specify default url relative paths. eg: <base href="http://www.example.com/static/" />

ios - Asked to develop an iphone app that uses GPS navigation - realistic expectations? -

i'm quite new iphone development, , been asked @ work feasibility of app involve plotting custom routes on google maps (i can manage though web page), , app show users selection of routes can navigate using gps-style (turn turn) navigation screen. the routes have markers trigger specific information, such landmarks, etc. again, can have these configured through google maps on webpage. the question how approach sort of app? start scratch or build on existing platform? tips appreciated, i'm @ loss start. you can use mapkit official google maps api iphone map , routes, can't make turn-by-turn software api (license terms). the app, want it, not feasible.

Android system preferences reading -

how can read system settings (settings title, summary, value title: "display brightness", summary "tune display brightness tuning", value = 230) system preference tree (if exist)? or have create own preferences tree own summary , titles , read system value in method settings.system.getint(getcontentresolver(), settings.system.screen_brightness)? the display names , descriptions of settings, used settings application, not part of android sdk.

java - Construct Public Key from Big Integers? -

i construct public key constructed using c# xml rsakeys, reconstruct using java, problem receive m & e key bytes values, , construct key i've use 2 bigintegers, how construct public key ? edit: problem mod, exp byte arrays base64 decoded, m,n of public key... byte[] mod = base64.decodebase64(modulus.getbytes()); byte[] exp = base64.decodebase64(exponent.getbytes()); int[] copymod = new int[mod.length]; (int x = 0; x < mod.length; x++) { copymod[x] = unsignedtobytes((byte) mod[x]); } int[] copyexp = new int[exp.length]; (int x = 0; x < exp.length; x++) { copyexp[x] = unsignedtobytes((byte) exp[x]); } string mod = arrays.tostring(copymod); string exp = arrays.tostring(copyexp); biginteger m = new biginteger(mod.getbytes()); biginteger e = new biginteger(exp.getbytes()); java.security.spec.rsapublickeyspec spec = new java.security.spec.rsapublickeyspec(m, e); keyfactory keyfacto...

Help to change mysql.sock -

i have installed mysql through binary installation , followed below steps http://dev.mysql.com/doc/refman/5.0/en/binary-installation.html right sock files craeted on /tmp/mysql.sock when mysql service started. i want know configuration files need edited change path of mysql.sock i tried following steps change mysql.sock path /tmp/mysql.sock /var/lib/mysql/mysql.sock 1.i tried enter socketpath in /etc/my.cnf socket =/var/lib/mysql/mysql.sock 2./etc/init.d/mysql basedir=/var/lib/mysql datadir=/var/lib/mysql/data socket=/var/lib/mysql/mysql.sock can me fix issue. setting these variables in my.cnf should work fine (tested locally, ubuntu 10.10). [mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock just make sure you're restarting mysql service? below did, on fedora (since you're using rhel should more mimic setup): [root@rudi /]# ls /var/lib/mysql/ ibdata1 ib_logfile0 ib_logfile1 mysql mysql.sock [root@rudi /]# ls /var/run/mysqld/...

IOS PHP communication -

i need send data phone server. don't need encrypt them.i need sure data comes app , not refreshing browser. how can this. please give me ideas. if want authentication, best way sign data private key on app , verify signature public key on server.

php - Store values between multiple post back from user -

the idea of code make user choose flight decrease(-1) flight seats of flight chooses. when user change flight decrease new flight(-1) seats , increase previous flight seats since user changed flight. but don't know how hold previous flight id, actually tried failed,anyway.. how store previous flight id? because variable gets reset every time page gets reloaded clicking submit button (this happened, because have initiate flight id holder variable every time open page). is holding possible?... here did try , use sessions: $flight_id = '';//empty $_session['prev_flight_id'] = $flight_id; // initiate session echo $_session['prev_flight_id']; // make sure there's here // result nothing(empty) important note: set value of $flight_id // later in script i tried : session_start(); // bunch of code (i didn't create $flight_id yet) : // submiting old flight id in session (i error here) $_session['prev_flight_id...

java - Using Eclipse Helios for Web Project -

i need build web project using eclipse helois (3.6). found tutorial on web on schoolproject. please post information other tutorials available on web? these examples: http://www.ibm.com/developerworks/opensource/library/os-eclipse-helios/index.html http://www.vogella.de/articles/eclipsewtp/article.html http://www.michael-thomas.com/tech/apache/tomcat/tutorial_tomcat_eclipse/index.htm hope these helps.

jquery - How to have a css element with transitions except initially? -

if have css style following: .transition { transition: left linear .4s; -moz-transition: left linear .4s; -o-transition: left linear .4s; -webkit-transition: left linear .4s; } and following html: <div id="mydiv">test</div> and following jquery: $(function () { $('#mydiv').css('left', '50px'); $('#mydiv').addclass('transition'); }); then there still transition 0px 50px when page loads, despite fact transition class not added mydiv until after css left property set in jquery. i able set initial css left property of mydiv when page loads (it calculated based on various parameters) , not animated, yet still have transition property set after initial page load (moving mydiv after page loads should animated). how can accomplish this? you apply position on dom ready, , transition on page load. try out this fiddle . $(function () { $('#mydiv').css('left', ...

Javascript / JQuery memory useage within browser -

my google-fu has let me down bit on this. can answer question me? to extent jquery / javascript functions stored in memory? once browser has parsed page goes memory? of it? if functions repeatedly called memory? if portion of memory allocated scripts filled (thinking ie6 on horrible pc here), happens? (other slow browser..) is there way of seeing how memory used variable or function whole? i'm curious, i've never had problems slow scripts per se, sat there thinking afternoon , realised didn't know this! h as per knowledge, once javascript code has been parsed browser, objects remain in memory unless dereferenced , garbage collected. garbage collection dependent on js implementation of browser though. you can see memory usage js objects in chrome. see here

.net - Is there a multi-directory DirectoryCatalog available in MEF or open source? -

i'd separate extensions own subdirectory of extensions directory. can specify multiple directorycatalog of course , put them aggregatecatalog . have go scan directory , create those. not big deal, there multidirectorycatalog out there? nope best able aggregatecatalog multiple directorycatalogs. @ least ships in .net framework itself.

iis 7 - IIS7: Separate IP Addresses Vs Same IP Address with Separate Ports -

i setting multiple sites on iis7. what pros , cons of: setting sites on same ip address different ports versus setting sites on different ip addresses. also,what implications ssl certificates(any other aspects may know of) between above 2 approaches? first, each site uses ssl, must bound ip address. ssl sites can segmented ip (and port) , cannot segmented host name. the implication segmenting host if given site goes down (literally stopped) , if there site listening on ip, "choose" site. so, effect user goes site , sees stuff site b. if sites segment on host, isn't problem. for public sites assume 80 , 443 http , https, can segment on ip or host. users not expecting navigate on different port , need open special ports on hosting system's firewall allow requests on ports.

.net - What are best practices for using IntPtr vs. void* in C++/CLI? -

i'm using passing native pointers between assemblies. it's unfortunate strong typing goes out window in context. or @ least, haven't figured out how cross-assembly access c++/cli method returns pointer native udt. assuming i'm right either intptr or void* necessary here, should use? always prefer cls-compliant route, in case intptr . not .net languages know void* is, know intptr is. regarding cross-assembly use of native udts, see #pragma make_public .

markup - ASP.NET server tag with colon? -

i searched around, not find reasonable explanation. i found <%: tag in 1 of projects. works <%= tag. i not find description on tag found <%: , <%= same. so question popped out, why there 2 different tags same functionality? think there should difference. could please clarify me. thank you according this blog post new feature introduced in asp.net 4. used automatically html encode output. i suggest read full blog post, see how works ;)

c# - How to access a global variable from a WebMethod? -

i have following global variable: private arraylist listselectedunavailables { { return (arraylist)viewstate["listselectedunavailables"]; } set { viewstate["listselectedunavailables"] = value; } } i can work in every single procedure of webform. however, need use in webmethod have in same webform, seems not identify of global variables. so: how can access global variable webmethod? a viewstate property depends on having page (.aspx) post view state, that's "variable" stored. webmethod not include full page postback (if post @ all) , there no view state read from. instead may want use session variable like: private arraylist listselectedunavailables { { return (arraylist)session["listselectedunavailables"]; } set { session["listselectedunavailables"] = value...

iphone - Cocos2D: Subclassing sprite and animation as CCLayer is giving me trouble -

i started experimenting cocos2d tiled, , had player sprite , actions coded within cclayer along else. before continuing on, wanted subclass player cclayer, hope correct. my header , main code follows: heroclass.h #import <foundation/foundation.h> #import "cocos2d.h" @interface heroclass : cclayer { ccsprite *_hero; ccaction *_herospriteflyaction; } @property(nonatomic, retain) ccsprite *hero; @property(nonatomic, retain) ccaction *herospriteflyaction; @end heroclass.m #import "heroclass.h" @implementation heroclass @synthesize hero =_hero; @synthesize herospriteflyaction = _herospriteflyaction; -(id) init{ self = [super init]; if (!self) { return nil; } [[ccspriteframecache sharedspriteframecache] addspriteframeswithfile:@"herotestsheet.plist"]; ccspritebatchnode *herospritesheet = [ccspritebatchnode batchnodewithfile:@"herotestsheet.png"]; [self addchild:herospritesheet]; ...

Implement Java Iterator and Iterable in same class? -

i trying understand java iterator , iterable interfaces i writing class class myclass implements iterable<string> { public string[] = null; public myclass(string[] arr) { = arr; } public myclassiterator iterator() { return new myclassiterator(this); } public class myclassiterator implements iterator<string> { private myclass myclass = null; private int count = 0; public myclassiterator(myclass m) { myclass = m; } public boolean hasnext() { return count < myclass.a.length; } public string next() { int t = count; count++; return myclass.a[t]; } public void remove() { throw new unsupportedoperationexception(); } } } it seems working. should have: myclass implements iterable<stirng>, iterator<string> { } or should put myclassiterator ou...

iphone - Creating custom menu at top like Real Simple Recipes does -

i want create tabbar controller placed @ top real simple recipes in ipad has done. suspect not uitabbarcontroller have tried many ways place tab bar on top setting view frame self.tabbarcontroller.tabbar.view.frame = cgrectmake (0,0,768,self.tabbarcontroller.tabbar.view.frame.height); not working. is custom tabbar controller created or managed manually ? sample code or direction appriciated. you want make custom view switcher of own. this blog post has nice tutorial doing so. uses segmented control switching, adapt use row of buttons if needed custom look. (if ok requiring ios 5, gets easier view controller containment apis, , it'd different implementation 1 suggested in article.)

android - Cannot get scroll working -

i trying make screen fits great on vertical orientation scroll horizontal not fit , not scroll. added scroll view single child of linear layout , views want inside that. no errors still not scroll when turn phone horizontal orientation. doing wrong? below xml thanks <textview android:text="test app" android:textsize="20dp" android:layout_gravity="center_horizontal" android:textcolor="#fcfcfc" android:id="@+id/textview1" android:layout_width="wrap_content" android:layout_height="wrap_content" ></textview> <textview android:text="" android:textsize="20dp" android:layout_gravity="center_horizontal" android:textcolor="#fcfcfc" android:id="@+id/textview3" android:layout_width="wrap_content" android:layout_height="wrap_content" ></textview> <scrollview android:layout_width="match_parent" andro...

objective c - Putting comma between each word in NSString -

i have nsstring @"nice car" , create nsstring @"nice,car". there way this? you use nsstring stringbyreplacingoccurrencesofstring:withstring: method achieve follows: nsstring *stringwithspaces = @"nice car"; nsstring *stringwithcommas = [stringwithspaces stringbyreplacingoccurrencesofstring:@" " withstring:@","];

c - gSoap generated client-side structure initialization and use -

Image
gsoap generated client-side structure initialization , use (using ansi c bindings) first of all, searched , although there number of struct initialization solutions offered, did not find directly answering issue. also, question being posted assist else has similar question, i have worked out solution , because of newbie status post immediately at least 8 hours after posting this. however, still interested in comments , edits solution offer better solutions, or more experience in gsoap... the scenario: new soap in general, , have been using gsoap generated client source code build ansi c bindings access web services. arguments 4 & 5 of "soap_call__" functions provided application interfaces (defined within soapclient.c) many times complex (nested) structures. argument 4 specifically, because it input structure, has declared, initialized, allocated , freed within calling application. for example, given following gsoap generated prototype: soap_fmac5 in...

On publishing infopath 2010 form loses control properties - dropdown control data binding setting -

i try created cascade dropdown using infopath 2010 in sharepoint 2010 list. on publishing infopath form lost data binding setting , resets default "enter choices manually". works if dont publish (preview mode). recreated infopath form many times of no use. works on other site not on want to. [note: dropdown lookup columns] check form settings @ dropdown box properties > browser forms > post settings, make sure set always.

java - JUnit4 run all tests in a specific package using a testsuite -

is possible in junit4? in junit3, following: public class mytestsuite { public static test suite() throws exception { dobeforeactions(); try { testsuite testsuite = new testsuite(); for(class clazz : getallclassesinpackage("com.mypackage")){ testsuite.addtestsuite(clazz); } return testsuite; } { doafteractions } } ... } the takari-cpsuite (originally developed johannes link ) offers classpath-suite should fit needs. allows filtering of classes in classpath regular expressions like: import org.junit.extensions.cpsuite.classpathsuite.*; ... @classnamefilters({"mytests.*", ".*test"}) public class mysuite...

Inline block doesn't work in internet explorer 7, 6 -

i have css code inline-block . can tell me how make work in internet explorer 6 , 7. ideas? maybe i'm doing wrong? thank you! #signup { color:#fff; border-bottom:solid 1px #444; text-transform:uppercase; text-align:center; } #signup #left { display: inline-block } #signup #right { background-image:url(images/signup.jpg); border-left: solid 1px #000; border-right: solid 1px #000; display: inline-block; padding:1% 2% width:16%; } #signup #right { font-size:100%; font-weight:bold } #signup #right p { font-size:90%; font-weight:bold } #signup a:hover { color:#fff; text-decoration:underline } in ie6/ie7, display: inline-block works on elements naturally inline (such span s). to make work on other elements such div s, need this: #yourelement { display: inline-block; *display: inline; zoom: 1; } *display: inline uses "safe" css hack apply only ie7 , lower . for ie6/7, zoom: 1 provides haslayout . having ...

javascript - Deserialize big data JSON from a REST request into objects without locking up the browser? -

in rich internet app: user requests resource server responds huge json response client (running in browser) must process json converting many objects make application state. step 3 intensive , can cause browser lock. thinking using web workers think may not suited task. as understand workers, pass messages purely text or json. while possible web worker accept message ("please fetch resource @ url") worker retrieve large json response , deserialize many objects making app state, there no way pass objects (instances of various classes) main process via message passing construct. right? or missing something? how 1 allow in-browser client deserialize big data objects without compromising user experience (locking browser)? if web workers out, leave using timers (for timeslicing)? how javascript slowing down web (and it)

javascript - How to get which div/ui.helper clicked in drag event jqueryui/jquery? -

on jquery ui's site: http://jqueryui.com/demos/draggable/ if have: <div id="someid" class="someclass">he</div> <div id="otherid" class="otherclass">he2</div> and: $('#someid','#otherid').draggable({ drag: function(event, ui) { alert(ui.helper.theidoftheclickeditem); // goes here? } }); how id or class of id using "ui" variable callback? if not possible, how "event" variable? you want: $("#someid, #otherid").draggable({ drag: function(event, ui) { console.log(ui.helper[0].id); } }); (or use ui.helper.attr("id") ) note : ui.helper jquery object, why must either use .attr("...") retrieve id or access matched element @ index 0 , directly id. or without using ui argument (probably i'd recommend): $("#someid, #otherid").draggable({ drag: function(event, ui) { conso...

jquery - How can I output a helper from erb.js in rails 3? -

this have in erb.js file....but doesn't work: 1 //update message 2 $('#follow-update').html("<%= follow_button(@question) %>") follow_button helper: 20 def follow_button(resource) 21 22 type = resource.class.name 23 follow_status = current_user.following?(resource) 24 25 verb = "follow" if follow_status == false 26 verb = "unfollow" if follow_status == true 27 28 content_tag(:div, :class => "follow-button") 29 link_to "#{verb} #{type} ", follow_path(:followed_type => type, 30 :followed_id => resource.id, 31 :follow_verb => verb), 32 :class => "button", 33 :remote => true 34 end 35 end 36 end the helper stand-alone works fi...

jquery - Asp.net Obout grid, how can i post data without page refresh, using its built in function? -

i using obout grid in asp, how can use ajax filter grid i mean have these fields above grid name [......] date [......] date to[.......] year [......] submit button now dont want page refreshing, filter it, if click on submit button, grid should refresh , filter according critera, obout provide such functionality use component jquery or ajax? thanks atif yes, can achieve ajax. you have put gridview in update panel , add asynchronous post trigger click button. like... <asp:updatepanel runat="server" id="upnl" updatemode="conditional" childtrigger="true"> <contenttemplate> <asp:gridview></asp:gridview> </contenttemplate> <triggers> <asp:asyncpostbacktrigger controlid="btnsubmit" eventname="click" /> </triggers> </asp:updatepanel>

creating a dotnetnuke package with easy to install sql database -

i new dotnetnuke , asp.net altogether. need create module package easy install on different dnn site. problem sql tables , other database objects need added manually. them added automatically when package deployed. said new , step step explanation helpful. thanks, jelena this handled sqldataprovider files. note, when create dotnetnuke compiled module project in vs2010 (or vs2008), end 3 such files, 2 of of concern here (i think) 01.00.00.sqldataprovider executed upon module installation uninstall.sqldataprovider run upon uninstallation note in dnn manifest file, there entries pointing these sqqdataprovider files: <file> <name>01.00.00.sqldataprovider</name> </file> <file> <name>uninstall.sqldataprovider</name> </file> also note, in manifest file, version number corresponds prefix on installer sql file: <version>01.00.00</version> finally, package dnn module .zi...

oop - usage of multiple properties in php -

i trying learn oop in php, below code not working provide alternate answer? <?php class abc { public $a = 1; $b = $a; function foo(){ //some function.. } } ?> i want assign value of variable "a" variable "b". you can assign value of $a $b so: $this->b = $this->a within __construct method gets called upon object creation , assuming you're running php 5.

java - Netbeans: How to alter naming pattern used to identify testSuites -

i have numerous junit testsuites have "tests" suffix. eclipse recognises static suite() method , makes run test option available in package explorer. same not true netbeans gives me default run context menu option. noticed recognize class uses "testsuite" suffix tests suite. new nb 7.0 , unable find out how alter pattern or how make nb work in same way eclipse. ok, actually, figured out, while digging around trying solve own problem. vanilla netbeans uses ant, question ant question. if in project's directory, see there build.xml file. primary file instructs ant do. if inside file, see it's primary function <import /> nbproject/build-impl.xml file. so, need in here. can use file override functionality of default implementation. if dig down build-impl.xml file, you'll come upon junit section. section: <target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run"> <j2s...

c# - Two-way binding an ObservableCollection<string> to WPF DataGrid -

i've been tying different things / reading on issue awhile , have not yet found answer. guys can help. i have observablecollection of type string. want bind collection datagrid , able edit/delete/add collection. here xaml: <datagrid itemssource="{binding movies.titles}" canuserdeleterows="true" canuseraddrows="true" height="300"> <datagrid.columns> <datagridtextcolumn binding="{binding path=datacontext, relativesource={relativesource self}}"/> </datagrid.columns> </datagrid> the same observablecollection bound listbox. want able edit collection using datagrid method (above) , see changes/edits in listbox. delete/add working correctly, when edit string inside grid cell , loses focus, string goes , never gets updated. thanks lot / suggestions. wow, went yesterday , stuck datagrid add new line observablecollection. after research, realized why. strings , immutable. i...

oracle - ERROR java.sql.SQLException: ORA-01722: invalid number while running a Prepared Statement to alter a Sequence -

sqlstmt = new stringbuffer(" alter sequence " ); sqlstmt.append( servercontext.getschemaname() ); sqlstmt.append("seq_edcd_trace_num"); sqlstmt.append( " increment " ); sqlstmt.append( " ? " ); pstmt.setlong(1, incval); pstmt.execute(); you can't use bind variables ddl, such alter sequence . you'll have concatenate incval onto string. there shouldn't risk of sql injection if incval int or long .

c# - wpf bing map application with heat map? -

i trying integrate bing map heat map feature wpf desktop application, there api this? searched microsoft website , can found api developing map apps, think different want... idea should start?? update: think microsoft provide bing api silverlight, , found 1 wpf, dont know how generate heat map on this... can point me somewhere? http://www.codeproject.com/kb/ip/bingmapswebserviceexample.aspx maybe 3rd party component telerik useful? if can afford it, save lot of time. http://www.telerik.com/products/wpf/map.aspx it uses bing maps , supports heat maps.

asp.net - How to preview an array of bytes which represents a file content in client browser? -

we in need interact document management systems saves file (mostly pdf & doc & docx) array of bytes , saves file extension. so, need build file viewer display files in client's browser. think of converting doc files pdf , preview converted file in browser, others think of converting array of bytes html (this solution big question don't know how , if available or not) , transfer rendered html. don't think these solutions best , cross browser solutions. so, there way such functionality? must cross browser solution? the first question have answer whether users need able edit documents. if so, best "viewer" going word , adobe client apps. please note in case, need give users ability upload (and possibly check-in) edited documents. if users need read access, can show them image or pdf of file in browser. if go pdf route, save money using adobe reader, "clunkier" user experience. if want give users read-only view, need "rende...

why does this cookie set in PHP keep returning null? -

i trying set cookie variables token variables received twitter , realizing keep getting null variable objects not null...even explicitly defined strings. here specific code section working though var_dump($token->oauth_token); var_dump($token->oauth_token_secret); // these not null // attempt save cookies setcookie('oauth_token', $token->oauth_token); setcookie('oauth_token_secret', $token->oauth_token_secret); var_dump($_cookie['oauth_token']); //these cookie variables null...holds true //simple strings...not complex twitter objects im working with...happens on chrome //and ie all appreciated! see http://www.php.net/setcookie (emphasis mine): once cookies have been set, can accessed on next page load $_cookie or $http_cookie_vars arrays.

Can I develop Custom Camera in android ? -

i want open camera in own design , i don't want use inbuilt camera in android. feasible? yes, it's possible use camera in own apps: http://developer.android.com/reference/android/hardware/camera.html

command line interface - OSX installer change install directory -

i got pkg file in can change installation directory when launched using ui, manpage of installer mention target drive install to. is there environement variable set when calling installer ? about target options, installer : the -target <device> parameter 1 of following: (1) 1 of domains returned -dominfo. (2) device node entry. entry of form of /dev/disk*. ex: /dev/disk2 (3) disk identifier. entry of form of disk*. ex: disk1s9 (4) volume mount point. entry of form of /volumes/mountpoint. ex: /volumes/untitled (5) volume uuid. ex: 376c4046-083e-334f-af08-62fafbc4e352 so target "hard drive", not "root path" pkg should installed. your question quite unclear: if run installer gui , there 1 drive offered install to, can not change in easy way (means: have make changes installer package install in different location offered default). since using "cli"-tag (command line interface), think trying run installer not on ...

iphone - How to stop the Observer in NSNotification to called twice? -

i have observer of nsnotification called twice. not know it. i googled no solution found. [[nsnotificationcenter defaultcenter] addobserver:self selector:@selector(connectedtoserver:) name:@"connectedtoserver" object:nil]; - (void)connectedtoserver:(nsnotification*)notification { [[nsnotificationcenter defaultcenter] postnotificationname:@"sendmessagetoserver" object:message]; } solution 1: first thing check if notification posted twice. solution 2: if notification posted once, action called many times you've added observer notification (no matter notification same or not). example, following 2 lines register observer( self ) same notification( aselector ) twice. [[nsnotificationcenter defaultcenter] addobserver:self selector:aselector name:aname object:nil]; [[nsnotificationcenter defaultcenter] addobserver:self selector:aselector name:aname object:nil]; you have find adding observer second time, , remove it. , make sure co...

Facebook: Stream publish popup throwing error when 'next' is null -

i trying post fb feed application through js sdk. if fail set next property null keep on getting “error occurred message”. can help? var obj = { method: 'feed', link: link, picture: link, name: name, caption: caption, description: description, redirect_uri: "http://www.google.com/", next:null, app_id: facebookappid, actions: [ { name: action_text, link: action_link } ] i need set next redirect. remove next field, it's not supported. if need set "next" link use redirect_uri field.

eclipse - Android - Explore my Application Data -

i'm developing android application eclipse ide. i'd view application's data (saved in internal storage described here ). "file explorer" in eclipse doesn't open "data" folder "file explorer" in eclipse doesn't open "data" folder that true on hardware. cannot view application's data via file explorer. one workaround add backup-and-restore feature app copies application's data external storage on demand (e.g., options menu item). not able use examine data, users benefit well.

java - Menu Handler for the activities -

Image
please me out regarding menu handler . want make menu handler can call in different activities . things working fine . list fetching server , menu appearing when click on menu button "force close" pops . here meun handler class package com.droidnova.android.howto.optionmenu; import android.app.activity; import android.content.intent; import android.view.menu; import android.view.menuinflater; import android.view.menuitem; import android.content.intent; public class menuhandler extends activity{ private activity activity; public menuhandler(activity activity) { this.activity = activity; } public boolean oncreateoptionsmenu(menu menu) { menuinflater inflater = activity.getmenuinflater(); inflater.inflate(r.menu.menu, menu); return true; } public boolean onoptionsitemselected(menuitem item) { switch (item.getitemid()) { case r.id.settings: intent intent = new intent(this...