Posts

Showing posts from February, 2010

Paypal C# Return Url -

i have c# mvc (using umbraco) site need submit payment through paypal. have setup sandbox merchant , buyer account. able submit payment , working there. however, site needs know when payment has completed send email , database operations, , here i'm having problem. cannot paypal auto return site. need return url be: http://localhost:56733/payment-confirmation this not duplicate of question: setting paypal return url , making auto return? i using c#, not php. also, trying run locally. solutions listed on above question not work. behavior , results same. i screen shows following: you completed payment. xxxx, completed payment. transaction id payment is: xxxxxxxxxxxxx. we'll send confirmation email xx@xxxx.com. transaction appear on statement paypal. go paypal account overview it not recommended handle post-payment processing on return url. auto-return enabled there no guarantee user make there, , if don't, code never run , you'll end tas

PHP - Parsing invalid XML and outputting to own xml document -

trying figure out effective way parse invalid xml (in php). the element i'm attempting parse contains nested that'd output own xml doc. i've tried simple xml, continuously running errors. tried using dom , seems work well, resulted in being able output text. appreciated. sample xml: <?xml version="1.0" encoding="utf-8"?> <server_name> <creative> <content><vast xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" version="2.0" xsi:nonamespaceschemalocation="vast.xsd"> <ad id="222296909"> <inline> <adsystem version="2.0">dart_dfa</adsystem> <adtitle>in-stream video</adtitle> <description>parisian love - updated</description> <survey/> <impression id="dart"> <![cdata[ http://ad.doubleclick.net/imp;v7;x;222296909;0-0;0;45922216;0/0;35460632/35478450/2;;~cs=s%3fhttp://s0.2mdn.net/dot.

ios - Replace some contents of NSMutableDictionary with another NSMutableDictionary -

i having 2 nsmutabledictionaries each has 5 nsarrays inside, these 2 nsmutabledictionaries have excactly same 5 keys , nsarrays different content, i need replace 2 arrays arrays of other nsmutabledictionary dic1 = dic2; //isn't solution...will replace contents of 1 other... i need can replace object of specific key other same key. i tried [dic1 setobject:[dic2 objectforkey:@"key1"] forkey:@"key1"]; [dic1 setobject:[dic2 objectforkey:@"key2"] forkey:@"key2"]; and error: attempt insert nil value (key: key1)' the error means [dic2 objectforkey:@"key1"] returning nil value. in other words, key not exist in dictionary. likewise, can't set nil value inside of nsdictionary, thats why error sent out. print out each of dictionaries , ensure keys/values expect. can use nslog or pause program breakpoint, , enter po dic1 in console.

excel - I want to enter todays date in cell Z2 if any cell between A2 and Y2 are altered -

this recording date of alteration record in spreadsheet containing many thousand records. appreciate suggestions may have; can think of no way formula, if possible, prefer on macro. thank you. although specify row 2 in question, mention thousands of rows, assume want macro work rows, not row 2. following add date stamp column z in row change occurred. works if multiple cells changed @ same time, example paste or delete operation. option explicit private sub worksheet_change(byval target range) dim cel range if not intersect(target, [a:y]) nothing on error resume next application.enableevents = false each cel in target range("z" & cel.row).value = date next cel application.enableevents = true end if end sub to install, right-click sheet tab, click view code , paste above code window.

mysql - Importing XML and Skipping Errors (PHP) -

i have cron job runs each night update our stock system (from external source) via multiple xml files. however, case, errors appear in xml (nothing can - 3rd party provides this). when error occur, script comes stop , no more files processed. there way if error encountered, remaining files still imported? here code: <?php include 'connect.php'; $sql = "delete stock allow_keep!='1'"; mysql_query($sql); //clear stock table loop through , add active users $query = "select * users active='1'"; $result = mysql_query($query); while ($row = mysql_fetch_array($result)){ $xml = simplexml_load_file(“users/xml_file_”.$row['id'].".xml"); foreach($xml->children() $child) { $myquery="replace stock set stockid='" . $child->stockid . "', make='" . addslashes($child->make) . "', model='" . addslashes($child->model) . "', image='" .

html - Move a nav which is inside a header to the right side -

