Posts

Showing posts from July, 2010

Why are the ODBC queries from my desktop is blocked by the sql server after running several queries in rapid succession? -

i create queries using visual foxpro 9.0 desktop computer ms sql server 2005 running on windows enterprise server (2003). queries repetitive , sometimes, 1 session query sql server 200,000 times in rapid succession. first few days, program running fairy sql server refusing process queries. on checking logs in sql server, found out spid killing query process: process id 71 killed hostname sqlserver, host process id xxxx. i confused because hostname not sql server querying sql server. from activity monitor noticed offending process id has following information: 62 no sa master sleeping 0 awaiting command sql agent - generic refresher .. the details shows message: set no_browsetable on lastly, thinking may problem visual foxpro, tried running queries desktop machine within sql server management studio, still encountered same problem when tried queries sql server: a transport-level error has occurred when sending request server. (provider:...

jquery - Hide input and output entered value as text with ability to change the value by showing input -

Image
could please advice me plugin or solution on jquery. i need have input field email type. when entered shows on image attached. you can click on change link , input shown again value. what best way that? thanks! you plugin jeditable or implement custom solution following: html <label for="email">email:</label> <div id="email">eugene@gmail.com</div> <a href="#" id="changeemail" data-target="email">change</a> js // switch input // $('#changeemail').bind('click', function(e){ // prevent switch if input // if ($(this).get(0).tagname != 'input') { var $target = $('#'+$(this).data('target')); // target element var val = $target.text(); // current target value // swap elements // $target.replacewith('<input id="email" type="text" value="'+val+'" />...

c++ - Reference to static const data objects -

i have set of utility classes store static const data members. need use these data members in functional classes. planning use references (dont want pointers) static const objects, keep getting error below. can please point out logical/technical mistake in code? #include <string> class staticdata { public: static const int cs = 1; static const staticdata data1; private: staticdata(int id_): _id(id_) //note: private constructer, static access only!! { } int _id; }; const staticdata staticdata::data1(1001); class testreference { public: testreference(): _member(staticdata::data1) {} private: staticdata& _member; }; invalid initialization of reference of type âstaticdata&â expression of type âconst staticdataâ you're attempting reference const object through non-const reference. thus, original object can modified through reference, reference non- const , , you're breaking contract made when declaring obje...

How do I set the test output to console instead of html in gradle for specs2 -

i'm using specs2/scala unit tests , using gradle build. default unit-test output goes html file. have output go directly stdout (just sbt). anyone know magic incantation? thanks wing you can use test { //makes standard streams (err , out) visible @ console when running tests testlogging.showstandardstreams = true } but logs stdout @ info level need run gradle -i see (it seems fixed in 1.1: http://issues.gradle.org/browse/gradle-1966 ) alternatively, can add event handler: test { onoutput { descriptor, event -> logger.lifecycle("test: " + descriptor + " produced standard out/err: " + event.message ) } }

php - Two different values in one input form -

i had created login form if enter wrong username or password value entered in username echoed login form. but want add value="login" form, when haven't tried login , if enter wrong user/pass change echoed value. hope understand mean :) this input code <input type="text" name="username" id="username" value="<?php if (isset($_post['username'])) echo htmlentities($_post['username']); ?>" /> <input type="text" name="username" id="username" value=" <?php if (isset($_post['username'])) echo htmlentities($_post['username']); else echo "login"; ?>" />

cordova - Can an iOS PhoneGap app return to the app after a call has been done? -

i have hybrid phonegap application allow user call phone number. switched phone app. when user ends call stuck in phone app , desired behavior automatically return actual application. possible @ all? instead of using tel: intent have use telprompt intent. prompts user number call option either call or cancel. example: window.location = 'telprompt://' + phonenumber when user hangs returned app.

jquery - triggering events from nested widgets -

i've built simple jquery ui widget creates slider , tries bubble slide event. code below. however, this._trigger undefined in context. how re-trigger event in case? (function($) { $.widget("ui.timelineslider", { options : { }, _create : function() { var self = this; var element = self.element; var options = self.options; element.slider({ slide:function (e, ui) { this._trigger("slidehappened", null, {date: ui.value}); } }); }, destroy : function() { this.element.next().remove(); }, _setoption : function(option, value) { } }); })(jquery); jquery set invocation context (i.e. this ) on events bound through dom node event occurred on. in case div.ui-slider slide occurred on. to reference widget slide handler reference have saved off slide method can ...

mongodb - Install with pecl to local dir on shared hosting -

i'd install php extension on bluehost shared site; mongodb driver. since pecl unable write primary server directory has installed extensions, i'd install mongo.so file directory specify under home. closest article found on web was: http://www.site5.com/blog/programming/php/how-to-setup-your-own-php-pear-environment/20090624/ however, after following steps when use "pecl install mongo" command, still keeps trying install bluehost's central directory on server. according web host's technical support team, utilising pecl installer attempts install extension server-wide rather under account only. web host doesn't allow server-wide installations in shared environment security reasons , because want keep fleet universally same across board. suspect host same. however, did suggest download, configure , install pecl package (pecl_http) in account (rather server-wide) via following manual process: $ cd ~/ $ wget http://pecl.php.net/get/pecl_ht...

telerik - date Compare Validator issue in asp.net -

i have compare validator validates on 2 <telerik:raddatepicker> start date , end date. validation rule simple, check if start date greater end date , show error message user correct it it works expected when start , end dates same showing message not expected. code below: <asp:comparevalidator id="datecomparevalidator" runat="server" controltovalidate="enddate" controltocompare="startdate" operator="greaterthan" type="date" errormessage="start date greater end date - please correct dates."display="dynamic"></asp:comparevalidator> and date pickers follows both start date , end date: <telerik:raddatepicker cssclass="rccalpopup" id="enddate" runat="server" skin="vista"> <dateinput id="dateinput2" runat="server" labelcssclass="radlabelcss_vista...

alfresco - How to add saved search in amp file? -

i have saves searches in alfresco, want add these saved searches in amp file. know how this? when save search new xml file generated @ company home>>data dictionary>>saved searches where need store file in amp file? what change need in model-context.xml ? thanks, yogesh

objective c - facebook ios api post to page - link or message -

i have created page on facebook , want post page. facebook user administrator of page. request "me/account" access_token , id page , code below posts page. facebook* facebook = app.facebook; nsdictionary* pg = [fbpages objectatindex:0]; // page access_token, id , name nslog(@"page %@\n",[pg valueforkey:@"name"]); nsmutabledictionary *params = [[nsmutabledictionary alloc] init]; nsstring *graphpath = [nsstring stringwithformat:@"%@/feed", [pg valueforkey:@"id"] ]; [params setobject:[pg valueforkey:@"access_token"] forkey:@"access_token"]; [params setobject:@"this message coming ios app." forkey:@"message"]; // ----- specify link ---------------------- [params setobject:@"link" forkey:@"type"]; [params setobject:@"http://www.whatever.com" forkey:@"link"]; // ------ difference between case 1 , 2 ----- [facebook requestwithgraphpath:graphpath ...

How to assign a string to a variable in javascript when the string has a single quote in it -

in program there variable name 'quotes' takes input string api call. program doesn't work when string has single quote in it. <script> var quotes = "empty" if(user.quotes) quotes = user.quotes; // string 'quotes' variable </script> can 1 please tell me how fix problem? replace single quote (escape php): <script> var quotes = "empty" if(user.quotes) quotes = user.quotes.replace(/'/g,"\\\'"); // string 'quotes' variable </script> then wherever use quotes, replace "\'" "'".

