Posts

Showing posts from September, 2015

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/

sql - In-memory table multiple INNER JOIN -

i trying update report in ssrs. query build colleague using stored procedure, whom has left project , can't contact anymore. used in-memory table batches in order add aggregations. the columns outputs are: batchid transformdate sourcesystem companytype max(b.footerlines) footertotallines max(src.totallines) sourcetotallines max(balancinglinestable.balancinglines) balancinglines sum(stg.totallines) stagingtotallines (cast(stg.company int) * 1000000) + b.batchid companycode however need add column called balancing lines. developed query , works: select count(0) "balancing lines" [source].[staging].[transactionline] t inner join [source].[staging].headerline h on t.headerid = h.headerid h.batchid = 1234* , h.sourcesysteminstance = 'abc' , accountnumber = '98765' *1234 should variable -> b.batchid , soursesysteminstance 'abc'-> b.sourcesystem but, stored procedure written collegue still foreign me. know how 'add...

php - laravel 4 authentication check always returns false -

i'm making application in laravel 4 , i've run problem. so far have tried make authentication system. followed several tutorials none of them seem work. possibly because tutorial outdated (laravel evolving constantly). here's situation: i have login form, form authenticates user. , works fine, code in routes.php file. route::post('login', function () { $user = array( 'e-mail' => input::get('e-mail'), 'password' => input::get('password') ); if (auth::attempt($user)) { return redirect::route('home') ->with('flash_notice', 'you logged in.'); } // authentication failure! lets go login page return redirect::route('login') ->with('flash_error', 'your username/password combination incorrect.') ->withinput(); }); so when log in go home page , message displayed, no problems there. in view hav...

java - How can I get SQL print statements in Flyway logs? -

i have sql stored procedure prints line when exception occurs. not getting print statements in flyway logs, though debug mode on. begin transaction if object_id('dbo.sp_test') not null begin begin try exec dbo.sp_test end try begin catch print 'error occured'; end catch end commit transaction this not supported. please file issue , specify dbms type , version.

csv - VBScript to loop through all files in a folder -

i have code carry out process on single file, alter script loops through files in directory "h:\letter display\letters" file type " .ltr " , saves them all: const forreading = 1 const forwriting = 2 set objfso = createobject("scripting.filesystemobject") set objfile = objfso.opentextfile("h:\letter display\letters\ltrprt__00000008720000000001ni-k-rmnd.ltr", forreading) str1000 = "1000" str1100 = "1100" str1200 = "1200" str9990 = "9990" arrcommas1 = array(14,31,41,59,70,81,101,111,124,138) arrcommas2 = array(14,31,41,55,79,144,209,274,409,563,589,608,623) arrcommas3 = array (14,32,41,73,83,97,106,156,167,184,188,195,207,260,273,332,368,431,461,472,593,617,666,772,810,834,848,894,898) arrcommas4 = array(14,31,41) until objfile.atendofstream strline = objfile.readline if left(strline, 4) = str1000 intlength = len(strline) each strcomma in arrcommas1 strline =...

sql - Table without clustered indexes -

i m trying idea indexes , began this msdn article. says, when table stored heap, individual rows identified reference row identifier (rid) consisting of file number, data page number, , slot on page. i have no idea mean "file number, data page number, , slot on page" can clarify please? when using clustered table, index records store clustered key (logical identifier) of table record. say, if use clustered primary table this: id name 1 jonh 2 alice and create index on name , index store data: name row_pointer alice 2 john 1 if table heap, index store physical pointers table: name row_pointer alice <file c:\program files\microsoft sql server\mssql10_50.mssqlserver\mssql\data\db.mdf, page 1234, slot 2> john <file c:\program files\microsoft sql server\mssql10_50.mssqlserver\mssql\data\db.mdf, page 1234, slot 1> (this of course looks more compact in real binary form) file self-explanatory, page 8k block in...

css - Bootstrap - padding in span makes it bigger -

