Posts

Showing posts from May, 2012

android - App returns to home screen, when add is displayed using TimerTask() -

it's first app create , new android , i designing app displays advertisement screen, every 1 minutes when user opens app , the advertisement screen works expected ,but problem when advertisement screen exit , app gets returned home screen no matter user in activity screen the app flow splashscreen.java --> adsplash --> diamondworldmenus ( home screen ) diamondworldmenus .java public class diamondworldmenus extends tabactivity implements onclicklistener { on create(.......){ public void startadsplashforevery1minutes(){ //starting adsplashtimer.java every 5 minutes timer mytimer = new timer(); mytimer.schedule(new timertask() { @override public void run() { runonuithread(new runnable() { @override public void run() { // todo auto-generated method stub int

java - Sql binding in Spring throws org.skife.jdbi.v2.exceptions.UnableToExecuteStatementException -

Image
im making spring mvc web application. database access i'm using sql binding. running yesterday encountered unabletoexecutestatementexception when tried edit user data web app. this code i've errors per stacktrace. public string edituser (userdto objuserdto) { handle objhandle = objbaseservice.gethandle(); objhandle.createstatement("update user set email = :email," + "usertypeid = :usertypeid," + "username = :username," + "trackinginterval = :trackinginterval," + "enablewebcam = :enablewebcam," + "showcaptureinfo = :showcaptureinfo," + "showseverinfo = :showserverinfo," + "autologin = :autologin," + "remarks

c# - Can't get favicon from instagram -

i need retrieve favicon of instagram. program can parse html code , retrieve appropriate url of icon: http://d36xtkk24g8jdx.cloudfront.net/bluebar/d1f7ba7/images/ico/apple-touch-icon-precomposed.png . can't read icon program because instagram puts bytes in beginning, middle , end of file when program tries download it: var wc = new webclient(); var iconbytes = wc.downloaddata(@"http://d36xtkk24g8jdx.cloudfront.net/bluebar/d1f7ba7/images/ico/apple-touch-icon-precomposed.png"); var converter = new imageconverter(); var image = (image)converter.convertfrom(iconbytes); // crash here 'parameter invalid' i tried save png file web browser directly. analyzed content , came conclusion bytes array webclient returns identical contains 15 bytes in beginning, 8 bytes in end , 5 bytes in middle of array. can clean 'salt' beginning , end based on knowledge of png format, have no idea how remove garbage middle of array. could please me figure out how download ,

git - Disable 'reformat code' checkbox in commit dialog of PHPStorm by default -

i'm pissed off phpstorm having feature enagled default. have unckeck each toime commit something. if forget, silently line truncations , other stuff don't like. there way set checkbox unckecked default? sorry, incorrect. remembers checkbox configuration each time commit. seemed doing while. if open commit window, change checkboxes , close it, doesn't memorize anything. i think post can deleted, because of uselessness.

javascript - Trying to move the submit button to the bottom of the page -

how move move button bottom of page? tried , not working. have tried margin-bottom: 0px; button still not move bottom <form tag="create logon"> <div id="layer"> </div> <div class="left"> fistname *: </div> <div class="right"> <input type="firstname" name="firstname" style="width: 300px; font-size: 14pt; margin-left: 40px;" /> </div> <div class="right"> <input type="username" name="username" style="width: 300px; font-size: 16pt; margin-left: 40px;" /> </div> <div class="left"> password *: </div> <div class="right"> <input type="password" name="password" style="width: 300px; font-size: 16pt; margin-left: 40px;" /> </div> <p>note: ple

Jquery stop queueing while animation is not finished on hover -

i checked out few posts , tried put either stop() or filter(':not(:animated)') avoid queueing animations on hover doesn't work. page won't load anymore everytime try add function in code. <div id="competences"> <div id="logocomp"> <div> <img id="devlogo" src="img/logodev.png" /> <p>developpement</p> <p>- html/css -</br> - javascript -</br> - php -</br> - java -</p> </div> <div> <img id="responsivelogo" src="img/responsive.png" /> <p>responsive</p> <p>ce site est responsive et la plupart de mes projets le sont également.</p> </div> <div> <img id="logoprint" src="img/logoprint.pn

mysql - how to make magento search functionality faster? -

i have developed magento website searching product catalogue slow. how can improve searching speed? here website. http://kawasakiretail.com/ is flat catalog on or not.if not switch on. use solr search might need purchase solr bridge extension. make sure have optimized magento : tweaking magento performance link has lots of magento speed optimization tips.

javascript - Prompt inside a function -

so new coding. wondering whether possible have prompt inside function. example of code below: var username = function(name) { var n = prompt("whats name?"); console.log(n) }; i want print out name going inputted. thanks yes, this: var username = function(){ return prompt("whats name?"); }; console.log(username()); http://jsfiddle.net/mskf3mu1/

android - Libgdx : Clicklistener doesnt work on resize -

my code functional if take out screen resize concern. have tried on multiple devices including tablet , resolution bad. trying keep same aspect ratio of viewport. using stage add buttons , images. clicklistener responding part in gutter , part on play button. stackoverflow not letting me post image because of new account. please me in understanding doing wrong , make sure piece of code works on phones , desktop. private static final int virtual_width = 480; private static final int virtual_height = 800; public void resize(int width, int height) { // calculate new viewport vector2 size = scaling.fit.apply(virtual_width, virtual_height, width, height); int viewportx = (int)(width - size.x) / 2; int viewporty = (int)(height - size.y) / 2; int viewportwidth = (int)size.x; int viewportheight = (int)size.y; gdx.gl.glviewport(viewportx, viewporty, viewportwidth, viewportheight); } @override public void show() { batch = new spritebatch(); stage =

How to create Countdown timer in Android till a specific date -

i creating app event in future , want countdown till date , time. have checked many questions regarding couldn't find exact code that. want app take time system , subtract future time , gets updated every second. simply create new date , convert time, pass time countdowntimer , wait you can way simpledateformat dformat = new simpledateformat("dd-mm-yyyy"); date date = null; try { date = dformat.parse("20-09-2014"); // change date } catch (parseexception e) { e.printstacktrace(); } // .gettime() conversion: date --> long countdowntimer cdt = new countdowntimer(date.gettime(), 1000) { public void ontick(long millisuntilfinished) { // todo auto-generated method stub } public void onfinish() { // todo auto-generated method stub } }.start(); the ontick method triggred every 1s can change changing 1000 value in second paramater of cou

java - Cannot assign instance of javax.swing.event.EventListenerList to field javax.swing.AncestorNotifier.firstInvisibleAncestor -

i little bit lost here. have java program runs on computers without trouble. on of them following exception thrown: error: java.lang.classcastexception: cannot assign instance of javax.swing.event.eventlistenerlist field javax.swing.ancestornotifier.firstinvisibleancestor of type java.awt.component in instance of javax.swing.ancestornotifier the java version seems date on machines. has clue might cause exception?

c# - Good way for a CancellationToken to affect a subset of tasks controlled by another CancellationToken -

is there ways tie cancellation token subset of tasks controlled cancellation token?... in example create 2 cancellationtokensource's... , register 1 against cancel function of other... way if cancel loading of images... cancels tasks... if cancel all... cancels tasks... there better way this? (this ways seems messy... e.g. when unregister) cancellationtokensource cancelallsource = new cancellationtokensource(); (int = 0; < 20; i++) task.factory.startnew(() => { loadurl(i, cancelallsource.token); }); cancellationtokensource cancelimageloadssource = new cancellationtokensource(); // connect cancel token cancel image loads token cancelallsource.token.register(cancelimageloadssource.cancel, false); (int = 0; < 10; i++) task.factory.startnew(() => { loadimage(i, cancelimageloadssource.token); }); ... cancelimageloadssource.cancel(); // cancel loadimage tasks // or cancelallsource.cancel(); // cancel tasks (including loadimage tasks) yes, there is

jquery - How to increase the inside circle's size -

i have done following css jquery: jsfiddle don't know why cannot increase width , height of green circle in way little greater gray circle (which call main circle) lower z-index, in way passing time, green circle shows progress around main cirecle(just on border of gray circle because use lower z-index green cirecle) green circle is: <div id='timer'></div> i appreciate help. thanks div.slice{ font-size: 70px !important; margin-left: -26px; margin-top: -21px; }

parallelize recursion python -

i working big dataset now. input 4 different datasets , have apply particular function each dataset. have done read 4 dataset , apply function in parallel each dataset using pool.map. have parent , 4 child process. fine till this. q1. happens inside each process. in function applying on each dataset, comparing each tuple other tuples, kind of recursion. there way make parallel, because comparison may take long time since dataset big. how make because child process? possible parallelize again within child process, because have more processors, want utilize it. q2. have in mind parallelization of recursive task is, if comparing tuple x tuple y( every tuple other tuple), can make chunks x , each chunk comparison y. guess can done 2 'for loops'. suggestions how this? re: q1, if you're creating child processes using multiprocessing.pool , no, worker processes cannot have children. attempting create 1 raise exception: assertionerror: daemonic processes not all

multithreading - Opencv Multithreaded Python - Currently is not working as intended -

code: def video_stream(self): while(true): # our operations on frame come here gray = cv2.cvtcolor(img, cv2.color_bgr2gray) faces = self.face_cascade.detectmultiscale(gray, 1.3, 5) while(faces == ()): faces = self.face_cascade.detectmultiscale(gray, 1.3, 5) if faces not (): if faces[0][0] < 500: # head on left #cmd = """osascript -e 'tell application "system events" keystroke "f"'""" print "right" #.system(cmd) else: # head on right #cmd = """osascript -e 'tell application "system events" keystroke "d"'""" print "left" #os.system(cmd) def main(self): t = threading.thread(target = self.video_stream) t.start() while not self.done: self.event_loo

c++ - Linked list, add node to end -

i'm working on project , given function complete void addtoend(node*& head, string newval) effect: adds new node tail end of list precondition: head pointer first node in list (list may empty) postcondition: list contains 1 more node my question string newval for? the value_type of class of type double i'm confused string newval for. can't set newval in node because of 2 different types. this have far. i'm not sure if im going in right direction. node *temp = new node; temp = head; while(temp->link() != null){ temp = temp->link(); } head->set_link(temp); i'm not sure use string in block of code. link() returns member variable node* link_field set_link() sets new link link_field well, we're guessing somehow expect turn string double function std::stod . as list manipulation code, there's few problems: node *temp = new node; temp = head; this creates new node, puts pointer in temp , overwrites temp hea

objective c - glCheckFramebufferStatus returns 0 in iOS 8 -

i making app utilizes rendering texture opengl es 2.0. have tested code in ios 7.1 numerous times without error. after updating ios 8.0 getting return of 0 on glcheckframebufferstatus. after doing research have found glcheckframebufferstatus returns 0 when there error. know why happening after updating ios 8.0? here code: // generate renderbufferer glgenrenderbuffers(1, &viewrenderbuffer); glbindrenderbuffer(gl_renderbuffer, viewrenderbuffer); [context renderbufferstorage:gl_renderbuffer fromdrawable:(id<eagldrawable>)self.layer]; glgetrenderbufferparameteriv(gl_renderbuffer, gl_renderbuffer_width, &backingwidth); glgetrenderbufferparameteriv(gl_renderbuffer, gl_renderbuffer_height, &backingheight); // generate framebuffer object texture handling glgenframebuffers(1, &textureframebuffer); glbindframebuffer(gl_framebuffer, textureframebuffer); // generate texture , bind framebuffer glgentextures(1, &layers[0]); glbindtexture(gl_texture_2d, layers[0]);

c# - how to see original error thrown in asp.net application -

i have asp.net 2.0 web application in webserver deployed. 1 of function have code below:- ... try { //some system/.net exception occurred } catch (exception ex) { //show custom message } ... as can see system/.net exception caught in catch block actual exception not displayed or logged anywhere. how can see actual error occurred in webserver without modifying code? the problem don't have source code , don't want decompile dlls , re-deploy dlls after recreating code. also, nothing getting logged in event log. is there way or tool find out error has occurred in try...catch block see actual error message? the commenter correct. cannot intercept exception if it's being suppressed. however, if it's propagating call stack, can add new ihttpmodule , log exception so: public class thelogger : ihttpmodule { httpapplication _ctx; public void dispose() { } public void init(httpapplication context) { _ctx = context;

flex lexer - (F) Lex, how do I match negation? -

Image
some language grammars use negations in rules. example, in dart specification following rule used: ~('\'|'"'|'$'|newline) which means match not 1 of rules inside parenthesis. now, know in flex can negate character rules (ex: [^ab] , of rules want negate more complicated single character don't think use character rules that. example may need negate sequence '"""' multiline strings i'm not sure way in flex be. (tl;dr: skip down bottom practical answer.) the inverse of regular language regular language. in theory possible write inverse of regular expression regular expression. unfortunately, not easy. the """ case, @ least, not difficult. first, let's clear trying match. strictly speaking "not """ " mean "any string other """ ". include, example, x""" . so might tempting we're looking "any string not contain &

Big Outgoing traffic on windwos azure -

i have vm on windows azure running centos6 dev node, , have experiencing huge increase in outgoing traffic. vm stopped , after started 1 day shows 236.63 gb on outgoing traffic, server not running applications, 1 landing page. need how detect causing traffic , how prevent it, since it's reflecting badly on bill.

java - Retrieving attributes from another table using HQL -

i using spring-mvc project. have classes follows: pseudo code: public class a{ @onetomany(fetchtype.eager) private set<classb> classb; public set<productbasic> getproductbasic(){return productbasic;} // have setter above } for class , class b in database, have foreign of 'class a' 'id' in 'class b'. using hql want retrieve data class , class b , display it. have class b primary key , access both tables. how shall proceed using hibernate query language. as have mapping of both table using following simple query data of both table. here set of classb's data each classa object. // session session session object string hql = "from a"; query query = session.createquery(hql); list results = query.list();

javascript - What is the recommended way to handle changes in local web storage from upstream? -

the question general approach. me, try present problem using angularjs ngstorage . let's have saved in local storage: $scope.$storage = $localstorage; $scope.$storage.food = { type: 'candy', eaten: false } with way, i've saved in local storage. next time user visit page, know if he/she has eaten candy. however, in future, change app , change structure of food . so how should update this? 2 things must took care of are: notify client of new structure storing. integrate change old storage. my approach using version field indicate changes, , upon seeing that, reset clients storage. this process called "data migration" (i.e. upgrading data structure application evolves). it's well-known problem database world (and before config/preferences files). the usual approach add version in header of data structure. means header same (or changes in backwards-compatible ways) while payload (the actual data) can change as needs. a simple so

python - How to pass properties from one class to another in kivy -

in application, have multiple screens. each screen corresponds class. display property calculated in class (screen) on screen. below simplified example outline problem. in class wordcomprehension, numericproperty count_r incremented, every time button pressed. now, display result of calculation in scorescreen. suggestions. here .py: import kivy kivy.app import app kivy.uix.boxlayout import boxlayout kivy.uix.floatlayout import floatlayout kivy.uix.label import label kivy.uix.button import button kivy.properties import objectproperty kivy.properties import numericproperty class appscreen(floatlayout): app = objectproperty(none) class mainmenu(appscreen): pass class scorescreen(appscreen): score = numericproperty(0) def get_score(self): wordcomp = wordcomprehension() self.score = wordcomp.count_r class wordcomprehension(appscreen): count_r = numericproperty(0) count_w = numericproperty(0) def do_something(self): self.cou

javascript - Is it possible to use an single image from an array of images in an Maps InfoWindow? -

i have following functions specify , deliver output of array of images retrieved library database through api (initially given addresses in json format). function processimages(index, troveitem){ for(var in availableimages){ if(troveitem.identifier[0].value.indexof(availableimages[i].url_pattern) >= 0){ console.log("trove url "+troveitem.identifier[0].value+" pattern: "+availableimages[i]["url_pattern"]); availableimages[i].numimages++; availableimages.totalimages++; availableimages[i]["images"].push(troveitem.identifier[0].value); } } } //// function printimages(){ $("#output").append("<h3>image search results</h3>"); for(var in availableimages){ if(availableimages[i]["

c# - Thread updating GUI freezes in random moments -

i have form button , text box. button starting thread updating value of text box. public form1() { initializecomponent(); mydelegate = new updateui(updateui); } private void button1_click(object sender, eventargs e) { mythread = new thread(new threadstart(threadfunction)); mythread.start(); } private void threadfunction() { mythreadclass mythreadclassobject = new mythreadclass(this); mythreadclassobject.run(); } private void updateui(int i) { textbox1.text = i.tostring(); thread.sleep(1000); } public thread mythread; public delegate void updateui(int i); public updateui mydelegate; and threadclass: public class mythreadclass { form1 myformcontrol1; public mythreadclass(form1 myform) { myformcontrol1 = myform; } public void run() { // execute specified delegate on thread owns // 'myformcontrol1' co

Write html to custom header tcpdf -

i'm struggling understand how header function working in tcpdf. is possible use $pdf->writehtml header? http://www.tcpdf.org/examples/example_003.phps i display 3 columns in header. column1 column2 column3 problem solved, credits simon @ https://sourceforge.net/p/tcpdf/discussion/435311/thread/505a9e13/ class mypdf extends tcpdf { public function header() { $headerdata = $this->getheaderdata(); $this->setfont('helvetica', 'b', 10); $this->writehtml($headerdata['string']); } } $pdf = new mypdf(pdf_page_orientation, pdf_unit, pdf_page_format, true, 'utf-8', false); $pdf->setheaderdata($ln='', $lw=0, $ht='', $hs='<table cellspacing="0" cellpadding="1" border="1">tr><td rowspan="3">test</td><td>test</td></tr></table>', $tc=array(0,0,0), $lc=array(0,0,0));

vba - Auto run when an appointment is updated -

i automatically run macro when appointment updated. for test, wish macro displays subject of appointment. you want itemchange event http://msdn.microsoft.com/en-us/library/office/ff865866%28v=office.14%29.aspx public withevents myolitems outlook.items public sub application_startup() set myolitems = _ application.getnamespace("mapi").getdefaultfolder(olfoldercalendar).items end sub private sub myolitems_itemchange(byval item object) debug.print item.subject end sub

php - CakeEmail loop not sending -

i have app sends email using cakeemail. works 100% fine if send 1 email , can view email in inbox , looks should. now, when put same send bit in loop, , loop through array unique keys , try send it, doesn't deliver 1 email. here function: public function _email($data = null) { if ($data == null) { throw new notfoundexception(__('invalid invite')); } if(count($data) == 1) { $data[0] = $data; unset($data['invite']); } $email = new cakeemail(); foreach($data $invite) { $this->invite->id = $invite['invite']['id']; $email->reset(); $email->from(array('invites@example.co.za'=>'invite')); $email->replyto(array('replytoaddress@gmail.com')); $email->subject('subject'); $email->to(array($invite['invite']['email'] => $invite['invite']['name'])); $email->vie

android - ListView Search is not Working Porperly -

hello friends have started learning android days working on list views want search items in list view. gi have gone through many post , wrote following code how not working . please . qyestionactivity public class questionactivity extends actionbaractivity { string filepath = null; string question_filepath = null; controller c; listview question_list_view; edittext txt_search; arraylist<singlequestion> question_list; main_questionlist_adapter questionlistadapter; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_question); filepath = constant.application_file_path; question_filepath = filepath + "questions.txt"; file test_fifile = new file(question_filepath); if (!test_fifile.exists()) { copyassets(); } new parsequestionfile().parsequestionfile(question_filepath); c = controller.getcontroller(); question_list = c.getquestions().g

asp classic - CDO.Message.1 error '80040213' The transport failed to connect to the server. Local runs, Prod Server fails -

i have problem email.asp page. in local pc runs , send email (use telnet ok), but, in prod server fails ("connecting zimbra.xxx.xxx...could not open connection host, on port 25: connect failed"). error message "cdo.message.1 error '80040213' transport failed connect server.". searching information says "review server has port 25 open". how do ? open port in windows 2008 r2 server. <%set imsg = server.createobject("cdo.message") imsg.configuration.fields.item("http://schemas.microsoft.com/cdo/configuration/sendusing" )=2 imsg.configuration.fields.item("http://schemas.microsoft.com/cdo/configuration/smtpserverport" )=25 imsg.configuration.fields.item("http://schemas.microsoft.com/cdo/configuration/smtpserver" )= "zzz.zzzzz.zzz" imsg.configuration.fields.item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate" ) = 1 imsg.configuration.fields.item("http://

javascript - Double Alert Windows -

i getting double alert prompts single form: alert pops first time, when click ok, same 1 pops open again. think code should alert once when hits "else window.alert(samewarning) , stop when reaches "return false()"; seems return false() causing alert twice. maybe because have 2 forms on 1 page; yet, have 2 separate function names ("signinform()" , "savesignup()")and call 2 separate forms (forms[0] , forms[1])? think code correct, can't figure out @ point. appreciated. in advance! <script type="text/javascript"> //first function forms[0] function signinform(){ // var samewarning = "the required fields not submitted following error(s). \n \n"; var warninglogin = "the following field(s) require entry: \n \n"; var samewarning = warninglogin; var username = document.forms[0].username.value; var pswd = document.forms[0].pswd.value; if(username == "")

c - How to determine Windows version in future-proof way -

i noticed getversionex() declared deprecated. worse yet, windows 8.1 (and presumably future releases) version number limited application manifest. my goal collect analytics on operating systems users running, can appropriately target support. future-proof solution collecting data. updating manifest won't work because can update manifest windows versions have been released, not future versions. suggested replacement api, version helper functions , useless. how can collect actual windows version number? to clarify: "future proofing", mean want has reasonably chance of working on next version of windows. nothing certain, docs getversionex() won't work. msdn has an example showing how use (useless scenario) version helper functions, in introduction following: to obtain full version number operating system, call getfileversioninfo function on 1 of system dlls, such kernel32.dll, call verqueryvalue obtain \stringfileinfo\\productversion subbl

json - JsonMappingException + Unable to deserialize -

this first post community. trying de-serialize payload class , consistently failing in attempt. went through other similar posts related exception site nothing fixed problem. trying map payload class messagebody.class , extract payload corresponding element 'message' via getmessage getter. can please this? thanks messagebody class @jsonignoreproperties(ignoreunknown = true) public class messagebody { @serializedname("message") @jsonproperty("message") private string mmessage; public messagebody() { } public messagebody(string message) { this.mmessage = message; } public string getmessage() { return mmessage; } public void setmessage(string message) { this.mmessage = message; } } de-serialization attempt code private static objectmapper objectmapper = new objectmapper(); public static void main(string[] args) throws ioexception { str

jquery full calendar horizontal drag and select multiple days -

i have tried implement horizontal drag selection in jquery full calendar didn't success. day wise vertical selection possible more 1 day selection in single drag not working. guys if have solution please suggest. below code full calender: $.createfullcalendarwithcurrenttime = function (selectcallback, eventscallback, mouseovercallback, options, eventrendercallback, curtime) { calendar = $('#calendar').fullcalendar({ unselectauto: false, header: { left: 'prev', center: 'title', right: 'next' }, titleformat: { week: "mmmm dd{ - dd, yyyy}" }, // sep 7 - 13 2009 , defaultview: "agendaweek", // columnformat: { month: 'ddd', week: 'ddd d/m', day: 'dddd d/m' }, columnformat: { week: 'ddd d'}, eventbackgroundcolor: options && options["eventbackgroundcolor"] ? options["

Python Mysql Connector not getting new content -

i making simple python script checks mysql table every x seconds , print result console. use mysql connector driver. however, running script prints initalial values. mean, if change values in database while script running, it's not registered script , it's keeps on writing initial values. the code retrieves values in while loop follows: def get_fans(): global cnx query = 'select * config' while true: cursor = cnx.cursor() cursor.execute(query) (config_name, config_value) in cursor: print config_name, config_value print "\n" cursor.close() time.sleep(3) why happening? most likely, it's autocommit issue. mysql connector driver documentation states , has autocommit turned off. make sure commit implicit transactions while changing table. because default isolation repeatable read have: all consistent reads within same transaction read snapshot established first

php - Confusing in declaring Varchar for unicode when creating table in MYSQL? -

i want store "first name" max length of 12 characters. if exceeds, rejected. so, create table schema create table tb (firstname varchar(12) character set utf8 not null) now if name in ascii, fine. if it's in japanese or thai? each unicode char takes 3 bytes, need triple size this? create table tb (firstname varchar(36) character set utf8 not null) but then, if triple size that, english users can put name longer 12 chars. how solve issue? it's better use varchar(255) @ least when not sure field length.

tfs2013 - Using TFS 2013 with existing GIT Server and be able to associate work items -

we have tfs 2013 installation projects want migrate git. source control history, we've landed on git tfs , --with-branches option, all. have few other questions: is possible associate tfs 2013 git server - organization has established git server preferred. how can associate work items # convention, guess there might need of post-hook or something. would there chance of migrating links in tfs workitems changesets point commits in git repo? the first 2 important. third can live without think, don't need delete repository, unless automatically done when , if can associate other git server tfs project. can tell plan after having migrated sources git? better description of plan do... still talking of tfs? talk tfs-vc (still using it) or tfs-git (want migrate totally)? i anyway try answer questions... no, can't. tfs, abolutly needed part source control. so, if want use other feature of tfs (except alm), must use source control. if plan use tfs(git), sync

java - How to read a method from file -

in java, able load method file. way user has way customize method. user make txt file, type normal java method it, load program. know of reflection, not aware of way read methods this. program execute method built in. there anyway this? i user can customize calculculations create values displaying stuff on screen. here existing method: void setscale() { int windowdiagonal = (int) math.sqrt(comp.getwidth() * comp.getwidth() + comp.getheight() * comp.getheight()); double scale = windowdiagonal / 2500.0; placewidth = (int) (comp.getwidth()/2.5);//(int) (800 * scale); arrowlinesize = (int) (20*scale); linesize = (int) (10*scale); arrowsize = (int) (40*scale); arrowheight = (int) (100 * scale); arrownamegap = (int) (10 * scale); roundracegap = (int) (50 * scale); roundracelinegap = (int) (30 * scale); leftlightgap = (int) (20 * scale); lightsize = (int) (200 * scale); lighttextgap

batch file to search in txt file for string and get the full line off the string -

i want batch file search in txt file string , full line of it this txt file input 1:how you 3:im fine 2:yeah example @echo off set string=3: echo full line off string %fullline% pause here batch file calls findstr directly, , within loop add text line. if want found text delete line beginning for. @echo off set findtext="blah" set findfile="test.txt" findstr %findtext% %findfile% /f "delims=" %%a in ('findstr %findtext% %findfile%') echo full line of string %%a credits

Puppet prefix function does not seem to prefix the result -

i trying provision splunk alert cluster of kafkas. have code, , hiera data "kafka_hosts" map hostnames keys. $kafka_hosts = keys(hiera('kafka_hosts')) $splunk_host_expresssions = prefix($kafka_hosts,'host=') $splunk_hosts_expression = join($splunk_host_expresssions,' or ') $splunk_hosts_expression comes out host names separated or. prefix host= not turn up. the result want is: host=a.example.org or host=b.example.org or host=c.example.org puppet version 2.7

c# - Getting URL to uploaded file on Box.com -

i have been able upload file sample.pdf using c# program utilizing box api. (client_id, client_secret, code, postman, etc) boxapi.v2.authentication.oauth2.oauthtoken newtoken = default(boxapi.v2.authentication.oauth2.oauthtoken); clientid = "blah blah"; clientsecret = "blah blah"; tokenprovider tokenprovider = new tokenprovider(clientid, clientsecret); streamreader streamreader = default(streamreader); streamreader = system.io.file.opentext(@"c:\boxapirefreshtoken.txt"); oldrefreshtoken = streamreader.readtoend(); streamreader.close(); newtoken = tokenprovider.refreshaccesstoken(oldrefreshtoken); boxmanager boxmanager = new boxmanager(newtoken.accesstoken); streamwriter streamwriter = new streamwriter(@"c:\boxapirefreshtoken.txt"); streamwriter.write(newtoken.refreshtoken); streamwriter.close(); folder rootfolder = default(folder);

ruby - Why does this semantically identical class cause an undefined method 'new' error? -

why following code error: class complex def initialize(real, imaginary) @imaginary = imaginary @real = real end end c = complex.new(5,3) complex.rb:8:in <main>': undefined method new' complex:class (nomethoderror) but semantically identical program below not: class wat def initialize(a, b) @a = @b = b end end c = wat.new(5,3) because complex exists, , built in different way, e.g., complex(2, 3) when re-open class (not defining own) operate under existing class's constraints. new removed somewhere around 1.9 iirc. http://www.ruby-doc.org/core-2.1.3/complex.html http://ruby-doc.org/core-2.0/complex.html http://ruby-doc.org/core-1.9.3/complex.html http://ruby-doc.org/stdlib-1.8.7/libdoc/complex/rdoc/complex.html

java - Android bugs on device. What should I do to fix them? -

in application noticed these 3 things: -the button enabled when going 1 activity enabling user click on original activity. problem don't want user click on @ point in application. don't want disable button in application, when 1 intent called. how can that? -i noticed strange... when toast notification pops in application until exit application. when exit application, of toast notifications residual , popping outside of application. there reason that? did miss in activity lifecycle handle cancellation of toasts @ point? lastly, 1 rather tough solve. how lock screen when user rotates device, activity doesn't not called again , asynctask can still resume without starting on again? thanks lot time. curious why these things happen , should into? here's code: //main activity.java package com.example.patient_device; import android.app.activity; import android.app.progressdialog; import android.content.context; import android.content.intent; import android.da