Posts

java - Change Eclipse's project location in file-system -

i have project of eclipse located in folder on my local-disk. let's say: c:\proj1.0 , after while need change folder name proj2.0 (why? because started working on next version of application , want save time of creating new project in eclipse. older version stored in source control anyway) how can it? if try change project cannot found eclipse. didn't find eclipse configuration file absolute location of project defined. you have change project's name eclipse. in package explorer right-click project -> refactor -> rename . or click on project , press alt + shift + r . way no configuration lost. another way move project's folder right-clicking on project > refactor > move . alternatively, if renamed folder's name , cannot see project in eclipse anymore, can select file menu -> import -> existing projects workspace , navigate parent folder of project's folder, select projects want import , press finish.

java - JLabel - how to hide a text? -

i have jlabel icon , text. there possibility hide jlabel's text ? don't want hide whole component (setvisible(false)), text, icon remains visible. i'd still use gettext , settext methods. thanks help! as far i'm concerned, there's no direct way this. try of following: extend jlabel , override settext() , gettext() methods. these should store text give in new string field. every time call settext should delegate super.settext() label-text not invisible. add method switches visibility. if call settextvisibility() true, class should call super.settext() string of spaces. here's example of mean: public class mylabel extends jlabel { private string labeltext; private boolean labeltextvisible = true; private mylabel( string text, icon icon, int horizontalalignment ) { super( text, icon, horizontalalignment ); labeltext = text; } private mylabel( string text, int horizontalalignment ) { super( text, hori...

android - I changed package name, changed the app_name but installer still overwrites previous version -

for diagnostic purposes, trying install android device 2 different versions of same app. in order accomplish that, duplicated project , changed the: project name package name app name (as appears in application's "android:label" in androidmanifest.xml) however, when install modified app, overwrites older app (with different project name, package name , app name). apparently, missing else needs changed, in order let both projects exist on android phone side-by-side. what "something else"? i think need change package name text in android manifest. if change package in eclipse properties menu project, doesn't change actual androidmanifest.xml. edit: package name identified in androidmanifest.xml unique indetifier application, think, perhaps, not referencing root package of android project's source code. think it's best practice them 1 in same, see release alternate version of app (i.e. paid vs free) changing manifest appli...

python - Question Regarding API Design -

i in process of researching best "design-pattern" web api. using django web framework. created non-ajax interface causes entire page reload @ each request. now, starting incorporate ajax interface. sake of discussion, 2 example pieces of functionality need add api following 1) beta page: user supplies email address. want make ajax call serverside see if exists in db. initial design call view function similar to def check_email(request): if request.method == "post": # check db # return json true/false 2) profile picture uploads, new profile picture added page without full page reload as far can tell, best way via post call view function. then, response return json, can inject dom accordingly. can please let me know if on right track designing api? note: have checked out django-piston, , seems pretty useful also. thanks you're right on track, use request.is_ajax() check if it's ajax request return respon...

c# - Exiting a thread that does not have a loop -

i need way stop worker thread not contain loop. application starts thread, thread creates filesystemwatcher object , timer object. each of these has callback functions. have done far add volatile bool member thread class, , use timer check value. i'm hung on how exit thread once value set. protected override void onstart(string[] args) { try { watcher newwatcher = new watcher(...); thread watcherthread = new thread(newwatcher.watcher.start); watcherthread.start(); } catch (exception ex) { ... } } public class watcher { private volatile bool _stopthread; public watcher(string filepath) { this._filepath = filepath; this._lastexception = null; _stopthread = false; timercallback timerfunc = new timercallback(onthreadtimer); _threadtimer = new timer(timerfunc, null, 5000, 1000); } public void start() { this.createfilewa...

Get Youtube address in PHP -

i have got forum written in php. i need detect when posts youtube url , grab whole url/string. any ideas ? preg_match_all('/(http:\/\/www\.youtube\.com\/watch\?v=[^\s]*)/si', $str, $match_urls); this matches youtube video links.

javascript - Raphael js, animate along path problem -

i have defined 2 circles , 1 path, path connect center points of 2 circles: c1=r.circle(40, 40, 20).attr(dashed); c2=r.circle(140, 40, 20).attr(dashed); path = r.path("m 40 40 l 100 0"); i have feature when mouse click on path line, left circle c1 collapse right circle c2 (that's left circle c1 move , join right circle c2 ), , during process, path connect center points of 2 circles , that's path shorter , shorter 2 circles closer. i not sure how implement feature, tried thing like path.onclicke(){ c1.animatealong(path, 1000, true, function (){ c1.attr({cx: 140, cy: 40}); }); } but don't know how handle path, path getting shorter c1 closer c2. can help? i've done share of wrestling paths in last 2 weeks, assure you. happened notice .attr() , .animate() path objects can given entirely new path string (see documentation @ http://raphaeljs.com/reference.html#element.attr ). so, mocked example in horrible day-glo colors , got result...