i have nav inside header , wanted move nav right side of page. tried float:right not lined anymore header. here code: <header> <nav> <h1>my page</h1> <ul> <a href="#"><li>home</li></a> <a href="#"><li>blog</li></a> <a href="#"><li>about</li></a> <a href="#"><li>contact</li></a> <a href="#"><li>links</li></a> </ul> </nav> header{ background:#999; color:white; padding:15px 15px 0 15px; } header h1{ margin:0; display:inline; } nav ul{ margin:0; display:inline; padding:0 0 0 15px; } nav ul li{ background:black; color:white; display:inline-block; list-style:none; padding:5px 15px; } all need add inline-block properties nav , header elements. add width:100% header full size. of course don't forget

javascript - Three.js 3D cube spins faster and faster when re-initializing -

i trying understand this: first three.js example spinning 3d cube spins faster , faster every time re-initialized. the code has init function sets scene , animate function starts animation loop. if repeatedly call init , animate , expect cube reset instead cube spinning faster , faster every time it re-initialized. why happening? isn't object being re-initialized? is feature of three.js or javascript? here js fiddle shows i'm talking about. have set re-initialize every 2 seconds: http://jsfiddle.net/1hq2eslr/ (tested in firefox , chrome) here full code: var camera, scene, renderer, geometry, material, mesh; function init() { scene = new three.scene(); camera = new three.perspectivecamera( 75, window.innerwidth / window.innerheight, 1, 10000 ); camera.position.z = 1000; geometry = new three.boxgeometry( 200, 200, 200 ); material = new three.meshbasicmaterial( { color: 0xff0000, wireframe: true } ); mesh = new three.mesh( geo

winrt xaml - COMException visual studio designer -

i'm working on project make custom control works on both windows 8.1 , windows phone 8.1. after finished coding custom control inside pcl project, added universal app project. after adding i'm facing strange error (at least me), need with. error , stacktrace is:- comexception:error hresult e-fail has been returned call com component. @ system.runtime.interopservices.windowsruntime.ivector`1.insertat(uint32 index, t value) @ system.runtime.interopservices.windowsruntime.vectortolistadapter.insertathelper[t](ivector`1 _this, uint32 index, t item) @ system.runtime.interopservices.windowsruntime.vectortolistadapter.insert[t](int32 index, t item) the error appears everytime start solution , opening mainpage.xaml either windows 8.1 or windows phone 8.1. both xamls have code below inside <grid> <customweekview:customweekview x:name="weekview"></customweekview:customweekview> </grid> all projects runs without problem during debug. there

javascript - Sharing nunjucks filters across node and browser -

i trying find way filter works on both side. here code have on node : var env = nunjucks.configure(__dirname + '/../templates', { express: app }); env.addfilter('date', function(str){ return 'ok'; }); and on browser side : var env = new nunjucks.environment(); env.addfilter('date', function(str){ return 'ok'; }); i have filter in place available in these 2 different environments don't find solution so. on client side using nunjucks-slim version. templates precompiled using gulp. thanks ! you put filters in separate file/module, pass env in argument. eg. /** * @param env nunjucks environment */ function(env){ env.addfilter('fancy', function(input){ return 'fancy ' + input }); env.addfilter(...); return env; } you use umd wrapper ( https://github.com/umdjs/umd ) make compatible both browser , server. finished wrapper might this: // custom_filters.js (funct

visual studio 2012 - Getting CUB DeviceScan to work when called from a kernel -

i trying learn how use cub perhaps rewrite integrator code. i've been looking @ examples , code snippets in docs, have not yet found example of i'm trying do. specifically, run inclusivesum called master thread. i've seen, examples call function host, rather device, hint can done here : http://nvlabs.github.io/cub/structcub_1_1_device_scan.html#a7bcc25e4d9c14a23f71431cf1a6b2bd5 "when calling method kernel code, sure define cub_cdp macro in compiler's macro definitions." i've tried adding in visual studio 2012 going project's properties->cuda linker-> command line , adding "-dcub_cdp." i'm not sure if correct, following build line : "nvcc.exe" -gencode=arch=compute_35,code=\"sm_35,compute_35\" --use-local-env --cl-version 2012 -ccbin "c:\program files (x86)\microsoft visual studio 11.0\vc\bin\x86_amd64" -rdc=true -i"c:\program files\nvidia gpu computing toolkit\cuda\v6.0\include"

C++ Input to .txt -

