Posts

Showing posts from March, 2012

amazon ec2 - Domain and subdomain setup in AWS Route 53 DNS Service -

i trying point domain.com , sub.domain.com same ec2 instance's elastic ip. here's how zone file looks like: domain.com - record - elastic_ip_address www.domain.com - alias - domain.com sub.domain.com - alias - domain.com. there soa , ns records domain.com i have tried making sub.domain.com record pointing same ip , no luck whatsoever. dns resolution failing sub.domain.com strange thing resolution not failing www.domain.com as such, visiting domain.com , www.domain.com function not sub.domain.com any idea going on? there more 1 way this, think want like: domain.com - record - elastic_ip_address www.domain.com - cname - domain.com. sub.domain.com - cname - domain.com. cname records non-alias.

osx - Signing a Package in MAC -

i have c++ code build on netbeans (8.0.1) on mac osx 10.10. now want package binary i'm using packagemaker. once build on packagemaker finishes asks sign it, clicked 'allow'. then open terminal , checked if package signed successfully, , got: codesign -v g16.pkg g16.pkg: code object not signed @ all. i login apple developer "certificates, identifiers & profiles" page , have: 2 developer id application certificate 4 developer id installer 1 mac app distribution 1 mac development 1 mac installer distribution in keychain have 1 certificate under "my certificate" , 6 under "certificate". so questions are: what differences between certificate? which certificate need use? what do wrong? please me!!! :) codesign signing of applications (not installers). should use productsign sign pkg files. certificate should using " developer id installer ". (full name of certificate shown in keychain) produ...

git - How can I see which branch contains a certain commit, when working with atlassian jira and stash -

we switched feature branch workflow git. our infrastructure based on atlassian tools jira, bamboo , stash. works pretty smooth , 3 tools share status. can create branch named jira ticket , trace complete workflow through jira , bamboo until released. but there seems 1 important missing feature: have situation jira ticket has plenty of subtasks or linked tickets. there no seperate branch referened tickets, commits go directly parent branch. lose traceability of subtasks; there seems no way in jira see in branch referenced ticket has been resolved. need know branch contains commits tickets. when have information, can deploy branch qs , present list of new features/fixes have been resolved in branch. do have similar problems or how solve this? i'm not sure follow question entirely, list branch(es) contains commit, git branch --contains <commit> .

php - PHPmyadmin upgrade / Loading forever while access any db -

i trying upgrade phpmyadmin on hosted server. have asked hosting provider company said me that, manually need upgrade phpmyadmin using, server's command line using following command: /usr/local/cpanel/bin/updatephpmyadmin my concern can write thing on hosted server. ? i new php developer , first experience hosting site. on host server when ever try access db "loading" remain forever. phpmyadmin version on hosted server 4.0.10.7 (lasted 1 4.4.10) some people claiming same issue resolved upgrading phpmyadmin latest version. think upgrading phpmyadmin might solve issue well. any appreciated. for have faced issue, it might possible in channel/whm password have used special character (i have used "pound" symbol not accepted in system. think should stick use standard symbol printed on keyboard.) i have change password , working. hope information other well. thanks

objective c - NSEvent addGlobalMonitorForEventsMatchingMask:NSLeftMouseDownMask call two times -

i'm adding event nsleftmousedownmask function: mouselefclick = [nsevent addglobalmonitorforeventsmatchingmask:nsleftmousedownmask handler:^(nsevent *leftmousedown) { nslog(@"!!"); }]; when press first time it's call right when press second time function it's call 2 times , other clicks it's going right except second one. please me! thx!

go - Correct use of XML annotations, fields and structs in custom UnmarshalXML function -