<div class="row"> <div id="cover" class="span12"></div> </div> <div class="row"> <div id="first_left" class="span6 left"> <h3>aa</h3> </div> <div id="first_right" class="span5"> ee </div> </div> and less: #cover{ background: url('couv.jpg') no-repeat; width: 960px; height: 280px; } h3{ color: #212121; font-size: 18px; font-weight: normal; float: left; text-transform: uppercase; margin: 0 0 25px 0; text-shadow: 1px 2px 2px #fff; } .left{ background: url('grille.jpg'); padding: 15px; } the "first_right" span displays below first_left, , if 15px padding present. padding 15, first_left becomes 490px wide instead of 460px. why ? also, ok have padding on span if want nest more r...

javascript - How to insert a callback function correctly so as to let one function end and then execute another -

i have simple slider jscript hovers thumbnails left or right depending on button click. <script> $(document).ready(function() { $(".right-arrow").click(function(){ $(".box1").animate({right:"1100px"},800); $(".box2").animate({right:"1100px"},1000); $(".box3").animate({right:"1100px"},1200); $(".box4").animate({right:"1100px"},1400); $(".box5").animate({right:"1100px"},1600); $(".box6").animate({right:"1100px"},1800); $(".box7").animate({right:"1100px"},2000); $(".box8").animate({right:"1100px"},2200); $(".box9").animate({right:"1100px"},2400); $(".box10").animate({right:"1100px"},2600); $(".box11").animate({right:"1100px"},2800); $(".box12").animate({right:"1100px"},3000); }); $(".left-arrow").click(function(){ $(...

dll - Attempted to read or write protected memory. This is often an indication that other memory is corrupt in c# (Access violation) -

[unmanagedfunctionpointer(callingconvention.cdecl)] public delegate int decompressmcx(object hcomp,ref byte[] @in, uint @in_len, ref byte[] @out, ref uint out_len, bool eod); public class xceedcompressor { [dllimport("kernel32.dll")] public static extern intptr loadlibrary(string dlltoload); [dllimport("kernel32.dll")] public static extern intptr getprocaddress(intptr hmodule, string procedurename); byte[] outrec = new byte[1024 * 100]; uint outlen; decompressmcx decompressdelegate; int b ; unsafe int l; public xceedcompressor() { intptr pdll = loadlibrary(@"xceedzip.dll"); intptr paddressoffunctiontocall = getprocaddress(pdll, "xcuncompress"); decompressdelegate = (decompressmcx)marshal.getdelegateforfunctionpointer(paddressoffunctiontocall, typeof(decompressmcx)); } public byte[] decompress(byte[] inrecarr) { outlen = 0; l = decompre...

c - Checking username: getpwnam / getpwnam_r: No such file or directory -

i'm trying make web logging , use getpwnam() function check username existing. valid username getpwnam returns error: no such file or directory. tried getpwnam_r() , failed same error. i'm running on embedded arm linux , use /etc/passwd password storing (i don't have /etc/shadow ). test program is: #include <pwd.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <errno.h> int main(int argc, char *argv[]) { struct passwd pwd; struct passwd *result; char *buf; size_t bufsize; int s; if (argc != 2) { fprintf(stderr, "usage: %s username\n", argv[0]); exit(exit_failure); } bufsize = sysconf(_sc_getpw_r_size_max); if (bufsize == -1) /* value indeterminate */ bufsize = 16384; /* should more enough */ buf = malloc(bufsize); if (buf == null) { perror("malloc"); exit(exit_failure); } s = getpwnam_r...

java ee - Eclipse build path warning -

i can not deploy java ee app on glassfish have build path warning on problems view: description resource path location type classpath entry eclipse.fproj.jdt.libprov.osgi/jpt.jpa marked publish/export not exported on project classpath. classpath visibility within eclipse , @ runtime differ. declaration-reglementaire-dao p/declaration-reglementaire-dao classpath dependency validator message and one: description resource path location type facet version enterprise application project declaration-reglementaire-ear must 5.0 contain java ee 5.0 project declaration-reglementaire-serviceweb. declaration-reglementaire-ear p/declaration-reglementaire-ear enterprise application validator message solved it. had marked java ee module dependency, didn't have selected export. in project properties window went java build path > order , export , placed check next entry osgi bundels (jpa).

jquery - Isotope - Start with specific category rather than All elements -

i have small issue isotope plugin. when web page loaded, isotope display elements. i'd have display single category instead. how can achieve it? thanks in advance help! just supply filter in options of initial call isotope select items want: $('#someid').isotope({filter: '.someclassonmycategoryelements'}); ps. if show existing code, have context work :)

Neo4j Spatial- two nodes created for every spatially indexed node -

i using neo4j 1.8.2 neo4j spatial 0.9 1.8.2 ( http://m2.neo4j.org/content/repositories/releases/org/neo4j/neo4j-spatial/0.9-neo4j-1.8.2/ ) followed example code here http://architects.dzone.com/articles/neo4jcypher-finding-football 1 change- instead of spatialindexprovider.simple_wkt_config, used spatialindexprovider.simple_point_config_wkt everything works fine until execute following query: start n=node:stadiumslocation('withindistance:[53.489271,-2.246704, 5.0]') return n.name, n.wkt; n.name null. when explored graph, found data: node[80]{lon:-2.20024,lat:53.483,id:79,gtype:1,bbox:-2.20024,53.483,-2.20024,53.483]} node[168]{lon:-2.29139,lat:53.4631,id:167,gtype:1,bbox:-2.29139,53.4631,-2.29139,53.4631]} for node 80 returned, looks node created spatial record, contains property id:79. node 79 actual stadium record example. as per source of indexprovidertest , comments //we not longer need node 'real' node // node node = db.getnodebyid( (lon...

ajax - Automate AJAXed forms with Jquery -

i want improve website , figured out way submitting forms via ajax. but, have many forms inpractical $('#formx').submit(). wondering if there way automatically making universal markup like; <form class="ajax_form" meta-submit="ajax/pagename.php"> <input type="text" name="inputx" value="x_value"> <input type="text" name="inputy" value="y_value"> </form> and have submit ajax/pagename.php, automatically includes inputx , inputy? not save me lot of time lot of lines of code written. first question hope it's not stupid 1 :) something should work forms. it uses jquery - available in project? specific code chunk hasn't been tested per say, use method time. is wonderful time saver. notice changed meta-submit data-submit value can fetched using $('.elemenet_class').data('submit'); html <!-- note: form items must have unique '...

c# - How to render the XML Document in partial view with XSL? -

please note, have xml file contains such information display user. , have got xsl file contains style information of content display. i wrote following action in controller return view contains xml file contents. public actionresult geterror() { xmldocument xdoc=getxmlerror(); return view(xdoc); } [#geterror.cshtml] @model system.xml.xmldocument @mvchtmlstring.create(model.innerxml).tohtmlstring() but screen renders xml has retrieved string not html string. means printing xml sent. i have included xsl file in corresponding view folder. i have no clue of further proceedings. could me resolve out render xml in specified style format? finally got output. thank @sundar g comment. i changed controllers below, public actionresult geterror() { xmldocument xdoc=getxmlerror(); xslcompiledtransform xsl = new xslcompiledtransform(); xsl.load(@"d:\development\test.xsl"); xmlreader xreader = xmlreader.create(new stringreader(xdoc.innerxml)); ...

php - JQuery Validator - Success function not being called on valid submission -

i using jquery validator from: http://bassistance.de/jquery-plugins/jquery-plugin-validation/ i have written jquery need validates correctly last part of submit function not working correctly. $("#commentform").validate({ rules: { email_options_name: { required: true }, email_options_company: { required: true }, email_options_country: { required: true }, email_option_email: { required: true, email: true }, check_options: { required: true, minlength: 1 } }, }); $("#commentform").submit(function(){ var valid = $("#commentform").valid(); if (valid) { $.post('scripts/process_email_initial_form.php',$(this).serialize(), function(o) { location.reload(); }, 'json'); } else { $...

Activity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@405aeb60 that was originally added here -

i know there plenty of answer topic... not able find solution problem. simple, activity: public class dialogsactivity extends activity { bundle bundle=new bundle(); string token; @override protected void onresume() { // todo auto-generated method stub super.onresume(); mostrardialogo(); } @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.dialogsactivitylayout); bundle=getintent().getextras(); token=bundle.getstring("token"); token=token.replaceall("\\s+",""); log.i("parse", "token: "+token); } private void mostrardialogo() { if(token.equals("nologin")){ alertdialog.builder nologin = new alertdialog.builder(dialogsactivity.this); nologin.settitle(r.string.loginstring); nologin.setmessage(r.string.nologin); nologin.setnegativebutton(r.string.cancel, new dial...

php - Pagination with codeignator not working properly -

i applied pagination shows whole result on 1 page or if applied limit in query showing same 20 results on every page....plz me this controller file: public function hhh($offset = 0 ) { $sql_query = "select username valenth_user banned=1 limit 0,20"; $query = $this->db->query($sql_query)->result_array(); $data["pages"]=$query; $this->load->library("pagination"); $config = array(); $row = count($pages); $config['base_url'] = base_url().'/test/hhh/'; $config['total_rows'] = 120; $config['per_page'] = 20; $config['uri_segment'] = 3; $this->pagination->initialize($config); //$data['pages'] = $this-db-get('valenth_user', 10, $offset); $this-load-library("pagination"); $this-template-load('template/template','onlinee',$data); //$data['pages'] = $this->db->...

NSRangeException NSArray objectAtIndex: index 11 beyond bounds for empty array Objective C -

i have search bar searches 4square api venues. sometimes when search specific word , scroll down app crashes empty array. below code , error code. *** terminating app due uncaught exception 'nsrangeexception', reason: '*** -[__nsarrayi objectatindex:]: index 11 beyond bounds empty array' *** first throw call stack: (0x335683e7 0x3b259963 0x334b321d 0xc7ce3 0x353c2569 0x353a7391 0x353be827 0x3537a8c7 0x35126513 0x351260b5 0x35126fd9 0x351269c3 0x351267d5 0x35126639 0x3353d941 0x3353bc39 0x334af263 0x334af0c9 0x3708d33b 0x353cb2b9 0xc173d 0x3b686b20) libc++abi.dylib: terminate called throwing exception (lldb) libsystem_kernel.dylib`__pthread_kill: 0x3b74d348: mov r12, #328 0x3b74d34c: svc #128 0x3b74d350: blo 0x3b74d368 ; __pthread_kill + 32 0x3b74d354: ldr r12, [pc, #4] ; __pthread_kill + 24 0x3b74d358: ldr r12, [pc, r12] 0x3b74d35c: b 0x3b74d364 ; __pthread_kill + 28 0x3b74d360: .long 0x0...

r - Access a single cell / subsetted column of a data.table -

how can access single cell in data.table in way data.frame : mdf <- data.frame(a = c("a", "b", "c"), b = rnorm(3), c = 1:3) mdf[ mdf$a == "b", "c" ] [1] 2 doing analogue on data.table data.table returned including key column(s): mdt <- data.table( mdf, key = "a" ) mdt[ "b", c ] c 1: b 2 mdt[ "b", c ][ , c] [1] 2 did miss parameter or has done in last line? either of these avoid repeating c not efficient since involve computing first [] final answer: > mdt[ "b", ][["c"]] [1] 2 > mdt[ "b", ][, c] [1] 2

html - How align center text in custom buttons? -

Image
i have html <head> <title>html5 app</title> <link rel="stylesheet" type="text/css" href="css/custom.css"> <link rel="stylesheet" type="text/css" href="css/buttons.css"> </head> <body> <!--estructura --> <div id="botones"> <button class="btn" data-am-type="button">soy un &lt;button&gt;</button> <a class="btn" data-am-type="button">soy un &lt;a&gt;</a> <div class="btn" data-am-type="button">soy un &lt;div&gt;</div> <input class="btn" type="button" value="soy un <input>"> </div> </body> in < button > , < input >, text align center of button in < > , < div >, text shown top of button. think < button > , < input > inherit property ...

sending serialization file via sockets in java -

system.out.println("java awesome!"); pardon enthusiasm; can't believe how powerful java is, ability not save objects (and load them), main purpose, send them on network. must do, conducting beta-test. in beta-test, have given testers version of game saves data objects in location people don't know (we enlightened ones hahaha). work fine , dandy, except isn't meant long-term persistence. but, collect record.ser , counter.bin files (the latter tells me how many objects in record.ser ) via client/server interaction sockets (which know nothing about, until started reading it, still feel clueless). of examples have seen online (this 1 example: http://uisurumadushanka89.blogspot.com/2010/08/send-file-via-sockets-in-java.html ) sending file stream of bytes, namely objectoutputstream , objectinputstream. current version of game using save/load gamedata. sorry long-winded intro, know have (steps-wise, can understand) send whole file. have reconstruct file byte-b...

ios - Which iTunes user can upload binaries? -

Image
i have give contractor access our itunes account. has upload binaries ios app , send review. upload binaries xcode directly. which itunes role should give him? technical maybe? technical correct. can see in image below, technical user has read/write capabilities in "manage applications" section of itunes connect, illustrated green "check". admin, , legal work well.

winforms - changing the forecolor in array of dynamically created combobox based on item in c#.net -

i have change forecolor of 30 combobox* s * created dynamically , forecolor schould based on item value. as, i'm having dynamic array of combobox cant so... please me. code sample: public partial class form1 : form { combobox[] cb = new combobox[28]; private void form1_load(object sender, eventargs e) { (int ii = 0; ii < 28; ii++) { cb[ii] = new combobox(); cb[ii].name = "cb"+ii.tostring(); cb[ii].items.add("ok"); cb[ii].items.add("not ok"); if (cb[ii].items.tostring().equals("ok")) { cb[ii].forecolor = color.black; } else { cb[ii].forecolor = color.red; } } } new code: private void comboboxselectedindexchanged(object sender, eventargs e) { messagebox.show("event raised"); combobox sendercombobox = (combobox)sender; if (sendercombobox.selectionlength > 0) { ...

memory management - Find the content of java.exe process apart from the HeapDump and ThreadDump -

i have java program in quite more number of operations on object of class. object created inside loop runs finite number of time. once loop completed, call system.gc() clear used space in heap. process java.exe in task manager still uses more ram. there way find stored inside process? or there method perform dump , compare in readable form? your java.exe won't free memory has once allocated. garbage collection frees other processes inside java program. if topic interesting you, should read documentation memory handling inside java. complex answered appropriately here. have here pointers: https://softwareengineering.stackexchange.com/questions/176880/which-part-of-the-memory-is-used-for-the-garbage-collector

Image Duplication in FANCYBOX -

the first image duplicating. after clicking on target image, photo1 displays twice before photo2 , photo3. script: <script type="text/javascript"> $(document).ready(function(){ $(".fancybox5") .attr('rel', 'gallery') .fancybox({ openeffect: 'elastic', preveffect: 'fade', nexteffect: 'fade' }); }); </script> html markup: <div> <a class="fancybox5" href="#inline5"> <div id="pics"><img src="images/pic.png" width="165" height="167" alt="pics" border="0" /></div></a> <div id="inline5" style="width:100%;display: none;"> <a class="fancybox5" href="media/photo3.jpg"><img src="media/photo3.jpg" width="400" height="500" /></a> <div class="hidden"> ...

android.database.sqlite.SQLiteException: Can't downgrade database from version 58 to 55 for android sms database -

i crash in android application when tries read android sms database. code reading android sms database similar following snippet: string sms_uri = "content://sms/"; uri uri = uri.parse(sms_uri); cursor cursor = mycontext.getcontentresolver().query(uri, null, null, null, null); this place application interacts android sms database. downgrade error being thrown sms database. i following crash: java.lang.runtimeexception: android.database.sqlite.sqliteexception: can't downgrade database version 58 55 @ to.talk.utils.exceptionthrowingfuturetask$1.run(exceptionthrowingfuturetask.java:32) @ java.lang.thread.run(thread.java:856) caused by: java.util.concurrent.executionexception: android.database.sqlite.sqliteexception: can't downgrade database version 58 55 @ java.util.concurrent.futuretask$sync.innerget(futuretask.java:223) @ java.util.concurrent.futuretask.get(futuretask.java:82) @ to.talk.utils.exceptionthrowingfuturetask.done(exceptionthrowingfuturetask...