i've been working on notebook program few days , have ran problem can't seem figure out. code bellow runs fine, final outcome has me scratching head. #include <iostream> #include <fstream> #include <string> #include <ctime> int main () { time_t = time(0); tm *ltm = localtime(&now); std::string note; int day = ltm->tm_mday; int month = 1 + ltm->tm_mon; int year = 1900 + ltm->tm_year; std::string d = std::to_string(day); std::string m = std::to_string(month); std::string y = std::to_string(year); std::string text; std::getline(std::cin, text); if(text.find("take ") != std::string::npos && text.find("note ") != std::string::npos) { { std::ofstream myfile ("c:\\users\\filepath\\" + m + d + y + ".txt"); if (myfile.is_open()) { std::cin >> note;

Memory leak in C++ : vector functions in loops -

i have situation multiple functions called repeatedly. here bare model of program, how supposed work. when number of iterations large program eats memory (not significant in bare minimum model), case of memory leak. please suggest best way in such situations. novice. in advance. #include <iostream> #include <vector> /* functions called repeatedly (can in different .cpp files) */ std::vector<int> func1(std::vector<int> ttt); std::vector<int> func2(std::vector<int> ttx); int main() { std::vector<int> temp1; std::vector<int> temp2; (int jj = 1; jj <= 50; ++jj) { std::vector<int>vect0; vect0.push_back(0); (int = 1; <= 500; ++i) { vect0.push_back(rand()%100); } temp1 = func1(vect0); // other oprations on temp1 temp2 = func2(temp1); temp1 = temp2; // other operations of calling similar functions } retur

java - Retrieve an annotated field from a class in the view -

