Posts

Showing posts from March, 2012

Github authentication: how to use Github as Maven repo when repo is private -

i'm trying store of our private artifacts on github , access them if part of maven repo. there lots of pages explain how create public maven repo on github: put artifacts in proper directory structure in project, , access them using "raw" url: <repositories> <repository> <id>myrepo.myname.github.com</id> <url>https://github.com/myname/myproject/raw/master/repositories/releases/</url> </repository> </repositories> so far, good. trouble can't figure out how access repo if it's private. i've added username , password settings.xml, doesn't work: <servers> <server> <id>myrepo.myname.github.com</id> <username>myusername</username> <password>mypassword</password> </server> </servers> what's trick? the question moot. github has eliminated downloads. don't host binaries more. because of kind of abuse i've proposed...

java - Scala Lift - Save files to directory in apache -

i have ajax file upload system , running. what i'm trying store files in directory under apache's webroot, app running in tomcat , i'd prefer storing files outside of webroot (in tomcat), , inside webroot of apache somewhere, regulary update app. i've got this: var root = new java.io.file("").getabsolutepath() which can give me apps location. i don't want have add config.xml app, wondering if out there knew how find location of apache's webroot in event changes or swap servers , setup different? wow typed "webroot" alot.. thanks alot help, appreciated :) finding current apache location tricky business, specially if need deal virtual hosts. should using property files that. can have multiple props files , 1 each environment. lift has many ways load property files, highly recommend finding solution using it. instance, can override config file in lift. alternatively, can have apache home set variable in jetty startup script, like: ...

asp.net - VB.Net IIf function in adding SqlParameter -

i rewriting long insert statement , parameters used this: cmd.parameters.addwithvalue("@website", general.fnsqlnullvalues(twebsite.text)) where general.fnsqlnullvalues this: public shared function fnsqlnullvalues(byval svalue object, optional byval len integer = 999999) object if svalue nothing return dbnull.value fnsqlnullvalues = iif(svalue.tostring.length = 0, dbnull.value, left(svalue.tostring(), len)) end function i don't @ , , seems alot of code this, cmd.parameters.addwithvalue("@website" , if(twebsite.text , dbnull.value)) from understanding , 1 line of code there dbnull.value replace twebsite.text value if twebsite.text null or not accepted , seems me same thing other function in general. correct , 1 way better other? also , warning : "cannot infer common type; object assumed" second way , seems me first way using generic object anyways , not know if should ignore warning strings little tricky when working database parameters in...

html - How to center align img wrapped in SPAN tag? -

i trying center align image wrapped in <span> , having trouble doing so. have uploaded css , html jsfiddle: http://jsfiddle.net/7nhhu/1/ i trying image center align content in "block" style (ie. text above , below it, not wrapped left or right) any appreciated. .imgframe { border: 1px solid #eaeaea; display: inline-block; margin: 8px; } .imgframe img { border: 1px solid #ffffff; margin: 0; background: #f6f6f6; padding: 8px; -moz-box-shadow: 2px 2px 5px #cccccc; -webkit-box-shadow: 2px 2px 5px #cccccc; } <span class="imgframe centerimg"><img src="http://i48.tinypic.com/31368e9.jpg" /></span>​ just make image wrapper block level element , text-align:center; it. fiddle or wrap in element if needed; fiddle

html - Why isn't the EditorTemplate showing the data? -

