Posts

Showing posts from August, 2013

c# - value cannot be null in wcf using xml -

i'm triyng converto string xml when code running "value cannot null" how cani fix ? project run in windows phone 8 public string baslıkbul(baslıkı ba) { sqlconnection bag = new sqlconnection(configurationmanager.connectionstrings["baglantı"].connectionstring.tostring()); bag.open(); sqlcommand yap = new sqlcommand("select baslık ad=@ad",bag); yap.parameters.addwithvalue("@ad", ba.ad); yap.executenonquery(); sqldataadapter da = new sqldataadapter(yap); dataset ds = new dataset(); da.fill(ds); string s = ds.getxml(); /// line running xmlreader okuyucu = xmlreader.create(new stringreader(s)); while(okuyucu.read()) { if(okuyucu.nodetype==xmlnodetype.element) { switch(okuyucu.name) { case"baslık": s = convert.tostring(okuyucu.readstri

How can I use R to remove a file extension that is not alphanumeric extension -

this example of file name mod09a1.a2000049.h19v11.005.2006268194400.hdf.sur_refl_day_of_year initially mod09a1.a2000049.h19v11.005.2006268194400.hdf.sur_refl_day_of_year.tif i used function file_path_sans_ext remove ".tiff" still want remove ".sur_refl_day_of_year". need file name mod09a1.a2000049.h19v11.005.2006268194400.hdf only. try: sub("(\\.hdf).*", "\\1", myfilename)

c - Return result less than 2seconds -

