Posts

html - Trying to extract MRTG info from a webpage using curl and sed -

This summary is not available. Please click here to view the post.

java - Using an Integer ArrayList in Android -

i needing creating arraylist , adding integers them. essentially, have card game pulls card , saves id (bcid). want add pulled id arraylist, can avoid pulling same card twice. have setup below, keep getting duplicates. know cards pulling correctly, displays fine - repeated cards, unfortunately. any can provide great! have done best include relevant parts. if need additional information, let me know. public static integer bcid1, bcid2, bcid3, bcid4, bcid5, bcdcid; public static list<integer> usedcards = new arraylist<integer>(); in example below, supposed detect duplicate initialize sequence draw different card. public static void setids() { try { bcid1 = integer.parseint(bc1); usedcards.add(bcid1); } catch(numberformatexception nfe) { } try { bcid2 = integer.parseint(bc2); if (usedcards.contains(bcid2)) { try { bluecard2(ctx); } ...

java - Simple conditional on scanned input -

this question has answer here: how compare strings in java? 23 answers i've written simple program check if input letter o or not. reason, when type letter o, program outputs input not letter o. have used eclipse debugger ensure input variable equals "o". import java.util.scanner; public class scannertest { public static void main(string[] args) { scanner scan = new scanner(system.in); system.out.println("give input. tell if input 'o' or not"); string input = scan.next(); if (input == "o"){ system.out.println("your input 'o'"); } else { system.out.println("your input not 'o'"); } } } you need use equals method instead of == operator, this: if(input.equals("o")) using == compares memory address of string objects...

HTML in Google App Engine -

i have been following this example google's site, having trouble understanding of how underlying things work. mostly, when submit text, in mainhandler html, how know use guestbook? assume has <form action="/sign" method=post> , ('/sign', guestbook) i'm not entirely sure how works. from google.appengine.ext import db import webapp2 class greeting(db.model): content = db.stringproperty(multiline=true) date = db.datetimeproperty(auto_now_add=true) class mainhandler(webapp2.requesthandler): def get(self): self.response.write('hello world!') self.response.write('<h1>my guestbook</h1><ol>') #greetings = db.gqlquery("select * greeting") greetings = greeting.all() greeting in greetings: self.response.write('<li> %s' % greeting.content) self.response.write(''' </ol><hr> <for...

Iterating a knockout observable array in javascript -

how iterate knockout observable array bound data knockout js mapping plugin ?. have created this fiddle demonstrate issue. when try value of knockout js array object returns function instead. could please me out in matter ?. code shown below. //sample json array var data = [{"street":"2532 falkark dr", "lat":"39.926295", "lng":"-86.012919", "zipcode":"92256"},{"street":"8558 appleby ln", "lat":"39.922742", "lng":"-86.017637", "zipcode":"92256"}] function viewmodel() { var self = this; self.addresses = ko.observablearray([]); ko.mapping.fromjs(data, {}, self.addresses); } var viewmodel = new viewmodel(); //function binding work order details view $(document).ready(function () { ko.applybindings(viewmodel); gothroughtheobservablearray(viewmodel.addresses()); }); function gothroughtheobservablearray(addressarra...

ruby on rails - How do I disable keep alive with HTTPClient? -

i using httpclient . is there way disable keep-alive/persistent connections when making request? possible if server serves web pages has keep-alive on? if it's not possible httpclient, possible other libraries such net:http or curb?

xcode4.5 - Cocos2D Score Counter will not count score -

i making game in cocos2d. made score counter on screen, , when hit enemy adds point score. when run it, , when hit enemy project terminates. it because of this: format specifies type 'id' argument has type 'int', referring line of code: - (void)addpoint { score = score + 1; // score++; work. [scorelabel setstring:[nsstring stringwithformat:@"%@", score]]; } it says wants me replace @"%@" @"%d", because not make score work, please me fix this. thank you! yes, replace %@ %d. score integer, question has answer..why asked here? [scorelabel setstring:[nsstring stringwithformat:@"%d", score]];

Route Not Being Hit In ASP.NET MVC 4 Child Class -

why first route being skipped second? first route has base controller class of second route, widgets inherits events, events "registration" method keeps getting hit. url widgets/v1/registrationwidget?eventid=3762 route routes.maproutelowercase( "defaultwidget", "widgets/v{version}/{action}widget", new { controller = "widgets", action = "notfound", version = 1, slug="event" }, new { version = @"\d+" } ); routes.maproutelowercase( "namedevent", "{id}/{slug}/{action}", new { controller = "event", action = "index", slug = "event" }, new { id = @"\d+" } ); widget controller public partial class widgetscontroller : eventcontroller { public virtual actionresult registrationwidget(int version, int? eventid, str...

vba - if statement with getelementbyclass -

first off, relatively new programming. have been making myself familiar vba. have asked questions here before , far responses have been helpful trying luck again. i going site: http://www.otcmarkets.com/stock-screener i want script like: if elementclassname("listingodd").innertext = "usa, nv" getelementsbyclassname("listingoddlistingodd whitespacenormal").innertext i loop through , click next button behind html until completed : href="javascript:void(null);">next & gt;/a any welcomed, have been searching through past questions , watching tutorials , not asking if not banging head on one. lot in advance this code have tried, following error: "object doesnt support method" there lot commented out trial , error sub t() dim ie object set ie = createobject("internetexplorer.application") ie.visible = false ie.navigate "http://www.otcmarkets.com/stock-screener" doevents loop until ie.read...

**reading url from browser using qt** -

i'm trying develop application listens specific port (for example 9999) in localhost. how retrieve url when user types <127.0.0.1:9999/somedir> in web browser? to retrieve url have implement pieces of http protocol. this official documentation of http protocol. if want path of entered url, can parse of request data. following example of http request made browser: get /index.html http/1.1 host: www.example.com the first word @ first line command performed. next, path @ server, , protocol , version. next line (at example) specify host. used example server provide many web sites. feature called virtual host. it important note each line of http request , response separated \r\n characters. take @ http protocol on wikipedia . start implement basic functionality.

Image and media banks for user content in Plone -

this might more of user question rather developer question. developers should able offer insights. for person creating , editing content, what's best practice store images associates pages? (i'm referring plone folder, not file system directory). should stored inside same folder content item itself? or subfolder within working directory? or special directory writeable storing images? if sort of shared image upload plone folder, permissions on plone folder be? once again, i'm referring of course plone folder, not file system directory. i see in site admin tinymce options can configure default paths image uploads. how user won't overwhelmed images in common images folder? (in other words, can see , edit own image uploads). this serious weakness in plone, in sense there no "best or more oftenly recommended way". @keul highlighted, plone flexible enough support every imaginable usecase, nevertheless can't see of consensus - neither se...

jQuery + Web Service + Cross Domain -

i have web service , calling jquery, works fine until remain on same server, when try call service other domain don't please me. below code : $.ajax({ type: 'post', url: 'http://-----------/service.asmx/bulkupdate', data:"{'caseid': '"+caseid+"'}", contenttype : "application/json; charset=utf-8;", "datatype" : "json", success: function(xdata, status) { alert(xdata.d); } ,error : function(xhr) { alert(xhr.responsetext); } }); try using jsonp, if cross domain issue. below "datatype":"jsonp" or you can configure server allow request other domain. fine think. hope solves question.

Is exit needed after return inside a php function? -

<?php function testend($x) { if ( ctype_digit($x) ) { if ( $x == 24 ) { return true; exit; } else { return false; exit; } } else { echo 'if not digit, you\'ll see me.'; return false; exit; } } $a = '2'; if ( testend($a) ) { echo 'this digit'; } else { echo 'no digit found'; } ?> is exit needed along return when using them inside php function? in case, if evaluated false, i'd end there , exit. no it's not needed. when return function code after not execute. if @ did execute, stop dead there , not go calling function either. exit should go according php manual if called within function, return statement ends execution of current function, , returns argument value of function call. return end execution of eval() statement or script file. whereas, exit , according php manual termina...

java - Maven Building Error -

when try run mvn clean package i getting following error downloading: http://repo.maven.apache.org/maven2/org/apache/maven /plugins/maven-clean-plugin/2.4.1/maven-clean-plugin-2.4.1.pom [info] ------------------------------------------------------------------------ [info] reactor summary: [info] [info] ycsb root ......................................... failure [21.334s] [info] core ycsb ......................................... skipped [info] cassandra db binding .............................. skipped [info] hbase db binding .................................. skipped [info] hypertable db binding ............................. skipped [info] dynamodb db binding ............................... skipped [info] elasticsearch binding ............................. skipped [info] infinispan db binding ............................. skipped [info] jdbc db binding ................................... skipped [info] mapkeeper db binding .............................. skipped ...

uiactivityviewcontroller - iOS Style Buttons in share sheet -

Image
is there anyway style buttons mail sheet created uiactivityviewcontroller share screen called via code -(void)sharelink:(id)sender{ post *post = [self.linkviewitems objectatindex:self.swipedpath.row]; nsmutablestring *txt = [[nsmutablestring alloc] init]; [txt appendstring:[post description]]; [txt appendstring:@" "]; [txt appendstring:[post href]]; nsstring* sometext = txt; nsarray* datatoshare = @[sometext]; // ...or whatever pieces of data want share. uiactivityviewcontroller* activityviewcontroller = [[uiactivityviewcontroller alloc] initwithactivityitems:datatoshare applicationactivities:nil]; [self presentviewcontroller:activityviewcontroller animated:yes completion:^{}]; } try this mfmailcomposeviewcontroller *picker = [[mfmailcomposeviewcontroller alloc] init]; picker.mailcomposedelegate = self; [[picker navigationbar] settintcolor:[uicolor clearcolor]];//you can set colour ...

sql - How can I model the following scenario using a single primary key instead of a compound primary key? -

suppose modelling athletics event. primary key date, track , race_no. class event(models.model): date = models.datefield() race_no = models.integerfield() track = models.charfield(max_length = 4) temperature = models.integerfield() class race(models.model): date = models.datefield() race_no = models.integerfield() track = models.charfield(max_length = 4) athlete_id = models.foreignkey(athlete) finishing_pos = models.integerfield() now suppose wish provide form users particular event. input date, race_no , track. in results wish provide event results along temperature. trivial sql joins. django @ moment not have lot of support compound keys. how can model use case single auto incrementing primary key, more django friendly. use unique_together . way can have incrementing ids on when put form unique key. you define unique_together in class' meta class. class race(models.model): date = models.datefield() ...

Type mismatch error while reading lotus notes document in vb6 -

am trying read lotus notes document using vb6.i can able read values of type mismatch error throwed.when reintialise vb6 variable works stops after point. ex; address field in lotus notes lsaddress=imsfield(doc.address) private function imsfield(pvalue) imsfield=pvalue(0) end function like reading remaining fields @ point runtime error "13" type mismatch error throwed. i have manually reintialize set doc=view.getdocumentbykey(doclist) the type mismatch error occurs field. issue should data type incompatibility. try figure out field causes error. use getitemvalue() instead of short notation accessing fields , don't use imsfield() : lsaddress=doc.getitemvalue("address")(0)

shell - unix linux shellscript programming printing input arguments containing multiple words -

i trying write shell script 1st 2nd , 3rd...n argument contains multiple words mailing_list="abc@gmail.com xyz@gmail.com zed@gmail.com" echo $mailing_list mailing "error in job" " there records couldn't loaded db" " " $mailing_list now want print mailing list in function can use send email obviously no of mails in mailing list can change , forth . kindly me issue. p.s if use echo $# gives me no of args 6 requirement print/get mailing list in function .. enclose variable in quotes, since arguments separated spaces: echo "$mailing_list" mailing "error in job" " there records couldn't loaded db" " " "$mailing_list" just did "error in job" . if had left quotes out, there have been 8 arguments.

c# - Serializing an instance of an Interface that have a definition of a list of another interface -

this might sound repeated question other topics, defers in interface definition. i have interface, lets named iclass1 , contains in definition list of interfaces, iclass2 i have business unit implement interface; implementation naturally this class class1: iclass1 { ....whatever properties list<iclass2> dataitems { get; set; } } class class2:iclass2 { ...whatever properties } the problem that, xmlserilizer complain list in class1, because interface! question is: simply, know type of instances should de-serialized in dataitems list, of type class2, how tell xml serializer that? i've saw lot of workarounds, using dummy properties , ignore list of interfaces during serializing/de-serializing process suitable 1 think, , i don't want invent own serializer or re implement serialization in classes if using datacontracts, can use knowntypeattribute give deserializer list of 1 or more types should use when deserializing. the version takes str...

c# - Redemption Cannot Resolve User error -

when trying send mail, box fill in exchange server, username , password. work's fine. when try send mail error. (jit) the error code: http://pastebin.com/n1b1cxyz my programming code: http://pastebin.com/e2pqkjpb i appreciate help! are using redemption 5.4? broke smtp name resolution in getsharedmailbox/getshareddefaultfolder. try use version 5.5 - http://www.dimastr.com/redemption/history.htm also note there redemption specific mailing list @ http://tech.groups.yahoo.com/group/outlook-redemption/