Posts

Showing posts from September, 2010

html - Share Content on facebook from an Android App -

i able share content on facebook mobile app using 2 ways 1 way using native android coding .in able share content logged in facebook account in mobile , coming back android app. problem in way if user not logged in showing login page. logged in, have no way come android application again. here on fly in facebook app only. how solve issue..? 2 way using html . in case both looged in user , not logged in users cannot come previous application after sharing. how resolve issue..?

css - Center ul sprite navigation -

i created sprite image menu within wordpress using following css: /* 04 microsites navigation */ .micrositescontainer { background: url('img/microsites_main_bkg.jpg'); } .micrositestopnav ul { display: block; font-size: 13px; list-style: none outside none; margin: 0; padding-left: 20%; } .micrositestopnav .horizontal-menu ul li { border-color: #ffffff; border-left: 0px solid #ffffff; float: left; padding: 0px 0 0 0; } /* microsites menu items start here]*/ .micrositestopnav .menu-item-8449 { background-image: url("img/micrositestopnav.png"); background-position: 0 0; display: block; height: 125px; outline: medium none; padding: 0; text-indent: 100%; white-space: nowrap; overflow: hidden; width: 200px; } .micrositestopnav li.menu-item-8449.menu-item-object-page:hover > a, .micrositestopnav ul ul:hover > a, .micrositestopnav li.menu-item-8449.menu-item-object-page a:focus { ...

query string - Java: How do I remove parameter from querystring -

i want remove querystring attribute url, tried regex didn't exact solution this. please me out of it. eg: string qstring = "category=popular&code=14290115"; qstring = qstring .replaceall("(?<=[?&;])code=.*?($|[&;])",""); output: category=popular& the above regex removing attribute not removing & symbol. please suggest me this. don't use regex this. it's utter nightmare because character percent-encoded, e.g. ?foo=bar same ?%66oo=%62ar . parse url, query string, rebuild it. take @ uribuilder , urlencodedutils out of apache commons http client.

javascript - Jquery Mobile page footer jump out of <div data-role="page"></div> -

Image
i have single html 2 jquery mobile pages(two data-role='page') each page have header, content , footer. but found when page been loaded, second page's footer jump out of <div data-role='page'></div> here source code: <html> <head> <meta charset="utf-8" /> <meta name="format-detection" content="telephone=no" /> <!-- warning: ios 7, remove width=device-width , height=device-height attributes. see https://issues.apache.org/jira/browse/cb-4323 --> <meta name="viewport" content="width=device-width, initial-scale=1"/> <link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.1/jquery.mobile-1.4.1.min.css" /> <link rel="stylesheet" href="stylesheets/style.css" /> <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script> <script src="http://cod...

sql - Vba Adodb query error -

Image
i have excel sheet this retail_sku studio_name region merchant source_type retouch_level cccf9x55fi ccry1b eu buy vip studio 9 ccchb1z8ee pccl3b na buy vip studio 9 cccfecjq1i lej1a eu buy vip studio 9 ccch296dn0 ccry1b eu buy vip studio 9 ccceqr38lq pccl3b na buy vip studio 9 ccchsc2x0i pccl3b na buy vip studio 9 ccca0iy4ou bv-de-retail eu buy vip vendor 9 cccgx64c68 pccl3b na buy vip studio 9 cccg7u7w4o ccry1b eu buy vip studio 9 looking result studio_name region ccry1b 3 pccl3b 4 lej1a 1 bv-de-retail 1 i'm trying achieve though ado-db .but havent found solution far. this below code have tried str = "select studio_name,count(*) retail_sku [sheet7$] merchant='buy vip' , retouch_level=9 group studio_n...

asp.net mvc 4 - Underlying provided failed to open ? mvc4 , wcf -

this code section getting error ideas ? public ienumerable<lobinfo> getlobinfo() { // var obj = n in lobj.lobinfoes select n; return lobj.lobinfoes.select(m=>m).tolist(); // return obj.tolist(); } i not using using keyword ? this issue been while , referred many articles in stackoverflow things looking bad me . thank suggestions underlying provider failed open means, @ point database not reached, due wrong connection settings example or previous failure etc... the code show here allright, except fact write useless .select can drop .select(m=>m) , leave .tolist there. further, find out causing crash post exact error message inner exception. (and inner exception's inner exception , on...) next part "lobj.lobinfoes" repository or something? might post code of , code of data access object well.

C# store app, send parameters on Basic page back button -

i made c# store app. send parameters page , read them, works fine. send parameters other pages this: this.frame.navigate(typeof(itemdetailpage), uniqueid); //(works) i make use of basic pages (because has default backbutton , title. want send parameter sended itemdetailpage (like did in above example) in page on, perhaps in button? does has solution how can save/ retreive de value when return current page? thanks in advance. there 2 ways perform this: 1) store value in isolatedstoragesettings object define in app.xaml.cs , store value in , retrive in desired pages. example : public isolatedstoragesettings settings = isolatedstoragesettings.applicationsettings; store value : (app.current app).settings.add("sampledata", txtsomething.text); retrive : (string)(app.current app).settings["sampledata"]; , whenever want update data remove value inside , add again. 2) decalre variable in app.xaml.cs , access anywhere.

php - how jquery ajax fail callback gets triggered if server returns status 200 -

when php's e_fatal error occurs server returns respons status 200 , responsetext: "↵fatal error: error description . however, jquery's ajax triggers fail callback instead of done . why? status 200 should call done callback. var jquerydeferred = $.ajax({ method: "post", url: url, datatype: "json", data: data }) jquerydeferred.done(function (response) { if (response.statuscode === 301) { window.location.assign(response.data || "/"); return; } else { customdeffered.resolve(response); } }).fail(function (response) { customdeffered.resolve(response); // callback called }); the jquery's ajax triggers fail callback instead of done. why? because expected return type (like json, text, html etc.) not required. consider example: $.ajax({ url : "your url", type : "post", datatype : "json", success: function(response){ ...

mod rewrite - Strange 404 error - trying to avoid with .htaccess -

i've got simple web site in trap 404 errors , 1 that's started coming through trying access /home/sycamore/public_html/...valid url... instead of /...valid url... obviously /home/sycamore/public_html/ file path site lives firstly, how on earth request being generated. can find nothing in code , yet happening in 1 area that;s been added. idea can caused this? in attempt avoid i've added rule .htaccess file starts options +followsymlinks rewriteengine on rewriterule ^/home/sycamore/public_html/(.*)$ /$1 [r,l] however, doesn't appear anything, i'm still getting 404 reported on /home/sycamore/public_html/...valid url... although there many other rewrite , redirect rules in .htaccess work perfectly. any ideas (1) why problem might there in first place , (2) why htaccess attempt 'correct' url failing? i add of requests url coming search bots; google, yahoo, etc. , there no mention of /home/... in sitemap.xml file. i'm pretty su...

c++ - VS 2010: error LNK2019: unresolved external symbol "extern "C" void * __cdecl -

i'm new in c++, tried copy code , run in visual studio 2010. giving unresolved extern 'c' error , unresolved token "extern "c" listed below code. this code causing errors : #ifdef _managed // works managed c++ #pragma once #pragma managed(push, on) #include <stdlib.h> //free typedef void (__cdecl *_pvfv)(void); extern "c" void * __cdecl _decode_pointer(void *); extern "c" void * __cdecl _encoded_null(); // crtdll.c extern "c" _pvfv *__onexitbegin; extern "c" _pvfv *__onexitend; void crtdestroystatics(void) { _pvfv * onexitbegin = (_pvfv *)_decode_pointer(__onexitbegin); if (onexitbegin) { _pvfv * onexitend = (_pvfv *)_decode_pointer(__onexitend); _pvfv function_to_call = null; /* save start , end later comparison */ _pvfv * onexitbegin_saved = onexitbegin; _pvfv * onexitend_saved = onexitend; while (1) { _pvfv *...

java - Submitting form with multiple dropdown boxes? -

in below code having multple dropdown boxes inside single form.in dropdown boxes showing default values. when user gets sign in user can change values inside dropdowns , clicks submit button. <form method="post" id="myform" name="myform"> <% while(rs1.next()) { %> <table id="main_table" style="width: 600px; border: 0px solid #ccc; padding: 1px; border-spacing: 1px; "> <tbody> <tr class="ab" style="background-color:#3f92aa; color:white; width:600px; "> <td colspan="2" class="flip" ...

jsoup - How to get this property value in my java code? -

i'm learning java , have problem retrieve information need objects... when debug code can see in targetfile, path property don't know how in code. this screenshot: ide debug view http://pix.toile-libre.org/upload/original/1395651483.png this complete code: package com.example.helloworld; import com.github.axet.wget.wget; import com.github.axet.wget.info.downloadinfo; import org.jsoup.jsoup; import org.jsoup.nodes.document; import org.jsoup.nodes.element; import java.io.file; import java.io.ioexception; import java.net.url; public class helloworld { public static void main(string[] args) throws ioexception { nodejs(); } public static void nodejs() throws ioexception { // scrap download url. document doc = jsoup.connect("http://nodejs.org/download").get(); element link = doc.select("div.interior:nth-child(2) > table:nth-child(2) > tbody:nth-child(1) > tr:nth-child(1) > td:nth-child(3) > ...

TransactionInactiveError in IndexedDB -

can create transaction inside transaction in indexeddb?? want export indexeddb datas sql server.. that, i'm iterating using cursors , send datas sql server after successful insertion, want delete same data in idb.. while doing this, i'm getting transactioninactive error: transaction not active. give me suggestions solve this.. var trans = db.transaction(["applicant"],"readwrite"); var store = trans.objectstore("applicant"); //console.log(store); var index = store.index("am_applicant_name"); var key = idbkeyrange.lowerbound(0); var cursor = index.opencursor(key); //console.log(cursor); cursor.onsuccess = function(e) { var result = e.target.result; console.log(result); if(result) { alert(result.value["am_applicant_name"]+" "+result.value["am_fat...

Javascript Regex to split line by comma -

i want regex expression javascript should split line comma , should not split expressions inside brackets eg: builtinfunctions.replace_first,type.string, type.string, 2, getargtypeins(type.string, type.string, type.boolean) to builtinfunctions.replace_first type.string type.string 2 getargtypeins(type.string, type.string, type.boolean) this regex split commas, except followed brackets: /,(?![^(]*\))/m demo

debugging - Matlab custom dbstop handler -

i know people have discussed how make custom dbstop conditions, (such in customize dbstop in matlab ) however, using normal dbstop if error , want know (from process) whether matlab process in debugging state ( k>> ) or running. i if had custom dbstop handler function. still want able hands-on debugging normal dbstop if error . if there other possibilities detect state of matlab outside ( >> vs k>> ), happy! let me know idea ;) timers in matlab can spawn seperate thread wait in can around problem of needing outside current matlab instance. can set timer check if debug mode active , if something. a example function check if debug mode active , if something: function mycallbackfunction(~,~) if feature('isdebugmode') % undocumented catzlovejazz load handel sound(y,fs) the 2 previous lines attention grabbing example, other possibilities use beep , write file, or run commands or function. evalin(...

sql - Many to many relationship and MySQL -

if wanted make database subscribers (think youtube), thought have 1 table containing user information such user id, email, etc. table (subscription table) containing 2 columns: 1 user id , 1 new subscriber's user id. so if user id 101 , user 312 subscribes me, subscription table updated new row containing 101 in column 1 , 312 in column 2. my issue every time 101 gets new subscriber, adds id subscription table meaning can't set primary key subscription table user id can present many times each of subscribers , primary key requires unique value. also in event there's lot of subscriptions going on, won't slow search of 101's followers rows have searched , checked every time 101 in first column , check user id (the subscriber 101) in second column? is there's more optimal solution problem? thanks! in case, pairs (user_id, subscriber_id) unique (a user can't have 2 subscriptions user, can they?). make compound primary key consisting of b...

c - C8051F330/320 Delay with Timer Function not working -

i using silicon labs 8051 mcus. below delay function timer examples came ide. //----------------------------------------------------------------------------- // t0_wait_ms //----------------------------------------------------------------------------- // // return value : none // parameters : // 1) unsigned char ms - number of milliseconds wait // range full range of character: 0 255 // // configure timer0 wait <ms> milliseconds using sysclk time // base. // void t0_wait_ms (unsigned char ms) { tcon &= ~0x30; // stop timer0; clear tf0 tmod &= ~0x0f; // 16-bit free run mode tmod |= 0x01; ckcon |= 0x04; // timer0 counts sysclks while (ms) { tr0 = 0; // stop timer0 th0 = -(sysclk/1000 >> 8); // overflow in 1ms tl0 = -(sysclk/1000); tf0 = 0; // clear overflow indicator tr0 = 1; // start...

Android: Socket not connecting and throws exception -

i having following android code connects web socket program. web socket running on java application. both socket , android code in eclipse. the problem is, android program not connecting socket @ all. handled under button click mentioned in code below. after line socket = new socket("192.168.1.21", 8081); throwing exception, not sure why. tried refer sample code internet, couldn't see strange issue in below code. could please me on solving please? android code: mhandler = new handler(); clientthread = new clientthread(); button connectbtn = (button) findviewbyid(r.id.button2); connectbtn.setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) { // todo auto-generated method stub //start contacting socket mhandler.post(mupdate); } }); private runnable mupdate = new runnable() { public void run() { try { ...

linux - Concatenate 2 parameters in a find expression -

i want write command display .c , .cpp files computer. i know can use find -name how can concatenate parms find both file extensions. right have: find -name "*.cpp" alternative solution find -regex '.*\.\(c\|cpp\)' in way can avoid multiple -o logic condition (as requested in herrserker answer

java - Datatable Parameters are Null , causing NumberFormatException:Null. Any Solution? -

i have action annotation acts server side processing action jquery data-table. while getting params of datatable, m getting exception. class getting params is: package com.healthslate.reports.view.actions; import javax.servlet.http.httpservletrequest; public class datatablesparamutility { public static jquerydatatableparammodel getparam(httpservletrequest request) { if(request.getparameter("secho")!=null || request.getparameter("secho")!= "") { jquerydatatableparammodel param = new jquerydatatableparammodel(); param.secho = request.getparameter("secho"); param.ssearch = request.getparameter("ssearch"); param.scolumns = request.getparameter("scolumns"); param.idisplaystart = integer.parseint(request.getparameter("idisplaystart")); param.idisplaylength= integer.parseint(request.getparameter("idisplaylength") ); param.icolumns = integer.p...

perl - Processing 1.5 Million Line File under 5 Minutes -

after long searches on net, decide ask here regarding problem.i have csv file set (36 files total), coming every 5 minutes. each file contain around 1.5 million lines. need process files in 5 minutes. have parse files , create required directory them inside storage zone. each unique line translated file , put inside related directory. related lines written inside related files. see there lots of i/o operation. i can finish total 12 files around 10 minutes. target finish 36 in 5 minutes. using perl complete operation. seen problem system calls i/o operations. i want control file handlers , i/o buffer in perl not have go write file every time. here got lost actually. plus creating directories seems consuming time. i search cpan ,web find lead can put light on way no luck. have suggestion in subject ? should read or how should proceed ? believe perl more capable fix issue, guess not using correct tools. open(my $data,"<", $file); @lines = <$data>; foreach ...

ios - Global NSString without alloc access only in 2 place or in two method and in 3rd place it crash the application -

here nsstring *documentspath declare in globally. #import "detailviewcontroller.h" #import "information.h" @interface detailviewcontroller () { nsstring *documentspath; nsarray *paths; } assigning , accessing in viewdidload method. - (void)viewdidload { nslog(@"enter viewdidload detailviewcontroller"); paths = nssearchpathfordirectoriesindomains (nsdocumentdirectory, nsuserdomainmask, yes); **documentspath** = [paths objectatindex:0]; nsstring *plistpath = [**documentspath** stringbyappendingpathcomponent:@"infodetail.plist"]; } also accessing in settingcellimage method -(void)settingcellimage:(uitableviewcell *)cell noofrow:(int)row { nslog(@"enter in settingcellimage method"); nslog(@"doc path cell ===>%@",documentspath); nsstring *imagepath = [**documentspath** stringbyappendingformat:[nsstring stringwithformat:@"/%d.png",row]]; } but when use in dids...

How should I wrap C libraries into C++ -

typical c libraries this: foo_t * foo_open(); int foo_query( foo_t * ); int foo_close( foo_t * ); i can see 2 ways of wrapping sleak raii structures. either create class , wrap every c function: class foo { public: foo(): m_impl( foo_open() ) { } ~foo() noexcept { foo_close( m_impl ); } int query() { return foo_query( m_impl ) }; }; or use smart pointer custom destructor: class foo_destructor { public: void operator()( foo_t * const obj ) noexcept { foo_close( obj ); } }; typedef std::unique_ptr< foo_t, foo_destructor > foo_ptr; and use c interface directly. int main() { foo_ptr my_foo( foo_open() ); foo_query( my_foo.get() ); } right now, using second solution, because lazy write member functions. there reason why 1 method should preferred other? the first approach more c++ way of doing things. functions grouped 1 logical unit (the class), you've encapsulated data raii prevents resource leaks , you...

android - Nullpointerexcepiton on cursor while selecting photo from gallery on dialog fragment -

i'm trying select photo gallery through dialogfragment . i'm getting nullpointerexception while initializing cursor . ideas why getting error? below code : if (resultcode == activity.result_ok) { uri selectedimage = imagereturnedintent.getdata(); string[] filepathcolumn = {mediastore.images.media.data}; // nullpointerexcepiton on line cursor cursor = getactivity().getcontentresolver().query(selectedimage, filepathcolumn, null, null, null); cursor.movetofirst(); int columnindex = cursor.getcolumnindex(filepathcolumn[0]); cursor.close(); } here logcat error : 03-24 12:34:37.645: e/androidruntime(21479): java.lang.runtimeexception: failure delivering result resultinfo{who=null, request=65538, result=-1, data=intent { dat=content://media/external/images/media/3890 flg=0x1 }} activity {com.example/com.example.mainactivity}: java.lang.nullpointerexception 03-24 12:34:37.645: e/androidruntime(21479...

Setting Reporting Parameter Values -

Image
i have report parameters below image: now, user wants when example, taxed parameter set true, other similar parameter bit data type should automatically become false, in other word, 1 parameter can set true @ same time in image below: how achieve in ssrs? thank you. you won't able - not how you're describing. cascading parameters, can flow in 1 direction. why not use single-select dropdown list options valued, taxed, & rated?

Different behavior in visual c++ versus gcc/clang while stringifying parameter which contains comma -

i'm using stringizing operator convert parameter may contains comma passed macro string. know, characters cannot stringified – notably, comma(,) because used delimit parameters , right parenthesis()) because marks end of parameter. use variadic macro pass commas stringizing operator this: #include <stdio.h> #define test 10, 20 #define make_string(...) #__va_args__ #define string(x) make_string(x) int main() { printf("%s\n", string(test) ); return 0; } it works fine. occurs me happen without variadic macro, modify macro: #define make_string(x) #x . compiles fine unexpectedly in visual c++ 2008/2010, , output 10, 20 while gcc/clang give compilation error expected: macro "make_string" passed 2 arguments, takes 1 so question: visual c++ doing additional work or behavior undefined? vs in general allows parameters in macros , drops them silently: string(10, 20, 30) - still works , prints 10 . not case here, pretty m...

How to get the name of the currently executing trigger and the name of the table it is attached to, in sql server? -

i using sql server 2008 i have common line of t-sql put many triggers. want able use name of executing trigger , table name trigger attached to. i hard code each trigger lot of work i'd avoid, there inbuilt functionality give me want? whilst waiting answer, have discovered half of question: object_name(@@procid) will give me trigger name just need table name now ok found myself: select name tablename, object_name(@@procid) triggername sys.objects object_id = (select parent_object_id sys.objects name = object_name(@@procid))

java - private static final vs private final -

this question has been asked here . per answer : private final int number = 10; if cannot change, there no point having 1 copy per instance. my doubt if instance of class created, once day , lasts around few seconds. idea keep int(in case object) in memory? assuming, there can many (20-30) such objects. how store information depends on intended used for. there few approaches might take: private static final this choice if value never modified during lifetime of application. means, when you're creating multiple instances, storing particular variable once. private final this meant times when value might take on different values different instances of object, specific instance not have it's value modified throughout object's life time. if you're looking @ might take on different values on range of time, might of interest you. public static int getnumber(){...} another approach might consider have static method return value after. ma...

javascript - Delete element from a associative array in JavsScript --> very slow? -

i want delete 1 element associative array. array follows: array[propertyname] = property; this array filled data (less 10 entries) , shown in property window. on pages can click delete button next entries , delete corresponding entry. achieve function called: $d(document).on('click', '.property_del[type="button"]', function(event) { (property in selectedgroup.properties) { if(property == $d(this).attr('id').replace("_buttondel", "")){ continue; }else{ temp_array[property] = selectedgroup.properties[property]; } selectedgroup.properties = temp_array; }); this works far, selected entry deleted after button click event, slow hell. second method delete slow first one: delete selectedgroup.properties[$d(this).attr('id').replace("_buttondel", "")]; what can make faster? thx!! maybe jquery selector inside loop slowing things down. speed things...

syntax - What does "open!" mean in OCaml? -

i'm looking @ ocaml source file begins following instruction: open! miscparser i understand open miscparser means "open miscparser module", don't know exclamation mark means. it's avoid triggering warnings if open shadows exisiting identifier. see manual .

oracle - SQLLDR Database connectivity -

we facing database connectivity issues while running sql loader utility . when run job call sqlldr batch file (on windows), able run job without issues. when same batch file run scheduler, failing below error. sql*loader-704: internal error: ulconnect: ociserverattach [0] ora-12557: tns:protocol adapter not loadable internal error. can please suggest resolution this. please let me know if details provided insufficient.

css - Disappearing footer nav when clicking on menu button - media query -

i have disappearing footer nav problem! @ @979 media query - navigation button appears on top of screen drop down menu. however, when click on button same info appears in footer nav totally disappears... thoughts please? here css: header nav { width: 100%; z-index: 999; } header nav ul li { width: 100%; background: #1d5671; padding: 0; border-right: 0; } header nav ul ul { display: none; position: absolute; top: 100%; } header nav ul ul li { float: none; position: relative; } header nav ul ul li { padding: 15px 40px; color: #fff; background-color: rgba(29,86,112,0.92); width: 100%; } header nav ul ul li a:hover { background: #00a8ef; } header nav ul li:hover > ul { display: block; } header nav ul { width: 100%; padding: 0; margin: 0; list-style: none; display: inline-table; position: relative; } header nav ul:after { content: ""; clear: both; display: blo...

android - Stackoverflow error when using comp.clickOnActionModeOverflowMenuItem(String Text) of Robotium-actionbarsherlock extension -

here test function i'm trying run public void testdeletesingledocument () throws exception { reusable_addnew adddoc = new reusable_addnew(solo); reusable_folderanddocumentactions deldoc = new reusable_folderanddocumentactions(solo); reusable_helpfunctions = new reusable_helpfunctions(solo); adddoc.navmenuclick(); string document = "my document"; help.clearall(); adddoc.createdocument(document); adddoc.applaunch(solo); deldoc.deleteitem(document); } and delete function public void clickdeleteicon () throws exception { try { asserttrue( "wait text (id: com.softxpert.sds.r.id.action_delete) failed.", solo.waitfortextbyid("com.softxpert.sds.r.id.action_delete", 20000)); solo.clickontext((textview) solo .findviewbyid("com.softxpert.sds.r.id.action_delete")); } catch (assertionfail...

http - Python 'requests' library - define specific DNS? -

in project i'm handling http requests python requests library . now, need query http server using specific dns - there 2 environments, each using own dns, , changes made independently. so, when code running, should use dns specific environment, , not dns specified in internet connection. has tried using python-requests? i've found solution urllib2: https://stackoverflow.com/questions/4623090/python-set-custom-dns-server-for-urllib-requests requests uses urllib3 , uses httplib.httpconnection well, techniques https://stackoverflow.com/questions/4623090/python-set-custom-dns-server-for-urllib-requests (now deleted, merely linked tell urllib2 use custom dns ) still apply, extent. the urllib3.connection module subclasses httplib.httpconnection under same name, having replaced .connect() method 1 calls self._new_conn . in turn, delegates urllib3.util.connection.create_connection() . perhaps easiest patch that function: from urllib3.util import connec...

xml - How to get the Count of the Child nodes based on node value? -

i have following xml. <result> <message> <type>error</type> <description>abc</description> </message> <message> <type>warning</type> <description>def</description> </message> <message> <type>error</type> <description>ghi</description> </message> <message> <type>information</type> <description>ijk</description> </message> </result> i want result like abc def ghi jkl total error: 2 total warning: 1 total information:1 i able total number of child records using count(//message/type), resulting 4. i wants total number of errors, tried count(//message/type &eq; "error") but not worked. here xsl. <ul> <xsl:for-each select="message"> <li> <xsl:value-of select="....

objective c - ios error terminating -[__NSArrayM setRoleHistorys:]: -

im trying make user role page data login. created own delegate function call webservice app getting crash due to-[__nsarraym setrolehistorys:]: unrecognized selector sent instance. here code: in .m file : - (void)parserdidstartdocument:(nsxmlparser *)parser { nodecontent = [[nsmutablestring alloc]init]; } - (void)parserdidenddocument:(nsxmlparser *)parser { arrayitems = [[nsmutablearray alloc] init]; u serroledataparser *userroleparser = [[userroledataparser alloc] init]; // userrole *currentstudent = (userrole *) arrayitems; nsstring *username = username.text; nslog(@"the string value%@",username); [userroleparser getuserhistoryforindex:0 loginid:username.text]; nslog(@"the string user value %@",username.text); userroleparser.delegate = self; } - (void) didrecievedata : (nsarray *) userhistories forindex :(int) index { arrayitems = [[nsmutablearray alloc] init]; userrole *roles = (userrole *) arrayitems; roles.rolehistorys = userhistories; datadispl...

Using a normal distribution in GPU machine and CUDA -

i have question of using gpu machine here. i'm working on cuda file. want put random noise function, , i'm using normal distribution of mean 0 , variance 1. after several tries, still can't make work. this tried , don't know why didn't work. i'm using school's cluster run experiment. i_tcs = itcsamp*curand_normal(); i_tcs , itcsamp here functions. both curand.h , curand_kernel.h . , error messages got were: error: no instance of overloaded function "curand_normal" matches argument list please let me know if know possible solutions. i'll appreciate that! here example use it: __global__ void kernel(unsigned int * soboldirectionvectors, curandstatesobol32 *state) { curand_init(soboldirectionvectors, 1234, &state[0]); float normalrandomvariable = curand_normal(&state[0]); }

c# - Conditional binding in ASCX page -

i have custom list object , binding repeater this <asp:repeater runat="server" id="repeater1"> <itemtemplate> <p>opsigelsesdato:<input type="text" value="<%eval("enddate.month")+ "/01/"+ eval("enddate.year")%>" /></p> </itemtemplate> </asp:repeater> now want want bind values input if enddate.month not equal null. there way in ascx page? you can this: create public method on page call code-in-front. e.g. if using c#: public string processmydataitem(object myvalue) { if (myvalue == null) { return "0"; } return myvalue.tostring(); }

node.js - socket.io connection via client not working -

i have started using node.js socket.io. working on simple connection between client , server. here server code: var express = require('express'); var routes = require('./routes'); var http = require('http'); var path = require('path'); var socketio = require('socket.io'); var app = express(); app.set('port', process.env.port || 1337); app.set('views', path.join(__dirname, 'views')); app.set('view engine', 'jade'); app.use(express.logger('dev')); app.use(express.json()); app.use(express.urlencoded()); app.use(express.methodoverride()); app.use(app.router); app.use(express.static(path.join(__dirname, 'public'))); app.get('/', routes.index); var server = app.listen(app.get('port'), function(){ console.log("express server listening on port " + app.get('port')); }); var io = socketio.listen(server); and client code( http://smartican.com/nodetest.h...

c# - How to read from an XML and display in a textbox and label in a Winform -

i creating survey application , having trouble reading xml file wrote display splash text inside of splash form , questions in actual survey form. i writing questions , answers in xml program can reused creating different xml , reading rather hard-coding questions , answers. here xml structure: <questions> <splashtext> <text>splash text displaying information , purpose of survey goes here</text> </splashtext> <question> <type>comboboxcontrol</type> <text>blah blah blah?</text> <choices> <choice>answer 1</choice> <choice default="true">answer 2</choice> <choice>answer 3</choice> <choice>answer 4</choice> </choices> <required>true</required> </question> .. .. </questions> how can program read xml , put splash text textbox on splash form? admittedly,...

vb.net - ProcessStartInfo and JLine -

using processstartinfo in visual basic, want redirect java application i/o handled jline library. output ok, input doesn't work . i found process.standardinput.writeline not working on java.exe . op solves issue stopping jline . is safe solution? know other ways solve this?

.net - Reading file in C# based on new line -

i have file in c# has keywords each present on new line 1234-hello here 121-where i want read file , write 1234-hello 121-where file, have found lot of codes on internet based on comma seperated couldn't find code extract values on basis of new line. the - seperates number , keyword want extract, 1234-hello you can use this: string[] lines = file.readalllines(path); for(int = 0; < lines.length; i++) { string line = lines[i]; string[] tokens = line.split(new char[]{'-', ' '}); int number = int.parse(tokens[0]); string text = tokens[1]; lines[i] = number + "-" + text; } file.writealllines(path2, lines); you want add error handling check if lines returned check if tokens.length >= 2 etc.

javascript - Creating buttons on an image in HTML5 -

i creating website of map of south-east asia. want user able press on country on map , pop box come showing information of country pressed on. how make buttons on map work? have tried transparent countries in different images , overlay them in html , css did not work you need use image map. have here

php - Twitter Oauth Error - Could Not Authenticate You - Error Code:32 -

i trying user detail using twitter api - oauth, user authorization stage on in application. at final stage not able twitter user detail. please tell me have done wrong. the url getting @ final stage after user authorization below, https://api.twitter.com/1.1/account/verify_credentials.json?oauth_consumer_key=bdlnyiijedjpjz5i7wwsa&oauth_nonce=6e1e29b2a8d38e4a50179d5568b7d89a&oauth_signature_method=hmac-sha1&oauth_timestamp=1395669350&oauth_token=147476905-h5mqgfogxk0xkzq1p6x7cnab6ye7vihvfxa7mb2i&oauth_version=1.0&oauth_signature=ffydkjtfbvucmhlc50wg6bj6g0s%3d i searched lot of forum including stackoverflow more 3 hours. not able solution this. please me on this. i have same issue when use plugin https://wordpress.org/plugins/latest-tweets-widget/ . here solution: on app page => settings => check "allow application used sign in twitter" , callback url ( url of site when input token keys). when refresh site see sign in ,...