i have exercise tells me calculate square root, program returns result in 6 seconds, how can return square root in less 2 seconds? this implementation 1 /* ************************************************************************** */ 2 /* */ 3 /* ::: :::::::: */ 4 /* ft_sqrt.c :+: :+: :+: */ 5 /* +:+ +:+ +:+ */ 6 /* by: wjean-ma <wjean-ma@student.42.fr> +#+ +:+ +#+ */ 7 /* +#+#+#+#+#+ +#+ */ 8 /* created: 2015/07/13 13:28:12 wjean-ma #+# #+# */ 9 /* updated: 2015/07/14 16:48:21 wjean-ma ### ########.fr */ 10 /*

c++ - GetOpenFileName API intermittently slow on 2003 server -

when running code below on windows server 2003, there intermittent slowdowns while getopenfilename common dialog initializes. startup time varies @ around ~30 seconds. code below scratch program made exemplify problem i'm having in larger project problem exists in both. one important note, when network interfaces disabled, time taken initialize closer normal - typically ~2 seconds. enabled again, problem returns. i have put initialization time against other programs file open common dialogs (like notepad) not have same problem, or without network interfaces enabled. code: getnewfilename.h: #define _twinmain wwinmain #include "windows.h" #include <string> #include "resource.h" using std::wstring; #define isolation_aware_enabled 1 #if defined _m_ix86 #pragma comment(linker,"/manifestdependency:\"type='win32' name='microsoft.windows.common-controls' version='6.0.0.0' processorarchitecture='x86' public

javascript - using hta with frameset - drop image does not work -

i working framesets in local hta (html-application) in internet explorer 10+. want drop files (images) dropzone (div or body). - hta without frames works - htm , without frames works (all browsers) - hta frames show image in frame index.hta: <frameset cols="40%,60%" > <frame src="start1.htm" name="start1" application="yes" > <frame src="start2.htm" name="start2" application="yes" > </frameset> start1.htm <html> <body ondragstart="return false;"> <div id="dropspot" style="border: 1px dashed #555; height: 200px"> </div> function init() { // set drop-event handlers. var droparea = document.getelementbyid("dropspot"); droparea.addeventlistener("drop", drophandler, false); droparea.addeventlistener("dragover", donothing, false); } function drophandler(event) { // use our donothing() func

python 3.x - Python3 tk TreeView dynamic column width -

relevant code below. looking way dynamically size ttk treeview widget's column fit text inside it. have treeview (within class) minwidths on columns, text fill "notes" column infinitely long , column needs resize take string. limit max size needless still want dynamic hold large string of text if needed neat when string shorter. there 2 solutions really, either dynamic sizing or calculating pixel width required given string, font.measure() mentioned doesn't seem applicable python 3.x any great, i'd tiny thing sorted can finish up! sql.connect(dbfile) dbconnection: cursor = dbconnection.cursor() self.treestudentlog = ttk.treeview(self.mainframe, columns=("type","points", "notes"), height=21) yscrollbar = ttk.scrollbar(self.mainframe, orient='vertical', command=self.treestudentlog.yview) xscrollbar = ttk.scrollbar(self.mainframe, orient='horizontal', command=self.treestudentlog

angularjs - Injecting $state (ui-router) causes circular dependency -

when put $state there error...how can fix it? i want use $state navigate page dont know how ? suggestion ? there other way navigate user page ? app.factory('mainauthinterceptorservice', ['$q','$state', '$injector', '$location', 'localstorageservice', function ($q,$state, $injector, $location, localstorageservice) {....} im using authservice.logout(); and need redirect user page ... one simple fix use $injector service reference $state service, so: app.factory('mainauthinterceptorservice', ['$q', '$injector', '$location', 'localstorageservice', function($q, $injector, $location, localstorageservice) { var $state = $injector.get('$state'); // inject state manually ... // interceptor logic } you can use $state object usual. there similar question created user great answer explains issue in depth: injecting $state (ui-router) $htt

codeigniter - Unexpected AUTO_INCREMENT behaviour -

we have server running php 5.6.7, mariadb 10.0.17-mariadb. have codeigniter application, in have 2 tables: point_trigger , trigger_filter , connected point_trigger_id , one-to-many. both have id column set integer auto_increment (so no composite keys). heppened: a client removed 1 of point_trigger s web interface. sa called controller removed row point_trigger , row (just 1 in case) trigger_filter . call logged, ends /delete/235 , meaning point_trigger_id used locate rows deleted set 235 . far good. couple of days later client goes web interface again , adds new point_trigger . client calls because point trigger created behaves unexpectedly. we check database, and... point_trigger table not have gap in ids, meaning point_trigger user created has the same id 235 . check associated trigger_filter table , 1 doesn't have gap , autoincremented id table next one. what know (or think know) both delete , add went ok in terms of removing rows. think because point_tr

ios - Worklight 6.1 swift 1.2 support -

i working on project has built , deployed adapters on worklight 6.1 server , have develop app use these adapters using latest version of swift. i'm trying add native api project , connect server native app alwas error when call wlcliend.wlconnectwithdelegate(self): > 2015-07-14 17:35:58.782 iosnativeapi[46479:353823] [error] > [worklight]: cannot find cookies.mom file 2015-07-14 17:35:58.789 > iosnativeapi[46479:353823] *** terminating app due uncaught > exception 'nsinvalidargumentexception', reason: 'cannot create > nspersistentstorecoordinator nil model' > *** first throw call stack: my question have project in swift , server in 6.1? because 6.1 server didn't generate bridging header file, had wirte on own. so worklight server 6.1 works swift 1.2? if yes causing error? edit: here bridging header file: (i took file generated using 7.0 version , hint files weren't found) /* * licensed materials - property of ibm * 5725-i4

xsd - XML Schema to enforce valid array indexes? -

i have xml file in mock similar array, array name being application, , each element being applicationstring, each containing "index" attribute: <con:config> <con:application con:index="0"> <con:applicationstring>gc1</con:applicationstring> </con:application> <con:application con:index="1"> <con:applicationstring>gc2</con:applicationstring> </con:application> <con:application con:index="2"> <con:applicationstring>gc3</con:applicationstring> </con:application> <con:application con:index="3"> <con:applicationstring>gc5</con:applicationstring> </con:application> </con:config> i wish write xml schema verify "index" attributes indeed valid indexes ranging 0-n , including no duplicates or missing indexes. there known way enforce this? schema have far.

iis 7.5 - How to configure DNS 'mask' name to cover ip and app name -

i have deployed app in virtual application folder on iis. when access is ip/app name 192.168.0.1/myapp/.... is there way mask single name example if entered myappdev/ , run direct that? no knwolage of iis or dns dummies guide great thanks link previous post explain various options. more info iis bindings hope helps.

python - Search in DBF and update record -

code: #!/usr/bin/python db = dbf.dbf("mest2.dbf") #line update: rec = db[0] #proest field of dbf. i'm assigning 1 field line 0 rec["proest"] = 1 rec.store() del rec db.close() image of dbf table: http://i.stack.imgur.com/1uhe1.jpg my problem can not change records rows, cause position of products (procod) may vary. any suggestions procod , change value of proest? updated: #!/usr/bin/python import dbf db = dbf.table('mest2.dbf') db: procod_idx = db.create_index(lambda rec: (rec.codigo, rec.procod)) match = procod_idx.search(match='000001') # should 1 product code record = match[0] record: record.proest = 23 but question is, how edit value based on codigo field (stock code). have multiples stocks id: (1, 2, 5, 11). code update first result, need update specific record based in codigo field. in sql be: "update proest set 32 codigo=11"... or codigo=2 solved ethan furman #!/usr/bin/py

objective c - iOS, Keep track of uploading and downloading files in poped views -

i working on chat application on ios, has uploading/downloading requirement whatsapp upload/download, , i'm using somessage library. but, if want upload image , popped view, upload cancelled, , managed upload/download in singleton class. now, upload performed, cannot keep track of ui changes when enter view again. any recommendation ?? thanks in singleton can keep track of progress of transfers , when view entered again can open check see if there current transfer , show it's progress. i have controller 1 of our apps handles uploading , downloading , keeps track of progress per item until queue finished. can clear queue upon completion or reference queue historical list of files sent/ received

eclipse - Can't start war application on tomcat running on Linux server -

i can't start application on tomcat 7. i've deployed on tomcat , doesn't work (on linux server) can run eclipse on windows. here error: jul 12, 2015 2:48:16 pm org.apache.catalina.core.containerbase addchildinternal severe: containerbase.addchild: start: org.apache.catalina.lifecycleexception: failed start component [standardengine[catalina].standardhost[localhost].standardcontext[]] @ org.apache.catalina.util.lifecyclebase.start(lifecyclebase.java:154) @ org.apache.catalina.core.containerbase.addchildinternal(containerbase.java:901) @ org.apache.catalina.core.containerbase.addchild(containerbase.java:877) @ org.apache.catalina.core.standardhost.addchild(standardhost.java:649) @ org.apache.catalina.startup.hostconfig.deploydescriptor(hostconfig.java:672) @ org.apache.catalina.startup.hostconfig$deploydescriptor.run(hostconfig.java:1862) @ java.util.concurrent.executors$runnableadapter.call(executors.java:471) @ java.util.concurrent.fut

Using regex with `rename` version from `util-linux` -

i’m using gnu/linux distribution utility rename comes util-linux , want make full use of regular (perl or posix) expressions it. there two versions of rename : the “perl” version, syntax rename 's/^fgh/jkl/' fgh* the util-linux version, syntax rename fgh jkl fgh* if use of regexes seems pretty obvious first one, have no easy access. however, i’m confused second one: not find relevant documentation or examples on possible use, , in case format, of regular expressions use. let’s take, make simple example, directory containing: foo_a1.ext foo_a32.ext foo_c18.ext foo_h12.ext i want use syntax 1 of these 2 lines: rename "foo_[a-z]([0-9]{1,2}).ext" "foo_\1.ext" * rename "foo_[:alpha:]([:digit:]{1,2}).ext" "foo_\1.ext" * for expected output be: foo_1.ext foo_32.ext foo_18.ext foo_12.ext of course not work! either i’m missing obvious, or there no implemented way use actual regular expressions tool. (please note aw

javascript - Best way to get and store data (optimized) to mobile app (Ionic, Cordova/Phonegap) -

i want app ionic framework , cordova android , ios , want optimize @ requests server. i need data php server (api) , store in mobile phone, data related, think sqlite best option store in device because of show more fast complex sql json stored in localstorage (for example) , search , link data in mobile. i'm right? i need , can pull refresh in app , new data. i've been watching solutions don't know best. parse/firebase: difficult administrate non-specialists, have backend enter , modify data relations easily. in addition services return json more data need. persistence.js , persistence.sync.js works mysql-server , sqlite-local can sync 1 table or new data? , did't find solution php server. couchdb , pouchdb: don't know if can sync new records. receive data in json , store in sqlite: need create functions easier. any other solutions? i'm lost in topic. thanks!! couchdb , pouchdb: don't know if can sync new records. that

c# - BCrypt is not allowed for Windows Store Apps -

i'm using bcrypt.net hashing passwords in windows store app. works fine when built , tested in windows tablets. when i'm trying upload app store fails in supported api test. following error details given api system.applicationexception in mscorlib, publickeytoken=b77a5c561934e089 not supported application type. bcrypt.net.dll calls api. api system.runtime.serialization.serializationinfo in mscorlib, publickeytoken=b77a5c561934e089 not supported application type. bcrypt.net.dll calls api. api system.security.cryptography.randomnumbergenerator in mscorlib, publickeytoken=b77a5c561934e089 not supported application type. bcrypt.net.dll calls api. api system.applicationexception.#ctor in mscorlib, publickeytoken=b77a5c561934e089 not supported application type. bcrypt.net.dll calls api. api system.applicationexception.#ctor(system.string) in mscorlib, publickeytoken=b77a5c561934e089 not supported application type. bcrypt.net.dll calls api. api system.applicationexception.#c

ios - Swift Spritekit count touches -

i'm trying have several actions on 1 node. so example on first touch on node, first action should run. on second touch: second action should run. below not working example of code touches.count. override func touchesbegan(touches: set<nsobject>, withevent event: uievent) { touch: anyobject in touches { let location = touch.locationinnode(self) let node = self.nodeatpoint(location) if node == mynode { if touches.count == 1 { action1() } if touches.count == 2 { action2() } if touches.count == 3 { action3() } } } } you need member variable tracks number of touches since app started up. method touches.count isn't cumulative. var cumulativenumberoftouches = 0 override func touchesbegan(touches: set<nsobject>, withevent event: uievent) { touch: anyobject in touches { let location

python - ValueError when trying to add row to dataframe -

i trying add row df[0] = [0,360, 0, 0, 0,2,3.9,100.01,100,0] dataframe df shown below error valueerror: length of values not match length of index . have no idea why is, there 10 values in row , there 10 columns. dt months_to_maturity asset_id orig_iss_dt \ 1 2016-02-15 6 (binary data) 1986-02-18 00:00:00.0 2 2016-08-01 12 (binary data) 1986-08-01 00:00:00.0 3 2017-02-06 18 (binary data) 1987-02-06 00:00:00.0 maturity_dt pay_freq_cd coupon closing_price face_value \ 1 2016-02-15 00:00:00.0 2 9.250 105.40625 100 2 2016-08-01 00:00:00.0 2 9.380 105.86200 100 3 2017-02-06 00:00:00.0 2 8.450 111.42610 100 dt2 1 1970-01-01 00:00:00.000000002 2 1970-01-01 00:00:00.000000002 3 1970-01-01 00:00:00.000000002 thank you because df[0]

android - Why am I getting warning "variable may not be initialized" -

i trying create list view using array adapter, run method , mutltithreading, i'm receiving warning "variable summary may not initialized" on following line: summarydata summary = summary.get(position); . , please bare in mind new android development. my mainactivity lookslike this: public class mainactivity extends fragmentactivity implements onclicklistener{ ... public void updateresponse() { runonuithread(new runnable() { @override public void run() { storylineadapter adapter = new storylineadapter(mainactivity.this, r.layout.item_storyline, summary); medittextresponse.setadapter(adapter); } my arrayadapter looks this: public class storylineadapter extends arrayadapter<summarydata>{ private context context; private runnable runnable; private arraylist<summarydata> summary; public storylineadapter(context context, int resource, arraylist<summarydata&

Hi what is the meaning of IFS with single quote in next line? -

hi ifs=' ' space, ifs=' ' it means specifying ifs use newline splitting. similar doing: ifs=$'\n' the difference being way posix compliant. my sources answer here , here you may find different methods preferred depending on shell implementation using (i think that's right term?) note: answer based purely on last 10 minutes of research, have no prior experience or knowledge this.

ora 01427 - Oracle Single row subquery returns multiple rows while using nested subquery -

i'm trying run query below throws 'single row subquery returns multiple rows' error. works = in place of <> though(returns more 50 rows final output). not able figure out whats going wrong when use <>.tried not in, doesn't work. please help. select a, b, c, d, e (select distinct column1 a, column2 b, column3 c, column4 d, column5 e t1 t1.column1 'domain.%') c||d||e <> 'yyy' this hunch think missing inline view alias in query here shown below from (select distinct column1 a, column2 b, column3 c, column4 d, column5 e t1 t1.column1 'domain.%') xxx <-- 1 also, try using concat() function instead like where concat(concat(c,d),e) <> 'yyy'

vba - Deleting columns in excel using visual basic? -

i have 750 excel files. need clean them contain same formatting - i.e. contain same number of columns. some files (80%) contain columns containing labels asterisk e.g. "*1 subject". is there way using visual basic go through of files in folder delete columns containing asterisk files don't have such columns? fact asterisk wild card in computer speak make difference? write macro uses filesystemobjects loop through directory spreadsheets are. loop through each sheet , analyse column names. here how loop through each sheet. private sub commandbutton7_click() dim ws excel.worksheet dim icol integer dim strname string dim iindex integer 'loop through sheets. iindex = 1 application.worksheets.count set ws = application.worksheets(iindex) 'loop through columns. icol = 1 ws.usedrange.columns.count 'check row 1 of column first char of * if left(ws.cells(1, icol).value, 1) = "

playframework - Enable https for play framework -

i wish enable https on site based on play framework. i have below settings in conf/application.conf described in documentation play version 2.3.x in https://www.playframework.com/documentation/2.3.x/configuringhttps # https settings https.port=9443 https.keystorepath=/home/username/.keystore/example.jks https.keystoretype=jks https.keystorepassword=mysecurepassword https.keystorealgorithm=rsa however, when hit https://example.com:9443/ error "err_connection_refused" in chrome. there wrong in configuration? appreciate pointers/help on this. note: have created keystore , installed certificate there.

angularjs - Karma unit testing - error during loading plugin -

i'm trying run first unit tests using karma karma-junit-reporter plugin. i'm getting warning: > node node_modules/karma/bin/karma start test/karma.conf.js warn [plugin]: error during loading "karma-junit-reporter" plugin: cannot find module 'xmlbuilder' warn [reporter]: can not load "junit", not registered! perhaps missing plugin? but installed plugin in app's main folder (using npmbox since don't have access internet) , xmlbuilder folder placed in node_modules. here's part of karma config: frameworks: ['jasmine-jquery','jasmine'], browsers : ['chrome'], plugins : [ 'karma-chrome-launcher', 'karma-junit-reporter', 'karma-jasmine-jquery', 'karma-jasmine' ], reporters: ['junit'], junitreporter : { outputfile: 'test_out/unit.xml', suite: 'unit' }

How can I display sources of a dependent jarfile in eclipse maven project? -

after downloaded sources , javadocs of jarfile dependency project in eclipse, how can browse or display source codes? and second question: possible edit , build them? right click on project , click on maven -- > cick on download java doc , download source. for second question, can not change/edit source , build

How to find Arc length and angle for SVG shapes based on Mouse events in javascript? -

i trying rotate irregular shape object center using mouse events. consider figure @ link http://prntscr.com/7sixkt , line ab acting handle using rotate irregular figure, square show bbox (found center of shape using get bbox method . know a (center point coordinates) , length of ab (radius of bbox) . cannot calculate if move/drag line ab handle rotate shape, how find theta or arc length bc , using arc-length formula have 2 unknowns, l=rθ ( l , θ). kindly guide how find it. with svg, need point , point b mouse event. pseudo code: on mousedown event, record (x0,y0) , b (x1,y1) on mouseup event, record mouse position (x2,y2) with 3 points, can obtain 3 lengths on cartesian coordinate, in turn can calculate value of θ . with svg, use transform="rotate(θ)" on <img....> , rotation clockwise positive values , counter clockwise negative.

bash - cannot access file: Input/output error d????????? ? ?? -

i'm having following problem: can't remove specific file $ ls -l ls: cannot access fisier: input/output error total 0 d????????? ? ? ? ? ? fisier $ rm -rf fisier rm: cannot remove ‘fisier’: permission denied $ sudo rm -rf fisier [sudo] password myusername: rm: cannot remove ‘fisier’: directory

c++ - How to call super constructor from constructor with default params? -

i have 2 c++ classes, base class , sub class. base class defines properties , sub class others. now, in sub class constructor defined several default parameters , needs include default params base class, too. how do that? example: // base.h class base { protected: state _state; state _previousstate; public: base(); }; // sub.h class sub : public base { private: int _rate; int _checkcount; public: explicit sub(int samplerate); }; // sub.cpp sub::sub(int rate) :_state(silent), _previousstate(running), _rate(rate), _checkcount(0) { } obviously, in sub.ccp constructor _state , _previousstate args misplaced. how can integrate them construction? you can offer default construct function default values base class // base.h class base { protected: state _state; state _previousstate; public: base( state =silent,state b =runing):_state(a), _previousstate(b){} }; // sub.h class sub

sql server 2008r2 express - Data from SQL view in entity collection are not sorted -

i have simple sql view 2 columns. first primary key, nvarchar, , second int. view ordered int column. when load data using ef, data not sorted how specified in sql. need receive correctly sorted data? order ignored in view. need specify order in actual query use against view. see following explanation. https://dba.stackexchange.com/questions/66353/why-is-the-order-by-clause-in-a-view-ignored-as-soon-as-its-called-with-a-where

javascript - Create Onsen UI elements dynamically -

is possible create onsen ui elements dynamically using javascript? official documentation says nothing it. you can create dynamically onsen uui elements using ons._util.createelement() function. takes, in input, html code want generate. example: var button = ons._util.createelement("<ons-button></ons-button>"); document.body.appendchild(button); it create ons-button element, , append body. edit you can create in alternative way: var div = document.createelement('div'); div.innerhtml = '<ons-button></ons-button>' document.body.appendchild(div);

javascript - How to change web page content without removing any style/css/graphics -

i'm trying change content in page through refresh button, using javascript or jquery. want change content in table, command use removes parts of table , leaves new content in white. so far, i' ve tried change() , replacewith() , load() , text() of remove parts of table. document.write() prints in new page. is there command can use replace written table new content? update: code <script> var result = []; var k = 0; var jsonobject = json.parse(eventsjson); $(document).ready(function(){ $("#priceinfob").on("click", function(){ //alert(jsonobject.events.event[0].name); (i=0;i<4;i++){ if (jsonobject.events.event[i].isfree == "true"){ result[k] = jsonobject.events.event[i].name; k++; } }

java - How to find errors in JNI -

updating legacy code in our software , have had alter of calls through jni. however, after running few time program consistently breaks in same place in c++ access violation error, transfers java variable has been set null, cannot happen within java (there no way set variable null without cleaning class containing it) , jni call breaks not touch portion of code. each jni call checks exceptions after returns , code full of assert(*someitem* != null); after retrieving each jclass , methodid , instantiating new java classes, none of them fail , such can assume fault happening somewhere in native code , picked when returning java. my question is, how can find problem occurring? have used -xcheck:jni shows nothing, -verbose:jni , -verbose:gc suggested similar question, no avail. sorry no sscce possible due nature of problem for finds post , has same issue i've fixed it. as turned out using wrong methodid in call. reusing variable holds methodids , @ time in questio

java - order in multi-catch exception handler -

i know since java 7 can use multi-catch wonder if order of exceptions in matters in previous versions of java? e.g put in exception , sqlexception , ioexception ? try { // execute code may throw 1 of 3 exceptions below. } catch(exception | sqlexception | ioexception e) { logger.log(e); } or should way ? try { // execute code may throw 1 of 3 exceptions below. } catch(sqlexception | ioexception e) { logger.log(e); } catch(exception e) { logger.severe(e); } there's no point in single catch block catch(exception | sqlexception | ioexception e) since exception covers sub-classes ioexception , sqlexception . therefore catch(exception e) enough if wish same handling of exception types. if want different handling more general exception , second code snippet makes sense, , here order of 2 catch blocks matters, since must catch more specific exception types first.

ios - tying to login from facebook sdk earlier it was working fine but now giving error? -

1.tying login facebook sdk earlier working fine giving after login different account giving "domain=com.facebook.sdk.login code=304 " error. below code - (ibaction)fbloginclick:(id)sender { if ([appdelegate getappdelegate].internetactive) { fbsdkloginmanager * login = [[fbsdkloginmanager alloc] init]; [login loginwithreadpermissions:@[@"public_profile", @"email",@"user_birthday",@"user_friends",@"user_posts"] handler:^(fbsdkloginmanagerloginresult *result, nserror *error) { if (!error) { nsmutablearray *grantedpermission = (nsmutablearray *)result.grantedpermissions; if(![grantedpermission containsobject:@"public_profile"] || ![grantedpermission containsobject:@"email"] || ![grantedpermission containsobject:@"user_birthday"] || ![grantedpermission containsobject:@"user_friends"] || ![grantedpermissi

c# - How to select a particular list item if there is a duplicate also present -

i have htmllist items 1,2,3,4,1,2,3,4 wish select 3 last 1 element. i unable select particular list item. i tried following code block htmllistitem listitem = new htmllistitem(this.uimap.rightlist); listitem.filterproperties[htmllistitem.propertynames.taginstance]= "19"; listitem.filterproperties[htmllistitem.propertynames.innertext] = "3"; where rightlist htmllist , taginstance of item 19. not able identify item , selecting htmllistitem @ random. can suggest alternate way achieve this. appreciate help. try using the: findmatchingcontrols() something this: var controls = listitem.findmatchingcontrols() and figure out index of desired list item , select it mouse.click(controls[index])

reactjs - way to embed if expressions inside JSX code? -

i guess stuff goes react tag must react tag or string; function returns tag or string; collection of tag or string or functions return them. so if statement here not valid: return <div> if(something){ <projecttype typ={this.state.type} onchange={this.changetype}/> } , choice {type[this.state.type]} </div>; so obvious way move if expression function maybe_render returns tag when condition met. return <div> maybe_render(something, this.state.type, this.changetype) , choice {type[this.state.type]} </div>; problem is, snippets have lots of calls functions have little logic. instead of 5-line snippet, may have 5-line snippet many calls extremely small functions. what way embed if expressions inside jsx code? i ternary if statements if there's not logic or cause re-use: return ( <div> {dosomething ? : null} else </div> );

asp.net mvc - How can I convert this knockout view model to be Durandal compliant? -

i have system built on knockoutjs , trying take advantage of durandal . have figured out how make mvc routes play nicely , quite comfortable in respect. however, little bit confused view models. suppose confusion lies ignorance of requirejs . looking simple example following sample view model: the following skeleton/example of common in system , need know how make play nicely durandal : var somemodela = function () { var self = this; self.id = ko.observable(0); self.name = ko.observable(null); //etc self.create = function () { //etc }; self.edit = function (id) { //etc }; self.delete = function (id) { //etc }; self.save = function () { //etc }; self.cancel = function () { //etc }; }; var somemodelb = function () { var self = this; self.id = ko.observable(0); self.name = ko.observable(null); //etc self.create = function () { //etc }; self

html - PHP Get all alike values from array -

i've got multidimensional array values. [ 1 => [ 'label' => 'seo', 'content' => 'some content', 'group' => 'we can offer' ] 2 => [ 'label' => 'webdesign', 'content' => 'some content', 'group' => 'we can offer' ] 3 => [ 'label' => 'contact', 'content' => 'some content', 'group' => 'who we?' ] 4 => [ 'label' => 'logodesign', 'content' => 'some content', 'group' => 'we can offer' ] 5 => [ 'label' => 'address', 'content' => 'some content', 'group' => 'who we?' ] ] the group element variety of user input. want sort group

wordpress - Moving site from doman to subdomain without breaking the links already shared -

i need move wordpress lifestyle site main domain ( http://secretdiarybd.com ) subdomain ( http://bn.secretdiarybd.com ) . have 8000 blog posts , of them have been shared in social network sites (facebook fan page , twitter). if move site subdomain existing links shared in fan page broken. there way redirect subdomain post id or something? such if post id less 8000 redirect subdomain otherwise go main domain. appreciated. you might set forward subdomain folder of you're wordpress? don't know if works might be.

java - Circular Audio Recording -

i wondering if guys have solution this: want record , hold audio buffer of 10 seconds (dosent has 10), 10 last recorded seconds! ex. record ten seconds, first recorded seconds overwritten , new 1 added end! first thougth circular buffer start pointer moves along! problem not circular buffer, problem lies how handle audio samples buffer! bit tricky me understand! , thougths, or need further explonation? (might bad english, stupid auto correct) pre thank you! you can record 2 audio files every ten seconds , reuse last 1 (since have 10 seconds record won't need that). , when user stops record, combine current record have let's 6 seconds last (10-6) seconds of recorded file. can't think of else right now. is, however, tricky implement, believe can done.

want to build an ANT-Java project from another Java project -

i have 2 projects: project a: (java) & project b: (ant-java) i want build project b project a. project feeds file project b. please suggest me way this. if want call ant java without doing running external command (calling ant), include ant runtime (ant.jar, download @ apache ant webpage ) in project , execute build target b project. example: file buildfile = new file("build.xml"); project p = new project(); p.setuserproperty("ant.file", buildfile.getabsolutepath()); p.init(); projecthelper helper = projecthelper.getprojecthelper(); p.addreference("ant.projecthelper", helper); helper.parse(p, buildfile); p.executetarget(p.getdefaulttarget()); you check article . show how manage return results , generated log. hope helps.

utf 8 - Use _wfopen in C code without writing BOM -

is possible not write out bom @ beginning of file? want later run file in dos , doesn't that. e.g.script.bat > '' not recognized internal or external command, operable program or batch file. >chcp 65001 active code page: 65001 >mkdir c:\move open code:- file *out; if((out = _wfopen(l"script.bat", l"wt+,ccs=utf-8"))==null) rewind(out); @ start did trick.

python 2.7 - How to get an id in a many2many field? -

does can explain going on sql statement. here code chunk. for in self.pool.get('sale.order').browse(cr,uid,so_id,context): _logger.info("\n\n\t\t\t sale order id %d"%(so.id)) confirmed_by = so.confirmed_by.id _logger.info("\n\n\t\t\tconfirmed %s"%(str(confirmed_by))) rg_id = cr.execute("select rg.id res_users ru,res_groups rg,res_groups_users_rel rgr ru.id = rgr.uid , rgr.gid = rg.id , ru.id = "+str(confirmed_by)+" , rg.name 'project second user'") _logger.info("\n\n\t\t\tres groups ids %s"%(rg_id)) my confirmed returns id don't know why rg_id returns none when executed. when used in pgadmin query works fine. any appreciated. this how manage solve none issue: cr.execute("select rg.id res_users ru,res_groups rg,res_groups_users_rel rgr ru.id = rgr.uid , rgr.gid = rg.id , ru.id = "+str(confirmed_by)+" , rg.name 

java - Authentication when connecting to multiple proxies -

i can't figure out how provide login , password proxies (multiple ones) when i'm connecting it. say, my main proxy can used multiple clients , each time may connect different proxyx in parallel (in different threads) . , there can multiple connections open @ same time. client ---> main proxy ---> proxy1 ----> internet or client ---> main proxy ---> proxy2 ----> internet or client ---> main proxy ---> proxy3 ----> internet i've found out class authenticator can used. it, if understand correctly, affects connections @ same time, 1 pair of login-password can interfere another. so? the bottom line want provide login , password each individual connection my main proxy proxyx . i'm connecting proxyx following way: /*how provide login , password?*/ proxy proxy = new proxy(proxy.type.http, new inetsocketaddress("proxy.host", 8080)); httpurlconnection httpconnection = (httpurlconnection)url.openconnection(prox

processing - How to make Transparent markers on Unfolding Maps? -

i displaying multiple markers on google maps using processing unfolding maps library. know whether there way set transparency markers? opacity level can specify? thanks in advance, hasala are using 1 of default markers? if so, ones? in general, should able set stroke , fill colors of markers can specify transparency in normal processing way. mymarker.setcolor(color(255, 0, 0, 100)); check out simplemarkermanagerapp example.

linux - Maven equivalent of eclipse "clean project" -

i have multi-level maven project, includes major module references other (also maven) projects: <project xmlns="http://maven.apache.org/pom/4.0.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://maven.apache.org/pom/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelversion>4.0.0</modelversion> <groupid>com.evercompliant</groupid> <artifactid>pipelinemultimodule</artifactid> <version>0.0.1-snapshot</version> <packaging>pom</packaging> <name>pipeline multi module</name> <description>maven multi module project</description> <url>http://maven.apache.org</url> <properties> <maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.target>1.8</maven.compiler.target> </properties> <build> <plugins> <plugin> <artifactid