Wordpress only post 1 post from each category -

i have site: http://n0rd.no/testing/ try make each podcast 1 post on front-page , not 1 pr post in category. i found how 1 post each category in wordpress on site, cant figure out how make work code. can please me? <?php /* template name: category view */ ?> <?php get_header(); ?> <?php // determine column/image size front page $cols = '3'; $cols = get_option('woo_cols'); $r1 = 3; $r2 = 2; if (get_option('woo_ratio1')) $r1 = get_option('woo_ratio1'); if (get_option('woo_ratio2')) $r2 = get_option('woo_ratio2'); if ( $cols == "1") { $class = "one"; $width = 940; $height = $width / $r1 * $r2; } elseif ( $cols == 2 ) { $class = "two"; $width = 460; } elseif ( $cols == 3 ) { $class = "three"; $width = 300; } elseif ( $cols == 4 ) { $class = "four"; $width = 220; } elseif ( $cols == 5 ) { ...

wordpress - How to center slider in css? -

i installed plugin on theme. theme had slider, didn't it. installed one. http://wordpress.org/extend/plugins/content-slide/ i tried using #wpcontent_slider_container{ position:relative; margin: 0 auto; } and this #wpcontent_slider_container{ position:relative; margin-left:auto; margin-right:auto; } and nothing happens. do have put in div? i had same problem. how solved it: #wpcontent_slider_container { margin-left: auto !important; margin-right: auto !important; } #wpcontent_slider { /* styling here */ } without "!important" thingy css didn't work fo me either.

