Posts

javascript - How to show text overflow ellipsis in the middle of the text -

am using kendo grid fixed width. if text more showing ellipsis. can differentiate rows based on end of string. due effect unable find it. so, need ellipsis in middle of text. example: abcdefghijklm abcdefg... -> normal ellipse abcd...klm -> want need type of output one approach follows, though – of course – rely on javascript: function centralellipsis(opts) { // default settings, can overridden // user: var settings = { // number of original characters show: 'maxlength': 7, // character-sequence, or html character- // entity use replace missing characters: 'ellipsis': '…', // attribute you'd write // original text (this function write // text 'title' attribute though): 'writetoattribute': 'data-originaltext' }, // element upon we're working (cached // because we'll access more once): _this...

osx yosemite - django dev on mac having to explicitly name full path -

after long time away app wrote in django , didn't complete, i've come on new mac. i'm struggling code refer apps , files within them without explicit path. instance: from myproject.app.file import object whereas remember not having use myproject every time. is has changed? seem remember being add path in manage.py called every time run dev server, hasn't worked time. sys.path.append /path/to/myproject should fix issue i'm having? i started simple answer , grew more details on how add subdirectories of project python path. maybe bit off-topic, useful i'm pushing post button anyway. i have bunch of small re-usable apps of mine keep inside project tree, because don't want them grow independent modules. projet tree this: manage.py myproject/apps myproject/libs myproject/settings ... still, default, django adds project root python path. yet makes no sense in opinion have apps load modules full path: from myproject.apps.author.mo...

maven - NoClassDefFoundError: org/json/JSONObject - Hadoop MapReduce -

i'm trying mapreduce job using json input. imported json dependency in pom.xml , maven clean install run properly. when run jar in hadoop "noclassdeffounderror: org/json/jsonobject" error on mapper class. (i tried json java external jar, doesn't work. this test mapper class: package com.andrew.hadoopnba.nbajob1; import java.io.ioexception; import org.apache.hadoop.io.intwritable; import org.apache.hadoop.io.text; import org.apache.hadoop.mapreduce.mapper; import org.json.*; public class pointsrankingmapper extends mapper<object, text, text, intwritable> { public void map(object key, text value, context context) throws ioexception, interruptedexception { try { jsonobject jsn = new jsonobject(value.tostring()); system.out.println("printing json " + jsn); } catch (exception e) { // todo auto-generated catch block e.printstacktrace(); } } } and ma...

ios - How to download my object? (issue with optionals in old Xcode version) -

since developed app xcode 6.2, found problems, many solved, one, maybe requires rebuild app again. in code below, filterbyproximity function gives error. suppose matter of optionals (nils ziehn warned me here it). developer told me: "download position object using cache, , make query". well, possible? how can it? here code: import uikit import mapkit import corelocation class mapviewcontroller: uiviewcontroller, cllocationmanagerdelegate { @iboutlet weak var mapview: mkmapview! override func viewdidload() { super.viewdidload() // additional setup after loading view. var locationmanager = cllocationmanager() var lat = locationmanager.location.coordinate.latitude var lon = locationmanager.location.coordinate.longitude let location = cllocationcoordinate2d(latitude: lat, longitude: lon) let span = mkcoordinatespanmake(0.05, 0.05) let region = mkcoordinateregionmake(location, span) ...

spring boot - Accessing Twitter Data - Failed authentication with valid credentials -

i've downloaded code spring's started guide - accessing twitter data https://spring.io/guides/gs/accessing-twitter/ . i set credentials in application.properties , made no other changes. run app, , when attempts connect twitter, fails exception on connectcontroller line 240: resourceaccessexception: org.springframework.web.client.resourceaccessexception: i/o error on post request " https://api.twitter.com/oauth/request_token ":cannot retry due server authentication, in streaming mode; nested exception java.net.httpretryexception: cannot retry due server authentication, in streaming mode i have checked credentials being read app. valid - use them connect application i've written twitter4j, although in case use token , token secret in addition consumer key , consumer secret. any ideas? thanks i had same issue : happened because did not set callback url in twitter setting. just check in twitter app settings callback field se...

c# - DataBinding not working properly -

Image
i made code after deserialization populate datagrid there problem in population. code insert data in datagrid: var leaguetable_object = jsonconvert.deserializeobject<leaguetable.rootobject>(responsetext); foreach (var classifica in leaguetable_object.standing) { league_datagrid.items.add(new leaguetable.classifica(){ name = classifica.position + " " + classifica.teamname}); var name = new datagridtextcolumn(); name.binding = new binding("name"); league_datagrid.columns.add(name); league_datagrid.items.add(new leaguetable.classifica(){ points = classifica.points}); var points = new datagridtextcolumn(); points.binding = new binding("points"); league_datagrid.columns.add(points); league_datagrid.items.add(new leaguetable.classifica(){ playedgames = classifica.playedgames}); var playedgames = new datagridtextcolumn(); playedgames.binding = new binding(...

sorting - Basic Bubble Sort with ArrayList in Java -

i implementing comparator, , wasn't working, thought i'd write basic bubble sort. int[] numbers = { 5, 8, 14, 1, 5678 }; int tempvar; (int = 0; < numbers.length; i++) { for(int j = 0; j < numbers.length; j++) { if(numbers[i] > numbers[j + 1]) { tempvar = numbers [j + 1]; numbers [j + 1]= numbers [i]; numbers [i] = tempvar; } } } (int = 0; < numbers.length; i++) { system.out.println(numbers[i].tostring()); } is tutorial correct @ all? https://blog.udemy.com/bubble-sort-java/ i followed example , applied last names in arraylist, results bit wack. string a; string b; person c; person d; (int i=0; i< list.size(); i++){ for(int j=0; j< list.size()-1; j++){ = list.get(i).getlastname(); b = list.get(j+1).getlastname(); c = list.get(i); d = list.get(j+1); if ( a.compareto(b) < 0 ) { ...