in current spring project, atributes entity classes have annotations indicate type of form control should used data input, this: @column(name = "login", unique=true) @order(value=1) @input(name="login") private string login; @column(name = "senha") @order(value=2) @input(type="password", name="senha") private string senha; @column(name="nome") @order(value=3) @input(name="nome") private string nome; @column(name="sobrenome") @order(value=4) @input(name="sobrenome") private string sobrenome; @column(name="email") @order(value=5) @input(name="email") private string email; and have custom tags should read atributes of annotations , add page correct tag, that: public class inputtag extends tagsupport { /** * */ private static final long serialversionuid = 1l; public void dotag() throws ioexception, nosuchfieldexception, securityexception {

python - Finding the number of times characters from text1 occur in text2 -

write function definition of occurrences takes 2 string arguments. function returns number of times character first argument occurs in second argument. example: occurrences('fooled', 'hello world') should evaluate to: 7 (1 'e', 3 'l', 2 'o', 1 'd') my code here: def occurrences(text1, text2): """return number of times characters text1 occur in text2 occurrences(string, string) -> int """ # add code here ss=0 c in set(text2): if c in text1: return text1.count(text2) return ss it says that: loop should iterate on text2 wrong: strings 'tc1h' , 'return number of times characters text1 occur in text2' got 0. correct answer 15.' def occurrences(text1, text2): """return number of times characters text1 occur in text2 occurrences(string, string) -> int """ text1_dict = {char:0 char in text1} char in text2:

c# - How can I format currency with no decimals but only when the decimal is zero? -

i using following format decimal currency. double value = 12345.6789; console.writeline(value.tostring("c", cultureinfo.currentculture)); // result: $12,345.68 which behaviour want, except when decimals 0, in double value = 12345.00; then result should $12,345 i've tried variations using # .tostring("c.##" etc. can't work i'd like. using decimal , determine format string use: //decimal value = 12345.6789m; decimal value = 12345.0000m; var formatstring = decimal.truncate(value) == value ? "c0" : "c"; console.writeline(value.tostring(formatstring, cultureinfo.currentculture));

c - Attribution in first line on switch statement make a error in gcc -

why code doesn't work unless remove comment? #include <stdio.h> int main(){ int num = 5; switch(num){ case 5: //printf(""); int = 1; printf("%d", num+another); break; } } gcc returns error: prog.c: in function ‘main’: prog.c:7:13: error: label can part of statement , declaration not statement thanks. the reason outlined here: why can't variables declared in switch statement? as workaround, can this: #include <stdio.h> int main(){ int num = 5; switch(num){ case 5:; //printf(""); int = 1; printf("%d", num+another); break; } } include semicolon after case workaround.fool compiler thinking statement follows , not declaration. taken here

objective c - How do I properly declare a global variable in a header file? -

i testing code declare global variable in header file, i'm getting linker error: "duplicate symbol" header file: // // globalvaraibleclass.h // globalvar // #import <foundation/foundation.h> int gglobalvar = 0; @interface globalvaraibleclass : nsobject @end class file: // // globalvaraibleclass.m // globalvar // #import "globalvaraibleclass.h" @implementation globalvaraibleclass @end main: // // main.m // globalvar // #import <foundation/foundation.h> #import "globalvaraibleclass.h" int main(int argc, const char * argv[]) { @autoreleasepool { extern int gglobalvar; nslog(@"hello, world! %i", gglobalvar); } return 0; } where going wrong? that backwards, extern goes in header, declaration setting value goes in implementation file. the extern specifies variable declared somewhere else. if declaration in header every time header included there declaration , @

php - Multiple Laravel Apps Issue on shared hosting -

i've made 2 applications using laravel, locally works fine. when deploy them shared hosting having different domain each 1 face kind of colison. public_html(www folder) -project1 -app -... -public (www.app1.com points public folder on project1) -project2 -app -... -public (www.aap2.com points public folder on www.app2.com) both projects works without problem but! when enter example www.app1.com/hello , in tab enter www.app2.com, second 1 displays error, says "hello" route doesn't not exits, , correct because app2 doesnt have route named "hello" why app2 using somehow routes app1 if there in differnt folders. need please...

Python: TypeError: 'str' object is not callable Rating System -

when run code: def printpredictions(matches): ppredictiontable = prettytable() ppredictiontable.field_names = ["player 1", "player 2", "difference", "winner"] match in matches: p1 = match['teama'] p2 = match['teamb'] if match['abeatb'] == true: ppredictiontable.add_row([match['teama'], match['teamb'], match['difference'], p1]) else: ppredictiontable.add_row([match['teama'], match['teamb'], match['difference'], p2]) print(ppredictiontable) printpredictions(pmatches) i error: traceback (most recent call last): file "c:\users\ericr_000\desktop\pydev\npa-2-rating-system\rankings.py", line 645, in <module> printpredictions() typeerror: 'str' object not callable i have pmatches separate dictionary, , don't have coding skills fix issue. (line 145

wolfram mathematica - NIntegrate with and without MaxRecursion -

ran mathematica code using nintegrate containing integration on spherical , normal bessel functions. 1.would answer in 2 cases change if use maxrecursion number of recursions , don't use it? 2. , matter if use global adaptive strategy? 3. in case want exclude singularity points x variable, use {x,a,b,c,d} , b singular points , c , d integration limits.

Python - Issues with selenium button click using XPath -

i'm using following code click button on page xpath keeps changing code keeps breaking: mydriver.find_element_by_xpath("html/body/div[2]/div[3]/div[1]/div/div[2]/div[2]/div[4]/div/form[2]/span/span/input").click() is there better way should doing this? here code button trying click: <input class="a-button-input" type="submit" title="button 2" name="submit.button2-click.x" value="button 2 click"/> xpath intelligent. more simple search that: mydriver.find_element_by_xpath("//input[@name='submit.button2-click.x']") which tells: search input elements name equals 'submit.button2-click.x' element of choice. don't forget try firefix xpath checker add-on before going code.

MySQL multiple group by using -

now using query : select * messages receiverid='$uid' or senderid='$uid' group recei verid,senderid order datex desc but results id receiverid senderid 1 2 1 2 1 2 but want showing 1 result syntax. example: id receiverid senderid 1 2 1 or id receiverid senderid 2 1 2 you want use least() , greatest() : select * messages receiverid='$uid' or senderid='$uid' group least(receiverid, senderid), greatest(receiverid, senderid) order datex desc; however, should list columns explicitly in select . using mysql extension have columns in select not in group by . bad idea unless understand doing.

Why are my different instance variables linking together in python -

i new python did digging , understand member variable of class update in instances of class regardless of instance modified with. however, doesn't seem same should happen instance variables when run block of code... class game(object): def__init__(self, active_turn, board): self.active_turn = active_turn self.board = board game = game(1,[1,0,0,0,0,0,0,0,0]) move = 3 print(game.board, "\n") possible_game = game(game.active_turn*-1,game.board) print(game.board) print(possible_game.board, "\n") possible_game.board[move] = possible_game.active_turn print(game.board) print(possible_game.board, "\n") game.board[move+1] = game.active_turn print(game.board) print(possible_game.board) i output... [1, 0, 0, 0, 0, 0, 0, 0, 0] [1, 0, 0, 0, 0, 0, 0, 0, 0] [1, 0, 0, 0, 0, 0, 0, 0, 0] [1, 0, 0, -1, 0, 0, 0, 0, 0] [1, 0, 0, -1, 0, 0, 0, 0, 0] [1, 0, 0, -1, 1, 0, 0, 0, 0] [1, 0, 0, -1, 1, 0, 0, 0, 0] the board variabl

How can I get Jenkins to archive git difference between last build and latest one? -

so i'm trying jenkins make update.zip of changed files (including path) between last build git commit , latest one. i have script make full files zip , update zip if make multiple commits , push, make archive of latest commit. is there way can make archive of changed , new files in update zip previous build commit latest? zip -r -9 $workspace/builds/full-files-$build_number.zip files git archive -o $workspace/builds/update-$build_number.zip head $(git diff --name-only head^) (hopefully i'm explaining correctly) any appreciated. to this, need able retrieve last commit built. according git plugin documentation , should available in git_previous_commit environment variable. hence try getting diff using git diff --name-only $git_previous_commit

regex - JavaScript Encoding? -

i'm having little trouble javascript file not loading correctly on different computers. have line in javascript file: var url_regexp = /\b((?:https?:\/\/|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/gi; it loads fine on computer, on friends computer chinese operating system language, browser shows javascript error. on debugging code, found line has been served this: var url_regexp = /\b((?:https?:\/\/|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?芦禄鈥溾€æ¿ƒ€æ¨·€æ©¾))/gi; note random characters @ end of line. i'm guessing encoding problem... ideas on how solve this? should encoding javascript files in utf8 or something? if so, how? save file encoding or there java

sql - Create a mysql view that contains 1 field getting in two data -

table1 id | filename | created table2 id | filename | created (note: filename consists of images names) when run code below: 'column 'filename' in field list ambiguous' appears if specified the filename 'p.filename' create or replace view vmedia select filename table1 p1 left join table2 p2 question: possible make mysql view consists of 1 field has field data of 2 tables? this link answered question create view vmedia select 'table1media' which, id, filename, created table1 union select 'table2media' which, id, filename, created table2 union select 'table3media' which, id, filename, created table3 ;

functional programming - Purescript applicative does not execute -

this executes: main = ctx <- getcanvaselementbyid "stage" >>= getcontext2d bs <- initbranches tick 0 ctx bs but not: main = tick 0 <$> (getcanvaselementbyid "stage" >>= getcontext2d) <*> initbranches however both compile, , understanding both mean same basic thing. why case? can use applicative syntax here (its more understandable imho) this works main = <- (tick 0) <$> (getcanvaselementbyid "stage" >>= getcontext2d) <*> initbranches b <- fprint b main = join $ tick 0 <$> (getcanvaselementbyid "stage" >>= getcontext2d) <*> initbranches the applicative creates nested eff, join resolves easily

How to listen on select2 events in AngularJS -

select2 provides custom events , want able listen them, particularly 'select2-removed' or better yet custom 'change' event, , i’ve been searching internet example, no luck. here's i’ve done far: html: <input type="hidden" class="form-control" id="tags" ui-select2="modal.tags" data-placeholder="available tags" ng-model="form.tags"> javascript (angular) $scope.form = {tags: []}; postaltags = [ { id: 1, text: 'permanent address' }, { id: 2, text: 'present address' } ]; $scope.modal { tags: { 'data': postaltags, 'multiple': true } }; // doubt going work, since think going // listen on events emitted $emit , $broadcast. $scope.$on('select2-removed', function(event) { console.log(event); }); // can this, not know removed , added $scope.$watch('form.tags', function(data) { console.log(data); }); wh

Wicket: How to create a re-usable footer component section? -

how create component (like footer section) , include on page? i read stuff markup inheritance, doesnt sound right (how re-use footer section component in different pages when can inherit single page). this 2nd day of using wicket , wicket-library.com has great examples, @ moment seems down when try view source. thank you. create basepage header, footer, menu etc. extend pages page. use this: public class basepage extends webpage { public basepage() { add(new headerpanel("header"), new footerpanel("footer"), new menupanel ("menu" )); } } with html: <html xmlns:wicket> <body> <div wicket:id="header"> <div wicket:id="menu"> <wicket:child></wicket:child> <div wicket:id="footer"> </body> </html> you need create headerpanel, footerpanel , menupanel. your child page example: public class my

http - javax.net.ssl.SSLException: hostname in certificate didn't match android -

i creating android app in sending data web service getting error of javax.net.ssl.sslexception: hostname in certificate didn't match android here code asynchttpclient clien= new asynchttpclient(); log.i("url", string.valueof(base_url+"race.svc/json/race/scanners/add/"+series_event_raceid+"/"+qrcode)); clien.put(base_url+"race.svc/json/race/scanners/add/"+series_event_raceid+"/"+qrcode, new asynchttpresponsehandler() {} where series_event_raceid=103 , qrcode=r12g*** anyone please me here logcat 08-18 10:06:24.272: w/system.err(5297): javax.net.ssl.sslexception: hostname in certificate didn't match: <development.racerunner.com> != <racerunner.com> or <racerunner.com> 08-18 10:06:24.272: w/system.err(5297): @ org.apache.http.conn.ssl.abstractverifier.verify(abstractverifier.java:185) 08-18 10:06:24.272: w/system.err(5297): @ org.apache.http.conn.ssl.browsercompa

javascript - How to call dojo function on JSON object -

i working on project in dojo , struck @ point. i using dgrid in dojo generate table , need have checkbox in first column. here code working fine requirement different. i taking values headers , data json file here json file abc.json : { "properties": { "dataloading": "full", "classnames": ["abc"], "autorefresh": 60, "sort" : [ {"attribute":"raisetime", "decending":true} ] }, "columns": [ [[ { "field":"abc","label":"my label","sortable":true }, { "field":"def","label":"second label","sortable":true } ]], [[ { "field":"fgh", "label":"third label","sortable":true }, { "field":"ijk", "label":"fourth label","sortab

android - Intent passed into onHandleIntent is missing intent extras that I set -

i creating intent , adding string it, create pendingintent, given alarm manager execute: string value = "somevalue"; intent intent = new intent(this, fetchservice.class); intent.putextra(appconstants.key, value); alarmintent = pendingintent.getservice(this, 0, intent, 0); up until point, fine, , checked debugger set. next, when onhandleintent(intent) called inside service, doesn't seem exist anymore @override protected void onhandleintent(intent intent) { // app crashes here string value = intent.getstringextra(appconstants.key); ... } i can't seem figure out why not there. have missed something? thanks. was missing pendingintent.flag_update_current when creating pendingintent karakuri pointed out.

Join queries for multiples SOLR cores not working in SOLR 4.3 -

Image
as per threads is solr 4.0 capable of using 'join" multiple core? and https://issues.apache.org/jira/browse/solr-2272 solr 4.x supports join across multiple cores. tried , not giving response. details follows: two cores: proposition { stockitemid , name } stocks { mc , counts } here "mc" references "stockitemid" my query: {!join from=mc to=stockitemid fromindex=stocks} try using below code : {!join from=mc to=stockitemid fromindex=stocks}*:*

android- Expandable List not working inside viewpager fragment -

Image
i want have expandable list inside viewpager . viewpager child fragment . i've used tutorial : http://www.androidhive.info/2013/07/android-expandable-list-view-tutorial/ this fragment code : import java.util.arraylist; import java.util.hashmap; import java.util.list; import android.os.bundle; import android.support.v4.app.fragment; import android.view.layoutinflater; import android.view.view; import android.view.viewgroup; import android.widget.expandablelistview; public class resturant_menu extends fragment { expandablelistadapter listadapter; expandablelistview explistview; list<string> listdataheader; hashmap<string, list<string>> listdatachild; view v; @override public view oncreateview(layoutinflater inflater, viewgroup container,bundle savedinstancestate) { v = inflater.inflate(r.layout.resturantmenu, container, false); return v; } @override public void onactivitycreated(bundle savedinstancestate) { super.onactivitycreated(savedinst

c++ - Receive rtsp stream using gstreamer -

i want receive rtsp stream using gstreamer knw rtspsrc can used purpose problem receives client in case have ffmpeg application streams video client , waits server connect before streaming. want gstreamer act server , receive stream ffmpeg i haven't used myself, believe there separate package rtsp server functionality. in debian based systems should under like: libgstrtspserver-0.10-0

mysql - SQL insertion query receive Column count doesn't match value count at row 1 -

i try run sql query: insert answer_choice (id,text,question_id,is_correct) values (106189022,'11 wall street', true) i receive: #1136 - column count doesn't match value count @ row 1 how fix this? thanks, you trying insert 4 columns: -id -text -question:id -is_correct but use 3 values -106189022 -11 wall street -true if have field ai, dont use within insert arguement

java - Getting UTF8 strings directly from the web service call without conversion to String -

i'm using cxf implement web services server. since i'm low on memory don't want web service call parameters translated strings utf-16 rather access original utf-8 buffers half in size in case. if have web method: void addbook(string booktext) how can booktext without cxf translating java string? the xml parsers used in java (stax parsers cxf) allow getting xml contents either string or char[]. thus, wouldn't possible raw bytes.

java - Android Eclipse all Spinner fonts became white -

in project, spinner fonts became white reason can't find. before of them black. example, in spinner, dropdown list comes in white. it's xml file follows; <spinner android:id="@+id/mainactivity_spinner_city" android:fontfamily="roboto" android:layout_width="250dp" android:layout_height="wrap_content" android:layout_below="@+id/mainactivity_imageview_logo" android:layout_margintop="15dp" /> in order make sure, added #000000 related places, list still white. spinner gets populated following method; arrayadapter<string> dataadapter2 = new arrayadapter<string>(context, android.r.layout.simple_spinner_item, list); dataadapter2.setdropdownviewresource(android.r.layout.simple_spinner_dropdown_item); spinner.setadapter(dataadapter2); so added black color simple_spinner_item , simple_spinner_dropdown_item still no change. in java part, not related color. may causi

php - Why convert IP Address to Hostname by used "gethostbyaddr" but don't work? -

i try convert ip address hostname used "gethostbyaddr" don't work. use file.text log file analyze page user used lot or less. try cut sentence use array. code. $file=fopen("log.txt","r"); while (!feof($file)) { $buffer = fgets($file, 4096); $text= explode(" ",$buffer,10); $text_2=@$text[1]; $ip=substr($text_2,1,11); $ip2=gethostbyaddr($ip); echo"insert `log` values ('$ip2');"."<br>"; //show results //echo"<br>"; //new line } fclose($file); thanks that means gethostbyaddr failed. not because input, find explanation in php documentation http://php.net/manual/en/function.gethostbyaddr.php "returns host name on success, unmodified ip_address on failure, or false on malformed input."

c# - How to filter generic class for shim? -

i have generic class similar following public class helperclass<t> t : dbtable, new() { } i have shim class when compile code, warning. have added following line in .fakes <pre lang="c#"><add fullname="a.b.helperclass" /></pre> when set diagnostics = true, trying shim classes helperclass'1 how can apply filter in scenario? use following generate shims versions of generic type. <shimgeneration> </clear> <add typename="helperclass`1"/> </shimgeneration> if happen have non-generic class of same name, above not generate shims it. if wish generate them both, you'll need use following. <shimgeneration> </clear> <add typename="helperclass"/> </shimgeneration> lastly, if wish generate shims non-generic you'll need use following. <shimgeneration> </clear> <add typename="helperclass!"/> <

return - Request to join tables in argis with the option returnGeometry -

i have joined table in arcgis, when query data option returngeometry = true, query returns error "unable complete operation." if returngeometry put in false, query works correctly. has encountered problem , how solve it? also, if make request "return ids only", , further on download link go feature, error "invalid or missing input parameters." the reason in join table field name matching field containing oid.

oracle - How to show widememo column? -

Image
i'm searching informations in db of etl(genio) , i'm kinda lost. know if they're way remplace/show value of column "(widememo)" ? , is-it? thx in advice the (widememo) label hiding long or clob data (or potentially field defined varchar2 high maximum size - clients don't think toad does). you can click on hidden value see actual data within. and noted here , can turn on preview toad's menus: view => toad options => data grids => data => [x] preview clob , long data

ios - UIScreenEdgePanGestureRecognizer to activate SWRevealViewController pan gesture -

i using swrevealviewcontroller sidebars , have use swipe previous , next stories , edge pan sidebars. the reason use uiscreenedgepangesturerecognizer instead of pangesturerecogniser because swipe end call pan gesture causes whole page mess. hoping there way call pan gesture when edge pan recogniser activated instead of using this: [self.view addgesturerecognizer:[mainviewcontroller sharedinstance].revealviewcontroller.pangesturerecognizer]; [[bthomeviewcontroller sharedinstance].revealviewcontroller.pangesturerecognizer requiregesturerecognizertofail: left]; [[bthomeviewcontroller sharedinstance].revealviewcontroller.pangesturerecognizer requiregesturerecognizertofail: right]; i want use delegate of swrevealvc. if there other way, please suggest me. uiscreenedgepangesturerecognizer *panleft = [[uiscreenedgepangesturerecognizer alloc] initwithtarget:self action:@selector(_handlerevealgesture:)]; [panleft setedges:uirectedgeleft]; panleft.minimumnumberoftouches = 1; panleft

mongodb logfile entries 'end connection' -

i have mongodb 2.6.0 running on ubuntu 12.04 64-bit. database in replication set 1 node far. after running 3 weeks application uses mongodb hanged. @ excat time found following log entries in mongodb.log: 2014-08-17t06:41:27.408+0200 [clientcursormon] connections:8 2014-08-17t06:41:27.408+0200 [clientcursormon] replication threads:32 2014-08-17t06:45:20.863+0200 [conn2] end connection 127.0.0.1:40189 (7 connections open) 2014-08-17t06:45:20.863+0200 [conn1] end connection 127.0.0.1:40188 (7 connections open) 2014-08-17t06:45:20.866+0200 [conn3] end connection 127.0.0.1:40339 (5 connections open) 2014-08-17t06:45:20.866+0200 [conn7] end connection 127.0.0.1:60176 (4 connections open) 2014-08-17t06:45:20.866+0200 [conn8] end connection 127.0.0.1:60178 (3 connections open) 2014-08-17t06:45:20.867+0200 [conn6] end connection 127.0.0.1:51651 (2 connections open) 2014-08-17t06:46:27.451+0200 [clientcursormon] mem (mb) res:745 virt:51196 2014-08-17t06:46:27.451+0200 [clientcursormon]

ruby on rails - ArgumentError in mongoid-rspec -

when bundle exec rspec spec/controllers got: /var/lib/gems/1.9.1/gems/rspec-core-3.0.4/lib/rspec/core/hooks.rb:521:in `extract_scope_from': must explicitly give scope (example, context, suite) or scope alias (each, all) when using symbols metadata hook. (argumenterror) my gemfile: gem 'rails', '4.1.4' gem 'mongoid', '~> 4', github: 'mongoid/mongoid' gem 'sass-rails', '~> 4.0.3' gem 'uglifier', '>= 1.3.0' gem 'coffee-rails', '~> 4.0.0' gem 'jquery-rails' gem 'turbolinks' gem 'jbuilder', '~> 2.0' gem 'sdoc', '~> 0.4.0', group: :doc gem 'spring', group: :development group :development, :test gem 'rspec-rails', '~> 3.0.2' end group :test gem 'database_cleaner' gem 'factory_girl_rails' gem 'mongoid-rspec' end my spec_helper.rb: # spec_help

Swift: How to better format the output when using println with a tuple? -

i have defined function: func need_rebalance() -> (bool, rebalancestrategy) { } where rebalancestrategy enum type enum rebalancestrategy: string { case leftright = "leftright" case rightleft = "rightleft" } when tried print way, println("need rebalance? \(self.need_rebalance())") i got output this: need rebalance? (false, (enum value)) my questions are: 1) there easy extract value tuple? (hopefully similar python e.g. self.need_rebalance()[1]. apparently syntax not work in swift because tuple not support subscript() ) 2) how can print raw value of enum instead of having (enum value) ? i using xcode6 beta5 there's way extract value using tuple indexes, it's not nice, involves reflect : let tuple = self.need_rebalance() let reflection = reflect(tuple) reflection[0].1.value // -> true reflection[1].1.value // -> rebalancestrategy.? also, if tuple members not named: let tuple = self.need_re