consider following struct: type mystruct struct { name string meta map[string]interface{} } which has following unmarshalxml function: func (m *mystruct) unmarshalxml(d *xml.decoder, start xml.startelement) error { var v struct { xmlname xml.name //`xml:"mystruct"` name string `xml:"name"` meta struct { inner []byte `xml:",innerxml"` } `xml:"meta"` } err := d.decodeelement(&v, &start) if err != nil { return err } m.name = v.name mymap := make(map[string]interface{}) // ... mxj magic here ... - temp := v.meta.inner prefix := "<meta>" postfix := "</meta>" str := prefix + string(temp) + postfix //fmt.println(str) mymxjmap, err := mxj.newmapxml([]byte(str)) mymap = mymxjmap // fill mymap //m.meta = mymap m.meta = mymap["meta"].(map[string]interface...

how to draw a text on a circle in SWIFT -

Image
i have no clue how start , not have code. research far pointed out, there no standard functionality , has coded our self ? any hint or confirmation ? update using coretextarcview, suggested ashish. thanks helping. sample project suggested works me. can see blue circle text on it. integrating project, have problems. did following i added files "coretextarcview.h" , "coretextarcview.m" project. can see them in explorer left. in bridgingheader.h added import : #import "coretextarcview.h" i added codesample : var arctext : coretextarcview = coretextarcview(frame: cgrectmake(50, 50, 200, 200), font: uifont.systemfontofsize(15), text: "hello radious arc text", radius: 85, arcsize: 130.0, color: uicolor.redcolor()) arctext.backgroundcolor = uicolor.clearcolor() self.view.addsubview(arctext) -> compile errors in coretextarcview.m : /users/user/desktop/prototypes/coretextarcview.m /users/user/desktop/prototypes/coretextarcvie...

Actionbar title font not changing in android -

i want change custom font action bar title, have gone through couple of accepted answers,but no luck,i have tried below,but custom font not applied actionbar title,please me rid of this,my code below: java typeface font = typeface.createfromasset(getactivity().getassets(), "neuropolx.ttf"); spannablestring s = new spannablestring( " kolay randevu"); s.setspan(new customtypefacespan("", font), 0, 4, spanned.span_exclusive_inclusive); getactivity().getactionbar().settitle(s); changing actionbar title font not supported, can use custom view action bar. use custom view , disable native title. display between icon , action items. can inherit activities single activity, has code in oncreate: this.getactionbar().setdisplayshowcustomenabled(true); this.getactionbar().setdisplayshowtitleenabled(false); layoutinflater inflator = layoutinflater.from(this); ...

How to connect specific attributes over polar coordinates in R? -

Image
i have highlighted specific activities (feeding,resting , sleeping) dataset in plot. want connect these highlighted points in sequence on polar coordinates. here's dataset: activity latitude longitude feeding 21.09542 71.06014 resting 21.09564 71.06064 sleeping 21.09619 71.06128 walking 21.09636 71.06242 walking 21.09667 71.06564 resting 21.09483 71.06619 can me out in this? ok starting scratch: original answerwas bulky , inflexible. just add following paths each activity without filtering. + geom_path(aes(colour=activity,x=latitude,y=longitude)) if want plot selected activities: + geom_path(data=data[data$activity %in% c("sleeping","resting"),],aes(colour=activity,x=latitude,y=longitude)) the selected activities listed in c(...) vector each name quoted. update: op clarified wants connect stationary point, achieved running following: + geom_path(data=data[data$activity!="walking",],colour="...

ember.js - Sending an action from a child component and catching it in a parent component -

ember: 1.13.2 i can't seem working. parent/child widget (gridster-container/gridster-widget) {{#gridster-container}} {{#each model |widget|}} {{#gridster-widget sizex=widget.sizex sizey=widget.sizey action="addwidget"}} ... {{/gridster-widget}} {{/each}} {{/gridster-container}} gridster-widget export default ember.component.extend({ tagname : 'li', sizex : 1, sizey : 1, widget : null, didinsertelement : function() { var sizex = this.get('sizex'); var sizey = this.get('sizey'); //this.get('parentview').addwidget(this, sizex, sizey); //this.send('addwidget', this, sizex, sizey); //this.sendaction('action', this, sizex, sizey); //this.attrs.action(this, sizex, sizey); //this.get('gridstercontainer').send('addwidget', this, sizex, sizey); //this.action(this, sizex, sizey); this.sendaction('action', this,...

python - how to support my existing django app with new linkedin api changes? -

i have used linkedin oauth2 in application, used api https://api.linkedin.com/v1/people/~/connections but new api changes not allow me details of person. i getting error httperror @ /complete/linkedin-oauth2/ 403 client error: forbidden starting may 12, 2015 , linkedin has limited open apis. access connections requires apply , granted access information linkedin. you have apply become member of relevant partner program. linkedin team review application , reply within 15 business days. eligibilty criteria linkedin parner program: (taken linkedin page. ) you can use apis if: you developing application designed linkedin members more productive , successful across web; example, augmenting profile , professional brand in application publishing, discussing , sharing content like-minded professionals. your application not expected to: have more 250,000 lifetime members; make more 500,000 daily calls api; make more 500,000 lifetime people search calls api;...

ios - Memory Growth Mystery (Objective-C) -

i have memory growth issue in app. since describing full code here intimidating, narrowed down simple scenario switch , forth between 2 view controllers learn basic memory dynamics. - (void)viewdidload { [super viewdidload]; (int i=0; i<100000; i++) { __weak nsstring* str = [nsstring stringwithformat:@"abcsdf"]; str = nil; } } this supposed show no memory growth, because allocate 'str' , deallocate 'str' making 'str' becomes nil, losing owner. but, memory keeps growing. everytime load view controller, memory keeps growing , never coming back. can tell me why that? using arc. your code snippet includes several interesting things ios/os x memory management. __weak nsstring* str = [nsstring stringwithformat:@"abcsdf"]; str = nil; the code same following without arc. nsstring* str = [[[nsstring alloc] initwithformat:@"abcsdf"] autorelease]; str = nil; because stri...

html - ReturnURL messed up when a page links to itself -

i have home.aspx , about.aspx in root directory, account folder included login.aspx , register.aspx , manage.aspx . i have navbar includes links relevant pages depending on whether user logged in or not. suppose if @ login.aspx page , clicks again on link /login.aspx , return url becomes returnurl="localhost:xxxx/account/account/login.aspx" if click on register.aspx now, becomes account/account/account/register.aspx what called , how rectify it? think need make virtual root directory relative addresses resolved. hrefs this, <li id="registerlink" runat="server"><a href="account/register.aspx"><span class="glyphicon glyphicon-user"></span> register</a></li> <li id="loginlink" runat="server"><a href="account/login.aspx"><span class="glyphicon glyphicon-log-in"></span> login</a></li> you use relative ancho...

.net - Is it possible to specify nuget local server source for individual solution? -

Image
i wondering how specify nuget local server single solution don't want add on visual studio level. when push code bitbucket , wants bamboo use source nuget, want specify somewhere in solution. nuget local source the above link think proposing solution problem. have tried nuget.config file still using default nuget source. , not sure put nuget.targets file. may might wrong where. can please guide me? possible or not. , should do. thanks. you can specify nuget sources in nuget.config file. file part of solution , configuration used on build server not depend on whatever settings have in visual studio. first step enable nuget package restore (which have). right-click on solution in solution explorer , select enable nuget package restore . add .nuget folder in solution , in folder find file nuget.config . then need modify nuget.config file adding local nuget repository: <?xml version="1.0" encoding="utf-8"?> <configuration> ...

css - Selenium - unable to locate element for static text -

i trying find test-335 modal html snippet under: <p class="statictext" data-name="title" data-reactid=".7.0.0.1">test-335</p> i using below code-snippet: by.cssselector("div[id=" + name + "] input[data-name=title]"); but throws error below: "org.openqa.selenium.nosuchelementexception: unable locate element: {"method":"css selector","selector":"div[id=instviewfileservermodal] input[data-name=title]"}" -- suggestions if requirement not confined css, can use xpath below fetch text directly: by.xpath("//p[.='test-335']") this fetch p tag exact innerhtml or inner text test-335 .

I need to properly remove MemSQL from a node -

i think un-installed memsql improperly. 1 one of nodes, memsql service still running when service --status-all. it's gone on other nodes can't seem remove one. if running memsql 4 , using memsql ops set cluster, can use memsql-ops memsql-delete option remove 1 or more memsql nodes. if did not use memsql ops, can stop memsql service going memsql home directory (usually /var/lib/memsql) , running ./service stop. if @ possible, recommend installing memsql cluster memsql ops. it's quickest way , running memsql, , simplest way manage distributed memsql cluster. learn more here: http://docs.memsql.com/4.0/setup/setup_onprem/

javascript - How to add a file jquery on view razor? -

Image
i have view , works fine as see have added section (required:false) on _layout , until there not problem, @model final2.models.objetosunidos.helperventa @{ viewbag.title = "index"; } @* <> *@ @section javascript { <script type="text/javascript"> $(document).ready( function () { var $loading = $('#cargando').hide(); $(document) .ajaxstart(function () { $loading.show(); }) .ajaxstop(function () { $loading.hide(); }) $("#btnselectcliente").click( function () { $("#diviniciarventa").hide(); $.when( $.ajax({ type: "post", datatype: "html", url: '@url.action("mostrarcuerpo", "v...

shell - run command line sqlite3 query and exit -

we can use -cmd option sqlite3 run query, sqlite3 opens database , waits in there interactive input. how can run query on sqlite3 command line , exit? thanks, just include command in quotes after database file argument. for example, following creates table called abc : sqlite3 test.db 'create table abc (col0 int)'

c# - Unity3d trigger event action to change a text in a canvas after another object passes through a trigger -

i'm having trouble script in unity tried didn't work public collider a; public text text; void update(){ if(a.collision.tag == "object") text.text = "trigger works"; } then attached game elements public variables in editor. first update not monobehaviour function. update . secondly should watch this . you need add collider gameobject set colliders is trigger field true. after need add ontriggerenter and/or ontriggerexit and/or ontriggerstay script. for example: //public collider a; public text text; void update(){ //dont need use update. } void ontriggerenter(collider other) { if(other.gameobject.tag == "object"){ //set text whatever want. } }

animation - Multiple CSS transitions -

i having problem getting 2 transitions work together. the second animation works (partially) swing effect seems reset , stop repeating after while , first animation doesn't work @ all. this animation code: .box{ width:250px; height:50px; background:blue; border: 1px solid black; position:fixed; left: 50%; margin-left:-125px; top:0px; animation-name: fall; animation-duration: 1.5s; animation-timing-function: ease-in; animation-name: swing; animation-duration: 4s; animation-iteration-count:infinte; animation-timing-function: ease-in-out; animation-delay: 1.4s; } @-moz-keyframes fall{ {top: -50px;} {top: 0px;} } @-webkit-keyframes fall{ {top: -50px;} {top: 0px;} } @-moz-keyframes swing{ -moz-transform-origin: center top; 0%{-moz-transform:rotate(-3deg)} 50%{-moz-transform:rotate(-2deg)} 100%{-moz-transform:rotate(-3deg)} } @-webkit-keyframes swing{ -webkit-transform-origin:c...

ios - Xcode 6.2 "Invalid Argument" error upon adding folder reference -

every time add folder reference ios project , run on ios simulator, xcode fails run app on simulator error message "invalid argument". while have read other threads error occurred after adding third party sdks, error if follow steps below: create new xcode project (objective c), , save it. select "add files to..." project explorer, , select folder files. select "create folder references" , leave "copy files project folder" unchecked, in dialog box. try run project on ios simulator. most likely, problem xcode installation. has seen error before? now, cannot make project run again on simulator removing folder reference. i got same problem when developer hybrid app. i not sure if works you. clean build. delete app in simulator. hope helps you.

Sorting Integers in Assembly -

project create bubble sort algorithm in assembly sort given list of integers. i've got ascending down , output correct extent. seems when combining order of numbers gets mixed up, here's mean: 10 -20 5 12 30 -5 -22 55 52 0 number of integer = 10 ascend_or_descend = 1 0 5 10 12 30 52 55 -22 -20 -5 here's code including main method given test: #include <stdio.h> #include <stdlib.h> #include <string.h> #include <io.h> int sorter (int* list, int count, int opcode) { __asm { mov eax, 0 ; 0 out result mov ebx, opcode ; move opcode ebx comparison mov ecx, count; //outerloop counter cmp ecx, 1; //check length jle return; outerloop: mov edi, list; //move in list push ecx; mov ecx, count; dec ecx; //decrement inner loop innerloop: mov eax, [edi]; //first value in list cmp ebx, 1; je ascending; cmp eax, [edi+4]; //next int 4 bits away jb swap; jmp continue; ascending: ...

Override android:vmSafeMode attribute for debug builds -

while trying optimize build , deployment speed debugging app found large chunk of time spent executing /system/bin/dex2oat during installation. art ahead of time compiler . i found when targeting api 22 can stop art aot compilation: <application ... android:vmsafemode="true"> </application> i saw noticeable deployment speed improvement, have concerns possible side effects of making change. must cause small runtime performance hit, there other consequences of enabling android:vmsafemode option? is possible override attribute, debug builds, in gradle build file? or creating debug specific manifest file solution? the best way enable android:vmsafemode debug build using debug manifest complement contents of main androidmanifest.xml. to add this, create new file …/app/src/debug/androidmanifest.xml , add following xml: <manifest xmlns:android="http://schemas.android.com/apk/res/android"> <application android:vm...

angularjs - angular how to pass an object from controller to service -

i have in controller retrieve , object inside $scope.formdata. angular.module('starter.controllers', []) .controller('logincontroller', function($scope, authentication){ $scope.formdata = {}; $scope.processform = function(){ authentication.login($scope.formdata); //$http({ // method : 'get', // url : 'http://localhost:8888/employees/login', // params: $scope.formdata //}) // .success(function(respond){ // $scope.state.go('main'); // }) } }) in service js have method called login suppose retrive data sent controller, far im getting value null when console.log(formdata),. angular.module('starter.services', []) .factory('authentication', function($http){ this.login = function(formdata){ console.log(formdata); return $http({ method : 'get', url : 'http://localhost:8888/employees/login', par...

php and deleteing variable on from 2 array -

array1 ( [0] => 14 [1] => 9 [2] => 10 [3] => 11 ) array2 ( [0] => 8 [1] => 9 [2] => 10 [3] => 11 [4] => 12 [5] => 13 [6] => 14 [7] => 15 [8] => 16 [9] => 17 [10] => 18 [11] => 19 [12] => 20 [13] => 21 [14] => 22 [15] => 23 [16] => 24 some function delete array1 values on array 2 , create array3 whit results ? thanks ! the array_diff function you're looking for. credit paulpro source of found function: https://stackoverflow.com/a/7241152/4912760 . code example case: $array3 = array_diff($array2, $array1);

ember.js - Conditionally starting and ending a div using each helper -

i using bootstrap , need conditionally start <div class="row"> depending on index of item; in case, each row has 2 items. {{#each items |item index|}} {{#if item.isstartrow}} <div class="row"> {{/if}} ...my code here {{#if item.isendrow}} </div> {{/if}} {{/each}} the trouble htmlbars validates div has starting , ending tag, therefore above not work. can suggest workaround? the end result if there 6 items in array: <div class="row"> <div class="col-md-6">item 1...</div> <div class="col-md-6">item 2...</div> </div> <div class="row"> <div class="col-md-6">item 3...</div> <div class="col-md-6">item 4...</div> </div> <div class="row"> <div class="col-md-6">item 5...</div> <div class="col-md-6">item 6...</div> ...

java - Expected BEGIN_OBJECT but was STRING with custom TypeAdapter -

Image
so i'm trying solve problem have custom typeadapter gson , retrofit. keep getting expected begin_object string error i'm not sure how solve it. getting expected begin_array string error , solved that. i'm not sure if needs same way new error. i've listed classes below , appreciated. json looks here: http://pastie.org/private/bfo86iznldacbz10rtsdsg main problem multimedia field in json. it's empty string if there no value if there value, returns jsonarray contains jsonobjects. arrayadapter.java import java.io.ioexception; import java.util.arraylist; import java.util.list; import com.google.gson.gson; import com.google.gson.gsonbuilder; import com.google.gson.typeadapter; import com.google.gson.stream.jsonreader; import com.google.gson.stream.jsontoken; import com.google.gson.stream.jsonwriter; public class arrayadapter<t> extends typeadapter<list<t>> { private class<t> adapterclass; public arrayadapter(class<t> ada...

ios - Unable to display data in the second view controller using segue [Swift] -

i need pass data 1 view controller view controller. used segue (detail) , define model class named "photo". tableviewcontroller looks following: var photos = [photo]() //strongly typed swift array override func viewdidload() { super.viewdidload() var newphoto = photo(name:"cat ", filename:"cat", notes:"cat_file") photos.append(newphoto) var newphoto2 = photo(name:"r2 ", filename:"r2", notes:"r2") photos.append(newphoto2) } and other view controller (detailviewcontroller) looks following: import uikit class photodiplayviewcontroller: uiviewcontroller { var currentphoto: photo? @iboutlet weak var currentimage: uiimageview! @iboutlet weak var currentlabel: uilabel! override func viewdidload() { super.viewdidload() var image = uiimage(named: currentphoto!.filename) self.currentimage.image = image se...

php - How to call a function inside an array that save matches rules -

i'm trying call function inside 1 array using matches. i have string text ($text) , 2 arrays. the array have rules find content: $a=array('rule1', 'rule2', rule3'); the array b have: $b=array("rule 1 return matches: $1 $2 $3", "rule 2: $1 $2 $3", "rule 3 $1 $2 $3"); and foreach loop, arrays make work: foreach($a $key => $val){ while(preg_match($val, $text)){ $text = preg_replace($val, $b[$key], $text); } } exist method? array b: $b=array("rule 1 return matches:".calltofunction("$1$2$3")."", ... i tried use \1 , $1 matches, when call function every time function receives string "$1$2$3" or "\1\2\3" not matched values. regards! this seems not possible, array save rules, yes can used save rules. b needed make custom function per each one. function myfunction($text) { return preg_replace_callback($a[the num id], function($ma...

python - Error during compiling with PyInstaller under Windows XP (not English) -

i have next app.spec file - run python binaries under windows xp , try compile pyinstaller under windows xp (russian localization) i got follow error: 1763 info: processing hook hook-email.message traceback (most recent call last): file "c:\anaconda\scripts\pyinstaller-script.py", line 9, in <module> load_entry_point('pyinstaller==2.1', 'console_scripts', 'pyinstaller')() file "c:\anaconda\lib\site-packages\pyinstaller\main.py", line 88, in run run_build(opts, spec_file, pyi_config) file "c:\anaconda\lib\site-packages\pyinstaller\main.py", line 46, in run_buil d pyinstaller.build.main(pyi_config, spec_file, **opts.__dict__) file "c:\anaconda\lib\site-packages\pyinstaller\build.py", line 1911, in main config = configure.get_config(kw.get('upx_dir')) file "c:\anaconda\lib\site-packages\pyinstaller\configure.py", line 146, in ge t_config find_pyz_dependencies(con...

Get value from Android listview and put it in extra -

in code below created method is: put variable in putextra can in new activity. problem in new activity gave me first value( numtelephone ) first element in list. know because of getitem(0), how can value( numtelephone ) every element list? public class listclient extends activity { string myjson,test; textview numt; private static final string tag_results="result"; private static final string tag_nomclient = "nomclient"; private static string tag_numtelephone ="numtelephone"; private static final string tag_depart ="depart"; private static final string tag_destination ="destination"; private static final string tag_nbrpersonne ="nbrpersonne"; jsonarray peoples = null; arraylist<hashmap<string, string>> personlist; listview list; @suppresslint("newapi") @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstanc...

c# - Stream reader.Read number of character -

is there stream reader class read number of char string or byte byte[] ? forexample reading string: string chunk = streamreader.readchars(5); // read next 5 chars or reading bytes byte[] bytes = streamreader.readbytes(5); // read next 5 bytes note return type of method or name of class not matter. want know if there thing similar can use it. i have byte[] midi file. want read midi file in c#. need ability read number of bytes. or chars(if convert hex). validate midi , read data more easily. thanks comments. didnt know there overload read methods. achieve filestream. using (filestream filestream = new filestream(path, filemode.open)) { byte[] chunk = new byte[4]; filestream.read(chunk, 0, 4); string hexletters = bitconverter.tostring(chunk); // 4 hex letters need! }

c++ - How to detect declaration of class at compile-time? -

i'm use 3-rd party library @ project. after updating new version of library i'm faced errors. one class have method virtual rtspserver::rtspclientsession* createnewclientsession(u_int32_t sessionid)override; but in new version of library declaration of rtspclientsession moved class , renamed. correct name genericmediaserver::clientsession i need code correctly compiles versions of library. at gcc use following code: #ifdef rtspserver::rtspclientsession using clientsessionclass = rtspserver::rtspclientsession; #else using clientsessionclass = genericmediaserver::clientsession; #endif class { ......... virtual clientsessionclass* createnewclientsession(u_int32_t sessionid)override; }; but not work in msvc 2010. how can detect declaration should use? upd: code gcc don't work old version of library :( "how can detect declaration should use?" you need introduce discriminator library version you're using current ...

c# - Calculate PDF page height and width -

i've checked around , see potential solutions question, plus have potential solution i'll explain in question, i'm going try , reach angle. i'm using pdf4net convert computer output laser disc (cold) documents pdf. these cold documents plain text, not appear on standard page sizes (ie. letter, tabloid, legal, etc...) , i'm not able pull page size information document itself. causes issue, when tried convert them portrait (8.5 x 11) page, single line may end wrapping on next line. want able avoid this. here knowns use when try convert document: cold document - know length of longest line of characters , know number of lines on page. font - resulting pdf document courier size 10 margins - margins can vary each document have available dpi - 72 (pdf's default dpi) with these knowns determine length longest line of characters with: size textsize = textrenderer.measuretext(longestline, new font("courier", 10, fontstyle.regular, graphics...

java - How to put this piece of code into an AsyncTask or a Thread -

im new in threads , asynctask's , know how can run following code in background: i have method checks if have active internet conection, im trying show progressdialog before calling method , dismissing dialog when succeed or fail: oncreate: progress = progressdialog.show(this, "dialog title","dialog message", true); if(isonline()){}else{} my method. public boolean isonline() { try { process p1 = java.lang.runtime.getruntime().exec("ping -c 1 www.karlol.com"); int returnval = p1.waitfor(); boolean reachable = (returnval==0); canshowview = true; progress.dismiss(); return reachable; } catch (exception e) { // todo auto-generated catch block e.printstacktrace(); } return false; } the method works (it tells me if there's active internet connection) problem alertdialog not working to, im pretty...