PHP: In shopping cart, Fatal error: Call to undefined function getCart() -

recently start php , not because gives me error. code onyl show articles , total price of shopping cart when reload page, using phpsessid, if have better idea or alternative function, appreciated! index.php <?php require("php/db_functionss.php"); ?> <!doctype html> <html lang="es"> <head> ........ </head> <body> <div id="infoshopcart"> <a href="contshopping"><img src="img/shopping_cart.png" width="30px"/> artículos: <b id="cantarticles">0</b> total: $ <b id="totalpricearticles">0.00</b></a> <?php getcart(); ?> </div> ..... .... </body> </html> and db_functions.php session_start(); $sessionid = $_cookie['phpsessid']; class db_functions { private $db; //put code here //constructor function __construct() { ...

sitecore - How to view conversion data -

i have inherited sitecore project. in project there goals setup. can see via marketing center > goals. my questions is how view conversion data each of goals? this tried: selected 'analyze tab', clicked 'reports button' on ribbon, under 'item reports' selected 'pages - goals , events'. doing above generates report values 0 , expecting show values. sitecore , dms version: 6.5 perhaps might have found answer question, here goes answer. few things make sure have engagement value points being specified in goals exists. example newsletter registration - 25 engagement value points online pricing quote - 50 engagement value points request demo - 100 engagement value points also relevance set. relevance = value/visits refer sitecore executive dashboard cookbook 6.5 section 1.2 if above in place , works fine please check assoication of goal content item correct. refer sitecore marketing operations cookbook 6.5 section 3.1....

css - Legends overlapping border in IE7 and 8 but not 9 -

i'm having issue containing legends within fieldsets ie7 , ie 8. basically have set of fieldsets following css: fieldset { padding: 10px; border-top: 1px solid silver !important; } and legends: legend { float: left; } i have not applied clearfix or legends fine in other browsers. first element within fieldsets , unaware float problems cause errors float above or on top of container (of course have heard of common float drop show behavior below container). any suggestions? styling legend element painful , non-cross-browser currently. it's easier (though less semantic unfortunately) use element (like dl/dt or h4 ) instead of legend . most styling problems of legend worked around using wrapper legend , apply styles wrapper instead of legend ( <div><legend></legend></div> ), invalid (there corresponding [unresolved yet] issue #200 in wg issue tracker).

Install a module using pip for specific python version -

on ubuntu 10.04 default python 2.6 installed, have installed python 2.7. how can use pip install install packages python 2.7. for example: pip install beautifulsoup4 by default installs beautifulsoup python 2.6 when do: import bs4 in python 2.6 works, in python 2.7 says: no module named bs4 use version of pip installed against python instance want install new packages to. in many distributions, there may separate python2.6-pip , python2.7-pip packages, invoked binary names such pip-2.6 , pip-2.7 . if pip not packaged in distribution desired target, might setuptools or easyinstall package, or use virtualenv (which include pip in generated environment). pip's website includes installation instructions , if can't find within distribution.

loops - Traversing through CSV file in PHP -

i have code : <?php $handle = fopen("generatepicklist.csv", "r"); $data = fgetcsv($handle, 5000, ","); ?> which opens php file , converts php array. list out array contents , display them formatted page. have code , it's working. <?php echo "<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"> <tr> <td class=\"dataheader\" width=\"100\">mat.loc.</td> <td class=\"dataheader\" width=\"20\">qty</td> <td class=\"dataheader\">description</td> <td class=\"dataheader\" width=\"150\">part number</td> <td class=\"dataheader\" width=\"30\">multiplier</td> <td class=\"dataheader\" width=\"80\">total qty</t...

javascript - accessing a specific set of values from within my json response? -

i trying use for..in loop access description key/value within 'event' @ moment not sure how achieve this. first of used for..in , logged out, returns top level entries in response, how drill down , pick out event.description? first of thought data[prop].event.description thats not case. should using normal loop , for..in inside of this? here current code: $(document).ready(function() { var data = { "status": "ok", "code": "200", "message": "event details", "data": [{ "event": { "id": "1", "name": "sample event number 1", "description": "sample event number 4 description ....", "event_date": "2012-05-31 00:00:00", "band": [{ "id": "1", ...

When is Android's backup service not available? -

the document here states that: 'data backup not guaranteed available on android-powered devices' are there examples of when backup service not available on device? backup service guaranteed there if user has installed app via google play (i.e. have google account)? thanks well, 1 thing, requires api level 8 (android 2.2) or greater, 6% of devices google play can't use it. otherwise, think it's safe assumption vast majority of devices 2.2+ , google play have access it.

What to do with getParameter() in the java code? -

i making java applet has play video file. have searched code on net gives error @ getparameter here code... public void init() { //$ system.out.println("applet.init() called"); setlayout(null); setbackground(color.white); panel = new panel(); panel.setlayout( null ); add(panel); panel.setbounds(0, 0, 320, 240); // input file name html param string mediafile = null; // url our media file medialocator mrl = null; url url = null; // media filename info. // applet tag should contain path // source media file, relative html page. // error here: invalid media file parameter if ((mediafile = getparameter("c:\\users\\asim\\documents\\jcreator le\\myprojects\\simpleplayerapplet\\src\\movie.avi")) == null) fatal("invalid media file parameter"); try { url = new url(getdocumentbase(), medi...

jquery - how to use a value (which is get by .text() when a li is clicked) as a selector to hide some div -

i have ul li list like <ul class="dropdown-menu" id="dropdown"> <li><a id='l1' href='javascript:void(0);'>batch1</a></li> <li><a id='l2' href='javascript:void(0);'>batch2</a></li> <li><a id='l3' href='javascript:void(0);'>batch3</a></li> <li><a id='l4' href='javascript:void(0);'>batch4</a></li> <li><a id='l5' href='javascript:void(0);'>batch5</a></li> <li><a id='l6' href='javascript:void(0);'>batch6</a></li> </ul> now, can text value of every li, problem is, cannot use text value selector.what want is: have div(id "batch1, batch2...batch6"),which want hide if li clicked(except clicked li). code are= html: <div id="batch1"></div> <div id="batch2...

jquery - Read url and output new javascript src -

so on page load want following: <script> $(document).ready(function () { if (document.location.hostname == "somemachine.poc") { var fileref = document.createelement('script') fileref.setattribute("type", "text/javascript") fileref.setattribute("src", "myscript.js") } }); </script> in theory , practice correct? reason put on page , doesn't work expected, , doesn't show in source of page. so end doing checking several domains, dependent on domain different src .js load. update the answers below helped me fix issue, have new issue follows on naturally question can found here: losing entire page dom running javascript you have add script document. document.body.appendchild(fileref); it still won't show in source though. dom, modified js, not source. have use dom viewer see (e.g. chrome developer tools or opera dragonfly). ...

how to calculate the Euclidean norm of a vector in R? -

i tried norm , think gives wrong result. (the norm of c(1, 2, 3) sqrt(1*1+2*2+3*3) , returns 6 .. x1 <- 1:3 norm(x1) # error in norm(x1) : 'a' must numeric matrix norm(as.matrix(x1)) # [1] 6 as.matrix(x1) # [,1] # [1,] 1 # [2,] 2 # [3,] 3 norm(as.matrix(x1)) # [1] 6 does know what's function calculate norm of vector in r? this trivial function write yourself: norm_vec <- function(x) sqrt(sum(x^2))

android - Google Maps take a long time to load -

when try load custom-made app, takes long time before locates me. know dependent on network provider , gps. apps maps locate me faster (with same setting , device). because trying out stuffs free source? subscribed map api google inc load map faster? does experience same problem? thoughts on solution? if grabs location, it's not fault it's going slow (unless have requestlocationupdates() delay set obnoxiously high, doubtful). i've been using gps in several of apps, , i've seen take less second location fix, i've seen take on 10 minutes on other devices. i don't think it's problem maps, though. sure, maybe google's map api loads tiny bit faster; don't think that's issue here.

xml - how to use xerces in java? -

this code validation of xml problem having in line 2 while importing org.apache.xerces...i downloaded xerces.jar , added external jar class run configuration,can tell me if doing write if yes why error if no should do. import java.io.file; import org.apache.xerces.parsers.domparser; public class schematest { public static void main (string[] args) { file docfile = new file("c:\\users\\ahussain\\desktop\\xml_validation\\memory.xml"); try { domparser parser = new domparser(); parser.setfeature("http://xml.org/sax/features/validation", true); parser.setproperty("http://apache.org/xml/properties/schema/external- nonamespaceschemalocation","memory.xsd"); errorchecker errors = new errorchecker(); parser.seterrorhandler(errors); parser.parse("memory.xml"); } catch (exception e) { system.out.print("problem parsing file....

Determining 'active' changeset with Mercurial? -

if have changesets a, b, c, d, e in repo , execute hg update -c d , how can confirm repo 'active' changeset d? if run hg tip or hg head , hg lists e , not d. there several ways find out: hg summary hg identify hg log -r . note hg update changes revision of working copy, should not use that.

mysql - Understanding this query (COUNT & subquery) -

i'm having trouble understanding query: select * `advertise` parent 3 <= ( select count(username) `advertise` keyword = parent.keyword , bid > parent.bid) , username = 'mike' what query display rows username 'mike' ; if row not in 3 highest bids keyword. here sqlfiddle works , don't understand how works. more don't understand 3 <= specific query. how 3 <= determine row not in 3 highest bids keyword? this query works so: the subquery select count(username) `advertise` keyword = parent.keyword , bid > parent.bid finds number of rows have higher bid same keyword. specify bid looking cannot in top 3 bids, require @ least 3 bids returned query. here think end query should like: select * `advertise` parent 3 <= ( select count(username) `advertise` keyword = parent.keyword , bid > parent.bid) , username = 'mike'

bar chart - iPad: How can I create a dynamic barchart using CGAffineTransformScale? -

i trying create animated barchart scaling bar (slider) , translating endcap. endcap works expected, however, "slider" translates when try scale horizontally. -(void) animatebaropen: (nsinteger) rowindex { nslog(@"%s: row=%d %@", __function__, rowindex, [self.values objectatindex:rowindex]); nsmutabledictionary *row = [self.values objectatindex:rowindex]; uiimageview *slider = [row objectforkey:@"slider"]; uiimageview *endcap = [row objectforkey:@"image"]; uilabel *labelinfo = [row objectforkey:@"label"]; [labelinfo settext: [nsstring stringwithformat: @"%@ %@", [row objectforkey:@"quantity"], [row objectforkey:@"color"]]]; [labelinfo settextcolor: productcolor]; float quantity = [(nsnumber*) [row objectforkey:@"quantity"] floatvalue]; float tx = 10.0f * quantity; float sx = -40.0f * quantity; [uiview beginanimations:@"open" context:nil...

security - Java: what information in error stack trace do we typically not wish to show users? -

i'm new java , i'm not familiar formatting rules used error stack trace when thrown , subsequently displayed end-user of web application. my experience oracle database error stack contains internal information, such schema , procedure names , line number(s), which, while useful debugging, prevent user seeing. here's example: java.sql.sqlexception : ora-20011: error description here ora-07894: @ "name_of_schema.procedure_name", line 121 ora-08932: @ line 10 the string want display user error description here . can extract string using regex expressions because know (1) string on first line, can extract first line of error stack trace, , (2) string begins error , ends end of line. [note oracle users (i don't want mislead you): above applies when using raise_application_error error string starting error , otherwise text error not there]. my questions java are: (1) there potentially sensitive wouldn't want users see in error stack? if so, what?...

ruby on rails - I want to add check boxes to my jQuery datatables plug in -

i have seen railscast here in episode ryan bates show data values. , creates seperate class sending json data browser. have done same. however, instead of elements, add check boxes table well. have tried many different ways same. however, check boxes donto appear in datatable columns. appears "true" or "false"values corresposnd checkboxes. i posted question on datatables forum did not receive answer useful. here code class on server side: class listingsdatatable delegate :params, :h, :link_to, :number_to_currency, to: :@view def initialize(view) @view = view end def as_json(options = {}) { secho: params[:secho].to_i, itotalrecords: listing.count, itotaldisplayrecords: listings.total_entries, aadata: data } end private def data listings.map |listing| [ h(listing.id), link_to(listing.name, listing), h(listing.telephone), h(listing.fax), #this code tried n...

jQuery show a Box on MouseOver, Donot Hide if MouseOver the Box -

i have looked in stackoverflow archives not find solution. the problem have button when mouse on it, shows box beneath it. if mouse moves out of button box should hide, tricky part comes here. if mouse leaves button remains on box box should not hide. i using mouseover , mouseout functions mouse moves out of button box hides, if try place mouse on box. (function($) { $(function() { var dropdown = $('.box'), timer, cartbutton = $('.button'); cartbutton.hover(function(){ dropdown.slidetoggle(); }); }); })(jquery); the best way wrap both box , button in containing element, , bind hover events that, instead. here simple demonstration, code here: html: <div class="container"> <input type="button" value="hover here"> <div class="box"> box content </div> </div>​ jqu...

cocos2d iphone - Tiled maps look pixelated, but when moved, they look fine -

i have tiled map in cocos2d-iphone. uses .png images. sometimes, when closely enough, notice parts "pixelated". of bad quality. then, if move character (and map scrolls), fixes , looks normal. if keep on moving randomly, might see gets wrong again etc... this never happened before until recently. weird because never touched tiled maps ever again. what causing this? iphone 4, retina enabled. the sprite positioned on sub-pixel, such 16.5f , cause distortion.

windows 8 - How to have DesignTime data in WinRT XAML? -

how can designtime data in winrt xaml designer shows sample data? simple enough. create model this: public class fruit { public string name { get; set; } } create base viewmodel this: public class baseviewmodel { public observablecollection<fruit> fruits { get; set; } } create real viewmodel this: public class realviewmodel : baseviewmodel { public realviewmodel() { if (!windows.applicationmodel.designmode.designmodeenabled) loaddata(); } public void loaddata() { // todo: load service } } create fake-data viewmodel this: public class fakeviewmodel : baseviewmodel { public fakeviewmodel() { this.fruits = new observablecollection<fruit> { new fruit{ name = "blueberry"}, new fruit{ name = "apple"}, new fruit{ name = "banana"}, new fruit{ name = "orange"}, new fruit...

Poor Flex tap response on iOS -

we have several item renderers in our app, , we've noticed responsiveness of these ui elements taps can vary greatly. example: private function setupclickhandling():void { //this.addeventlistener(touchevent.touch_tap, clickhandler); this.addeventlistener(mouseevent.click, clickhandler); } protected function clickhandler(e:object):void { var event:itemclickevent = new itemclickevent(itemclickevent.item_click, true); event.item = data; event.index = itemindex; dispatchevent(event); } when using mouseevent.click, tap not register actual click, even though control spends bit of time in "down" state. frustrating because user believes control has been triggered, nothing happens other grey background flash because click event not fired. when using touchevent.touch_tap, taps become too responsive, , list item triggered while list being drag scrolled. think tap interface...

How to make HTTP request through a (tor) socks proxy using python? -

i'm trying make http request using python. tried changing windows system proxy (using inetcpl.cpl ) url = 'http://www.whatismyip.com' request = urllib2.request(url) request.add_header('cache-control','max-age=0') request.set_proxy('127.0.0.1:9050', 'socks') response = urllib2.urlopen(request) response.read() is giving me error traceback (most recent call last): file "", line 1, in response = urllib2.urlopen(request) file "c:\python27\lib\urllib2.py", line 126, in urlopen return _opener.open(url, data, timeout) file "c:\python27\lib\urllib2.py", line 400, in open response = self._open(req, data) file "c:\python27\lib\urllib2.py", line 423, in _open 'unknown_open', req) file "c:\python27\lib\urllib2.py", line 378, in _call_chain result = func(*args) file "c:\python27\lib\urllib2.py", line 1240, in unknown_open rai...

tomcat7 - Can you set different JDBC Realms for different web apps in Tomcat 7? -

i have implemented mysql server jdbcrealm authentication in tomcat 7. can't figure out if it's possible use different schemas or tables different web apps. in essence, define different jdbcrealms different web apps. way can have different user credential schemas/tables separate web apps. know can simulated roles in tomcat. hoping find way make web apps portable associated schemas. have no idea how achieved, have no code post. either code or better, topic investigate further helpful. you have configure realm inside context of application. way, if have multiple applications deployed same instance of tomcat, each of them have own realm. also, encapsulating authentication/authorization details in application context file makes application more portable , easier deploy.

path - Perforce: Remove empty folders from depot with command-line console (p4)? -

i need way empty directory paths command-line , remove (obliterate) them depot. for automation purposes, i've been trying use p4 dirs directory-path paths, command outputs 'no such file or directory exists'. seems makes no distinction between empty directories , wrong paths. there alternate way? empty directory paths don't exist in depot. server doesn't store directories, stores files. if there directory present in depot, contains 1 or more files. in effect, directories come existence when first file stored in them in depot, , automatically disappear if last file contained obliterated. possibly, have situation have directory in depot, files in directory deleted @ head revision. if trying locate files in order obliterate them (but why?), try 'p4 files //my/directory/name/...' show files in directory.

google app engine - POS tagging on GAE -

i trying part of string tagging pull out nouns of sentence in python on google app engine. far have tried use nltk library. unable nltk working in gae. error message complains missing numpy module. this person has had same problem: https://groups.google.com/forum/?fromgroups#!topic/nltk-users/2nwztlgfyvi i cannot find clear instructions on how nltk running on gae or alternative pos tagger runs on gae edit: my steps trying nltk working (i'm on osx 10.7): install nltk via terminal "easy_install nltk" copy nltk root of appengine project /library/python/2.7/site-packages/nltk-2.0.1-py2.7.egg/nltk/ add following settings app.yaml: runtime: python27 threadsafe: false libraries: name: numpy version: "latest" write test.py import nltk in it deploy, run , following error (the numpy error solved, new one): traceback (most recent call last): file "/base/data/home/apps/s~domain/1.359540170137090086/dynamic/test.py", line 4, i...

arrays - C# Treeview Indexing -

Image
i've got bit of problem treeview , how indexing of nodes works. in program, have database can contain amount of users. each user separated carriage return (i.e. 1 user per line). i'm creating treeview object lists users in database. if user clicks on specific node, how refer node / handle being selected, dynamically making nodes database? streamreader getmembers = new streamreader(@"[data]\db\users.db"); list<string> mems = new list<string>(); members.nodes.add("members"); while (!getmembers.endofstream) { mems.add(getmembers.readline()); } foreach (string o in mems) { treenode n = new treenode(o); members.nodes[0].nodes.add(n); } database & program: if trying tree node selected can achieve treeview.selectednode property... (http://msdn.microsoft.com/en-us/library/system.windows.forms.treeview.selectednode.aspx) if want ha...

view - Getting button_to to act like link_to - Rails -

Image
i have button_to call essential want act link_to call. set use get request when click it, in url '?' appears on end of url. ex: /admins/new? instead of /admins/new . how remove ? url behaves link_to link? button_to code <%= button_to "new admin", new_admin_path, :method => :get %> take @ own question: the red arrow points elements button in fact links, styled. can same in app.

vbscript - How to softly end a process using VBS -

i end process using vbscript. unfortunally found examples in authors describing how killing process. i ask closing. objprocess.terminate() won't help. i'm using windows xp sp3 admin rights. any ideas? thank you! you try closemainwindow , close methods on process described on msdn , like: sub killingmesoftly(processname) 'partly copied http://www.activexperts.com/activmonitor/windowsmanagement/adminscripts/processes/ strcomputer = "." set objwmiservice = getobject("winmgmts:" _ & "{impersonationlevel=impersonate}!\\" & strcomputer & "\root\cimv2") set colprocesslist = objwmiservice.execquery _ ("select * win32_process name = '" & processname & "'") each objprocess in colprocesslist objprocess.closemainwindow objprocess.close next end sub this bad answer update while searching answer, discovered st...

asp.net - Will this modal Microsoft EULA popup on my web-server? -

Image
i debugging line of code: sqldatasource ds = new sqldatasource(cs.providername, cs.connectionstring, selectcommand); and microsoft eula dialog box popped up: after declining it, ended debugging something : i don't mind accepting eula's won't abide by, i'm concerned modal dialog popup, , stop, asp.net web-server. will modal microsoft eula popup on web-server? microsoft guaranteed have architected "accept on demand" license agreements not try show gui dialog if it's not running on interactive session? that's debugger popup, caused stepping reference source. declining show disassembly instead of original microsoft source code. if install visual studio , run debugger on server, pop up.

web services - How do I include a packaged WSDL to use with Java classes generated with wsimport? -

i'm coming c# realize can't expect lot of (great) usability features , functionality there in java, i've been sort of put on java project , cannot figure out. in c# / .net making web service proxy classes , generated data contracts pie reason java implementation of web services doesn't seem right me. here's deal... i use wsimport create generated .java files .wsdl files. example... "%java_home%\bin\wsimport" -quiet -extension -s .\src -d .\bin ".\wsdl\mywsdl.wsdl" i noticed hard-coded (typing phrase made me vomit now) "wsdllocation" current location of wsdl ("c:\users\me\etc\wsdl\mywsdl.wsdl"). take out: "%java_home%\bin\wsimport" -quiet -extension -s .\src -d .\bin -wsdllocation "null" ".\wsdl\mywsdl.wsdl" now when instantiate generated service... myservice xyz = new myservice(); i error. along lines of "can't find file c:\blahblah\temp\null" . ok... drawing boar...

jls - Why do try/catch or synchronized in Java require a statement block? -

java allows keywords followed statement or statement block. example: if (true) system.out.println("true"); system.out.println("true"); while (true); compiles as if(true) { system.out.println("true"); } { system.out.println("true"); } while (true); this true keywords for , while etc. however, keywords don't allow this. synchronized requires block statement. same try ... catch ... finally , requires @ least 2 block statements following keywords. example: try { system.out.println("try"); } { system.out.println("finally"); } synchronized(this) { system.out.println("synchronized"); } works, following doesn't compile: try system.out.println("try"); system.out.println("finally"); synchronized (this) system.out.println("synchronized"); so why keywords in java require block statement, while others allow block statement sin...

c++ - Passing preprocessor variable to nmake build environment -

i having issues building driver using nmake on win7 x64 build environment. defining preprocessor variable , passing on command line using - build /nmake "user_c_flags=/dmyversion=3" and build log - ... /dmyversion=3 /typedil- /wd4603 /wd4627 .... so, see variable part of compiler options. in header fie, do #define otherversion 10 #ifdef myversion #undef otherversion #define otherversion myversion #endif #define fileversion otherversion the problem fileversion being 10 irrespective of myversion define passed , exist in environment. test, going on, did - #ifdef myversion #error myversion present in environment. #endif i see statement being printed. why otherversion 10 despite preprocessor directive present in environment ? why not taking value 3 passed via command line options? i'm not sure, if works you, people did try achieve quite same using msbuild. had adapt project-file pipe definitions "into" build-process. have @...

Erratic Problems Adding User ID to MySQL Table of User Lists -

i have site users can log-in , add items list. the user logs in , session stores e-mail, use identify them in user table. then, can input list item , add list table contains id , list items. sometimes id added , comes null (however, list item text added). seems erratic because of time id included. any ideas? table type myisam. i'm new programming, btw. here's example of code: <?php session_start(); $item = $_request['item']; $email = $_session['email']; if ($item) { mysql_connect("localhost","root","") or die("we couldn't connect!"); mysql_select_db("table"); $query = mysql_query("select id users email='".$_session['email']."'"); $result = mysql_result($query,0); $user_id = $result; mysql_query("insert items (user_id,item_name) values('$user_id','$item')"); so every time test logging site myself, no problems. increasi...

ruby - Creating a shortlist in rails -

i have generic question how create shortlist in rails. what have user , job model users can register , create/edit jobs etc. enable users add jobs interested in "shortlist" can come them - want add these shortlisted jobs user dashboard. i wondering best way implement setup this? best create seperate controller shortlists , make nested resource of users , link jobs table shortlist table in database? would great ideas has implemented before? thanks! :) if i'm understanding correctly, sounds want has_and_belongs_to_many relationship here far modeling goes - user: has_and_belongs_to_many :shortlisted_jobs, :class_name => 'job' job: has_and_belongs_to_many :shortlisting_users, :class_name => 'user' as far controller setup, put job crud jobscontroller , isn't namespaced, , add needed actions manipulating particular user's shortlist userscontroller . the 1 assumption i'm making me, user in app, can add job creat...

Caching MongoDB connections in Django -

i'm using standard (as opposed nonrel) version of django connected postgresql on top of apache + mod_wsgi. setup connects mongodb (some data saved externally). right have create new mongodb connection each django request, , pass along throughout call stack functions require access mongodb. there way cache connections between requests? edit at risk of blasphemy, global variable work in case? there several ways explaining how pymongo can work (or fail) mod_wsgi, suggested here: http://api.mongodb.org/python/current/faq.html?highlight=wsgi#does-pymongo-work-with-mod-wsgi in addition can use kind of pooling solution, described here: http://www.mongodb.org/display/docs/notes+on+pooling+for+mongo+drivers one project know have pooling mongoengine , simple orm uses pymongo behind scenes. might want pymongo faq solutions above.

html - Javascript function argument setting through DOM -

i have select element i'm creating through javascript (dom) var cell_stock_id = row.insertcell(0); var cell_stock_id_sel = document.createelement('select'); i have kept onchange javascript function this- cell_stock_id_sel.setattribute("onchange","populateotherfields"); the function gets called when change selected option in select. is there way can pass argument function "populateotherfields" ? i have select box , lot of text fields in table row. want populate rows based on selection. i'm able access data has inserted in fields, don't know how enter data in textfields row. i'm thinking of passing unique number identify names of elements in row, , javascript parse pattern in names of elements of row. document.forms["0"].elements[i].name.indexof("pattern"). so there way can pass "pattern", iteration (no. of rows, row number) number. select__1, text__1, text2__1 select__2, text__2, ...