i rewrote page use editortemplates. , nice. however, when postback first row posts data. other 4 rows come null. formsection has list of formrowmodels. , formrows has list of ctrlinputdatamodels. code below. index @model inspectionwebformsmvc.viewmodels.formsection @{ viewbag.title = "testing editor templates"; } <h2>test control webforms</h2> @html.editorfor(x => x.sectionrows, "formrowmodel") editortemplate/formrowmodel @model inspectionwebformsmvc.viewmodels.formrowmodel @using (html.beginform("index", "testedit", formmethod.post)) { int = 0; //var testctrls = model.where(x => x.rowinput.where(y => types.contains(y.rowctrl.type))); <div style="clear:both; padding:1%;"> <div class="section"> @model.section </div> <div class="number"> @model.sectionnumber </div> <div class="desc"> @model.description </div> <div class="ctrl"...

qt - Do I need to share .pro.user files in a GNU GPL project? -

as red qt guide ( http://doc.qt.nokia.com/qtcreator-2.4/creator-sharing-project-settings.html ) saw .pro.user files stores user-specific project settings, , can make pro.shared it, don't knot how make (in spite of reading guide), , parts need include. anyway, have provide file in gnu gpl v3 project, or developers can build app rest of source, without file? no need .pro file build project. the .pro.user , .pro.shared store custom ide preferences, not needed build project , aren't derived work in gpl sense

javascript - Trying to display latest Tweet -

i've been using few tutorials me display latest tweet, haven't had success since stopped working week ago. this js: <script type="text/javascript" src="http://twitter.com/javascripts/blogger.js"></script> <script type="text/javascript" src="http://twitter.com/statuses/user_timeline/username.json?callback=twittercallback2&count=1"></script> and html: <div id="twitter_div"><ul id="twitter_update_list"><li>&nbsp;</li></ul></div> but comes empty in js fiddle. http://jsfiddle.net/bvdvh/149/ i have no idea why, working before , stopped working on website week ago. edit: answer in comments. not seeing last tweet because re-tweet. had set true. you missing script handles data loaded twitter. twitter api expects callback of twittercallback. edit: didnt realize blogger.js provided callback. answer fiddle in comments

algorithm - How do you determine the latitude and longitude of a point on a map? -

i make mapping application maps indoor places such malls. need able calculate latitude , longitude of point on particular map (i.e. know latitude , longitude of particular store). know maps rotated , not aligned true north, first need supply information few points sort of "calibrate" orientation of map known, if mean. my map formatted grid/coordinate system. supply latitude , longitude of 3 specific points on map. after supplying information, how can calculate latitude , longitude of other point on map? example, have map, , tell program latitude , longitude data of (0, 0), (5, 5), , (10, 12). input (3, 5) , program should tell me latitude , longitude of point. is possible do? how go writing algorithm this? also, possible user supplying positions of 2 points program? thanks! assuming mall small enough can consider lat , long linear ie same x , y it's matter of applying scaling , rotation transformation matrices . if maths little weak might want try simple introduct...

sql - Order by join column but use distinct on another -

Image
i'm building system in there following tables: song broadcast station follow user a user follows stations, have songs on them through broadcasts. i'm building "feed" of songs user based on stations follow. here's query: select distinct on ("broadcasts"."created_at", "songs"."id") songs.* "songs" inner join "broadcasts" on "songs"."shared_id" = "broadcasts"."song_id" inner join "stations" on "broadcasts"."station_id" = "stations"."id" inner join "follows" on "stations"."id" = "follows"."station_id" "follows"."user_id" = 2 order broadcasts.created_at desc limit 18 note: shared_id same id. as can see i'm getting duplicate results, don't want. found out previous question due selecting distinct on broadcasts.created_at. my quest...

c# - The type or namespace name 'Nmo' does not exist in the namespace 'Microsoft.SqlServer.Management' -

i tried load project said: the type or namespace name 'nmo' not exist in namespace 'microsoft.sqlserver.management' i know smo dll nmo? find that? update: added smo dll of 2008 version... still giving out error... maybe, should smo dll of sql 2005 version? coz machine got project using sql 2005 quote article titled " microsoft sql server 2005 notification services " : nmo api assemblies , namespaces to use nmo api, applications must reference assemblies contain needed classes. following 2 assemblies required: microsoft.sqlserver.smo.dll microsoft.sqlserver.connectioninfo.dll the first assembly, microsoft.sqlserver.smo.dll , contains of classes in smo framework, including nmo classes (there isn't separate nmo assembly). microsoft.sqlserver.connectioninfo.dll contains utility classes used establish database connections. classes both assemblies typically needed in programs use nmo api. most of classes you'll encounter while working nmo d...

View the source of an builtin R package -

possible duplicate: view source of r package i want see source code of stats::reorder. this answer seems not apply built in packages compiled bytecode: > stats::reorder function (x, ...) usemethod("reorder") >bytecode: 0x103321718< >environment: namespace:stats< this has nothing reorder being compiled bytecode , being generic function. my answer here elaborates on this. but situation if want see code can use # find methods available reorder methods(reorder) # attempt check out code reorder.default reorder.default # use getanywhere view code regardless of if exported getanywhere(reorder.default)

javascript - Content Script tracking with Google Analytics -

i working on google chrome extension modifies pages content script. in order understand when , changes applied looking google analytics since use other web properties already. we include ga.js library via manifest file, , trigger _trackpageview synchronous page call when apply change page. var pagetracker = _gat._gettracker("ua-our-ua"); pagetracker._setdomainname("none"); pagetracker._setallowlinker(true); pagetracker._trackpageview(window.location.href); trouble here each pageview in different domain counts new visit , visitor. there way circumvent that? example use chrome extension sqlite database or key value store in browser store unique user id , visit id domain independent. possible? thanks you should not execute code inside other people sites. google analytics configuration sensitive , if site has custom implementation might breaking visitor. you should include google analytics in own background page. , communicate content_script background page ev...

python - Algorithm to spread apart labels on a graph for better visualization -

Image
basically, want make graph prettier. can see there areas of extreme overdraw. abbreviate names manually , shrink font size, i'd algorithm pushes apart labels in overdrawn areas text more readable. think must studied problem, don't know it's called. already implemented solutions in python great, i'll settle descriptions of techniques tend work in practice. the algorithm paper should work: m. luboschik, h. schumann , h. cords. particle-based labeling: fast point-feature labeling without obscuring other visual features. tvcg: ieee transactions on visualization , computer graphics, 2008, 14, 1237-1244. doi: 10.1109/tvcg.2008.152

python - Can't run mongod command after got pymongo installed from pip -

i'm running virtualenv on osx 10.7.4, , trying install mongodb python, version 2.7.3. i installed pip, , trying see happens if run mongod command, turns out can't run command. below happened in terminal, give hand here wrong? (test1)dus-macbook-air:~ mepine$ pip install pymongo downloading/unpacking pymongo downloading pymongo-2.2.1.tar.gz (230kb): 230kb downloaded running setup.py egg_info package pymongo installing collected packages: pymongo running setup.py install pymongo building 'bson._cbson' extension /usr/bin/clang -fno-strict-aliasing -os -w -pipe -march=native -qunused-arguments -fwrapv -dndebug -g -fwrapv -o3 -wall -wstrict-prototypes -ibson -i/usr/local/cellar/python/2.7.3/include/python2.7 -c bson/_cbsonmodule.c -o build/temp.macosx-10.4-x86_64-2.7/bson/_cbsonmodule.o /usr/bin/clang -fno-strict-aliasing -os -w -pipe -march=native -qunused-arguments -fwrapv -dndebug -g -fwrapv -o3 -wall -wstrict-prototypes -ibson -i/usr/local/cellar/python/2.7.3/include...

javascript - Click Events / Listeners in ExtJS -

hey there: i'm having difficulty handling click events extjs. i define new widget in widget view definition, whatever reason following code isn't being called on click. appreciated. thanks. ext.define('memos.view.shortcut', { extend: 'ext.view.view', alias: 'widget.shortcut', name: 'shortcut', singleselect: true, store: 'apps', tpl: [ '<tpl for=".">', '<div id="icongroup" class="icon-wrap">', '<div id="icon" class="icon">', '<img src="/images/icons/" />', '</div>', '<span> {appname} </span>', '</div>', '</tpl>' ], itemselector: 'div.icon', listeners: { click: function(d, i, n, e){ alert('foo'); } }, }); you can't make event names, list of available ones here @ bottom: http://docs.sencha.com/ext-js/4-1/#!/api/ext.view.view

model view controller - How get the data using MVC- Servlets, JPS and JavaScripts -

Image
i have jsp page has links (when people click on link supposed go servlet , bean class , db connection class pull data)..and when user clicks on tried display page using ajax...however not getting data/page pulled. can please explain on how achive this? here link have in html page..but when click on not showing anything. <a href="myservlet" onclick="grabfile(this.href); return false;">vt </a> thanks help sorry here code public class vacationtrackerdao { public static list<vactiontrackerbean> list() throws sqlexception{ list<vactiontrackerbean> appr= new arraylist<vactiontrackerbean>(); try{ dbconnection conobj=new dbconnection(); connection dbcon= conobj.getcon(); statement stmt=conobj.getstmt(); string querycplist="select * capacity_plan"; string queryapprlist="select first_last_name vacation_approvers"; preparedstatement prestmtcplist=dbcon.preparestatement(querycplist);//get metadat preparedstatement prestmt...