Posts

Showing posts from 2011

Hibernate Session is not open Using Javafx -

i developing simple application in javafx hibernate using netbeans 7.3.1 in small project have connected hibernate using wizards setup. want show company table data in tableview using hibernate. when run app showing error message below: info: building session factory initial sessionfactory creation failed.net.sf.cglib.core.codegenerationexception: java.lang.reflect.invocationtargetexception-->null java.lang.runtimeexception: java.lang.reflect.invocationtargetexception @ javafx.fxml.fxmlloader$controllermethodeventhandler.handle(fxmlloader.java:1440) @ com.sun.javafx.event.compositeeventhandler.dispatchbubblingevent (compositeeventhandler.java:69) @ com.sun.javafx.event.eventhandlermanager.dispatchbubblingevent (eventhandlermanager.java:217) @ com.sun.javafx.event.eventhandlermanager.dispatchbubblingevent (eventhandlermanager.java:170) @ com.sun.javafx.event.compositeeventdispatcher.dispatchbubblingevent (compositeeventdispatcher.java...

c# - Multilingual app include translation dll in exe file -

i have multilingual application, default language mine, , i've translated en-us. has dll file under ..debug\en-us\programname.resources.dll , i've noticed program failes load translations, if dll not in en-us folder next executable file. there way include dll in exe file, doesn't need around, , still able modifie resx files translations? windows can load language-related resources exe in several ways, corresponding language folder\file, corresponding dll file in same folder or choosing corresponding resources inside of exe. many localization tools want, example sisulizer can create translated versions of exe replacing corresponding resources inside. not sure digital signing of such exe, should signed after translation (because changing of resources can broke sign).

The selected directory is not a valid home for Android SDK -

i android programmer, use eclipse. want try android studio, thus, download , tried open it. it says have put sdk path. what have tried i tried set android-sdk eclipse working on it. sdk date , have supports, apis ...etc. also i found question here in stackoverflow problem: android-studio selected directory not valid home android sdk solution open android studio , press f4 , go platform setting , press plus green sign select sdk select path android-sdk , did of android studio keeps telling me the selected directory not valid home android sdk any appreciated i found solution myself, answer run android studio administrator :p

vb.net - Create a program to run from the system tray -

i create program run bottom right system tray of windows. but don't know start from? can tell \ show me , examples or commands use \ research ? i review answers note miss icon. private sub form1_resize(byval sender object, byval e system.eventargs) handles me.resize if me.windowstate = formwindowstate.minimized notifyicon1.visible = true notifyicon1.icon = systemicons.application notifyicon1.balloontipicon = tooltipicon.info notifyicon1.balloontiptitle = "verificador corriendo" notifyicon1.balloontiptext = "verificador corriendo" notifyicon1.showballoontip(50000) 'me.hide() showintaskbar = false end if end sub private sub notifyicon1_doubleclick(byval sender object, byval e system.eventargs) handles notifyicon1.doubleclick 'me.show() showintaskbar = true me.windowstate = formwindowstate.normal notifyicon1.visible = false end sub

ant - Maven/Jenkins - trouble running Maven from Jenkins -

so have project runs jenkins, calls maven, calls ant (dont ask why) runs series of jmeter tests. i know ant , jmeter stuff works fine. issue im having when trying add maven mix. i have calling pom.xml simple references ant build.xml file. error below: started user anonymous building in workspace c:\users\murphya1\.jenkins\jobs\jmeter-running-mavin\workspace parsing poms discovered new module jmeter-running-maven:jmeter-running-maven jmeter-running-maven modules changed, recalculating dependency graph [workspace] $ java -cp "c:\users\murphya1\.jenkins\plugins\maven-plugin\web-inf\lib\maven31-agent-1.4.jar;c:\users\murphya1\desktop\code samples\apache-maven-3.1.0-bin\apache-maven-3.1.0\boot\plexus-classworlds-2.4.2.jar" jenkins.maven3.agent.maven31main "c:\users\murphya1\desktop\code samples\apache-maven-3.1.0-bin\apache-maven-3.1.0" c:\users\murphya1\.jenkins\war\web-inf\lib\remoting-2.30.jar c:\users\murphya1\.jenkins\plugins\maven-plugin\web-inf\lib\maven...

java - display results in jsp by calling a servlet using jquery ajax? -

i want call servlet. servlet fetch data database , keeps in request. , result need t display in some.jsp using jstl tags. $('#ownform #mybutton').click(function() { $.ajax({ type: "get", url: "./controller", success: function(msg) { //todo }, error: function(ob,errstr) { //todo } }); }); in servlet have below code: //keep database returned list in request request.setattribute("myresult", result); request.getrequestdispatcher("/web-inf/some.jsp").forward(request, response); please me how can achieve it? ignore jsp. use flexjson serialize result directly result object json. print serialized result out stream in response. something this: response.setcontenttype("application/json"); response.setcharacterencoding("utf-8"); jsonserializer serializer = new jsonserialize...

javascript - jqGrid - Detecting backend HTTP response code on edit -

Image
i have jqgrid have added editing functionality through php script. have seen when row edited , row data posted through ajax/jquery http request. my php scripts takes edits, runs sql statement , fine. nevertheless, wish check if data not insert correctly , respond non 200 response code. i wondering how parse response code php script in order cancel row edit if server not return 200. thus far have added callback function reloadtable edittable call, returns id of edited row. $('#grid').jqgrid("editrow", id, true, '', '', '', '', reloadtable); function reloadtable(result) { //alert(result); } update based on answer jqgrid reload grid after successfull inline update / inline creation of record have tried adding following not refresh grid... function reloadtable(rowid, result) { $("#grid").trigger("reloadgrid"); } javascript: <script language="javascript"> function ...

jQuery using .html() but needing to exclude an element -

i'm using .html() pull list of <li> 's div need exclude li id of #donate-link at current jquery is var _topbarmenu = $("<div/>").attr({ "id": "topbarmenu", }).append($('.tabs').html()) .prepend("<li id='shop-link'>"+_pm+"</li>"); as can see i'm pulling data in using $('.tabs').html() , have tried $('.tabs').html().not('#donate-link') not seem work . edit content var _topbarmenucontent = $('#header .tabs').html(); $(_topbarmenucontent).find('#donate-link').remove(); var _topbarmenu = $("<div/>").attr({ "id": "topbarmenu", }) .append(_topbarmenucontent) .prepend("<li id='shop-link'>"+_pm+"</li>"); var _topcontent = $("<div/>").append(_topbarlogo).append(_topbarmenu); $(_topbar).append(_topcontent);...

Visual Studio Setup Project - How to Obtain the Directory Path from a File-Search Launch Condition -

i looking way add file(s) existing directory has random name part of visual studio setup project , hoped might able me solve puzzle please. i have been attempting obtain discovered path property of directory using launch condition; unfortunately method returns full file path including filename, cannot used directory property. the directory in question takes form [appdatafolder]company\product\aaaaaaaaaaaa\ aaaaaaaaaaaa random installation string. within launch condition setup check directory's existence searching file appear inside it, search target machine (name): file marker filename: sample.txt folder: [appdatafolder]company\product\ property: dirfile launch condition (name): file marker exists condition: dirfile in setup project add file wish insert, details condition: dirfile folder: 'installation folder' then in file system setup add new folder entry random directory aaaaaaaaaaaa (name): installation folder condition: dirfile defaultlo...

c# - protobuf-net: Backward compability when type has changed? -

is there way provide backward compability when member type has changed? example, class person consists in version 1 of 1 integer, in version 2 of string. know breaking contract, example issue isn't seldom in real life software development. thanks in advance. // version 1 [protocontract] class person { [protomember(1)] public int id { get; set; } } // version 2 [protocontract] class person { [protomember(1)] public string id { get; set; } } a shim property best bet: // version 2 [protocontract] class person { [protomember(1)] private int? id_v1 { { return null; } // means won't serialized set { if(value != null) id = value.tostring(); } } [protomember(2)] public string id { get; set; } }

swing - Only numbers and one decimal point allow on jtextfield in java -

this question has answer here: is there way accept numeric values in jtextfield? 19 answers jformattedtextfield double still takes characters [duplicate] 2 answers have jtextfield in java form. want not allow type alpha(characters) , allow type numbers. and can't type 2 decimal point , 2 numbers after decimal point.(that jtextfield price..) please tell me how step step. use jformattedtextfield numberformat (see for example ). alternatively can add own documentfilter document of jtextfield

database - Sybase bcp error -

what want copy table file, truncate table , copy data table. for this, using following 2 commands: out: bcp table out file.csv -s server -u user -p password -r '\n' -t '^|' -c in: bcp table in file.csv -s server -u user-p password-r '\n' -t '^|' -c -j iso_1 -b 5000 this error get: cslib message: - l0/o0/s0/n36/1/0: cs_convert: cslib user api layer: common library error: result truncated because conversion/operation resulted in overflow. the interesting part ( me, @ least ) error rows first column being odd number . first 3 million rows, cuts half of them, having first column ( pk ) odd number. i tried different options, none seem work: no problem charset far can tell, there no huge columns such truncated , not carriage return missing. any appreciated. update: after creating format-file there no more errors, copies half of data table. update: managed create format file works , loads data, cannot use on server (it works in te...

c++ - Forcing the operation system to perform cleanup after a "subroutine" -

i'm writing images-processing program in c++. purpose, have modified third party program (an edge detector) static library use in my program. it seams original edge detector relied on os clean memory after main function has been executed. unfortunately, after have modified original code, main function became "common" repeatedly called function , no automatic cleaning therefore performed. result huge memory leak every time function called. i'm not able exhaustively review whole code of detector fix this. i'd therefore ask: in general, there way separate "subroutine" of whole program (in case detector) rest , force os clean after subroutine if stand-alone program? there solution use of threads, example? thank replies. if using *nix platform, perhaps fork library call.

c# - Preserve XML entity references while getting InnerText or InnerXml with XmlDocument -

i trying innertext or innerxml of xml node using xmldocument , @ same time want preserve &amp; &apos; &quot; . however, if try innerxml , preserves &amp; not &apos; , &quot; i know exact reason why happening , solution problem. e.g. suppose have xml node text inside &quot;&apos;cancel&apos; &amp; &apos;abort&apos;&quot; , in retrun when read node innerxml (or innertext ), must give me exact same string output. but when try this, returns, "'cancel' &amp; 'abort'" means preserves &amp; note: <source>&quot;&amp;cancel&apos;&quot;</source> <target>&quot;&amp;cancel&apos;&quot;</target> this have in xliff(xml) file, while reading xliff(xml) file, want retrieve text inside both nodes visible now, without exclusive conversion or processing. the problem xliff(xml) data have, contains both ' or " &apos; , &q...

How to customize the jquery autocomplete search mechanism -

i want customize search behavior of jquery autocomplete, existing code below var data = [ {"url":"http://site/test.php", "label":" test course"}] $k(".input").autocomplete({ max:10, source: data, multipleseparator: " ", select: function( event, ui ) { window.location.href = ui.item.url; }, appendto: "#results", open: function() { var position = $("#results").position(), left = position.left, top = position.top; $("#results > ul").css({left: left + 20 + "px", top: top + 4 + "px" }); } }); i need ignore white spaces in data (search data). suppose if type "testcourse", must result "test course". how this. ...

java ee - change name on wicket application -

as said want change name of wicket application. preferably set name in pom.xml consistent through versions. right looks this: localhost:port/artifactid-version what want is localhost:port/artifactid thanks if you're building wicket app via maven , creating war file of form 'artifactid-version.war' , servlet engine's using deployed name, 1 option set ${project.build.finalname} property in pom ${project.artifactid} (or 'warname' value in war plugin config).

css - How to to customize GWT components style? -

i'm developing multi-module application using gwt 2.5.1. i'm not using gwt theme. want customize style of gwt widgets, example button , checkbox . i see 2 solutions: write css file loaded in application (link in html page). css contain css rules using gwt defined names, .gwt-button buttons , .gwt-checkbox, .gwt-checkbox-disabled checkboxes. solution don't takes advantage of css optimizations made gwt compiler. use cssresource , set style name each time use button or checkbox. solution take advantage of css optimizations requires set style name every time create new widget. there other solutions? correct one? you can put styles in cssresource well. put @external on top of styles in css file, , go. for example: @external gwt-datepicker; .gwt-datepicker { ... } hope helps.

rabbitmq - How to send value with message on bunny queue on rabbitmp -

i want send values message in bunny message queue on rabbit server. there possibility of doing that. in advance. finally found it. in queue can able publish headers properties this, in send.rb conn = bunny.new conn.start ch= conn.create_channel q = ch.queue("queuename") msg = "message want send" q.publish( msg, :persistent => true, :headers => { :user_id => "10", :user_name => "xxx"} ) in receive.rb conn = bunny.new conn.start ch = conn.create_channel q = ch.queue("queuename") ch.prefetch(1) begin q.subscribe(:ack => true, :block => true) |delivery_info, properties, body| puts "message : #{body}" puts "to userid : #{properties[:headers]["user_id"].to_s}\n" puts "to userid : #{properties[:headers]["user_name"].to_s}\n" ch.ack(delivery_info.delivery_tag) end rescue => e puts "error #{e.to_s}...

HTML5 Canvas manipulate letters with mouse -

i'm new html5 canvas, have little experience it. i'm trying accomplish have 50 letter d's, different sizes , color moving around on screen. when user gets close these letters mouse want letters speed , move around. have tutorial on this? are comfortable these javascript concepts? arrays, objects, event handlers, timers, prototyping, pseudo-classes if feel comfortable these javascript concepts, check demo out: start demo , hold mouse down create "particles". the particles repelled mouse proximity. http://soofw.com/demos/fountains/ it works circle "ball" objects, can adapt code draw d's instead: ball.prototype.draw=function() { surface.context.font = this.font; // add font property ball class surface.context.fillstyle = this.color.v surface.context.filltext("d",this.x,this.y); } and on... if you're not comfortable code, @vincent piel suggests: google = html canvas library.

javascript - Cached jQuery objects -

i've been developing number of js heavy sites recently, whilst favour majority of time using pure js, jquery without doubt has uses , i'm relying on quick event binding / bubbling. question here using jquery cached objects , how best use them. i've found myself doing along these lines in majority of js scripts. jquery.noconflict(); var doc = jquery(document), // root jq object html = doc.children('html'), // check modernizr classes container = html.find('.container'); // base content container /** module 1 **/ (function($, w, undefined) { container.on('click', 'button', function(e) { ... }); })(jquery, window); /** module 2 **/ (function($, w, undefined) { container.on('click', 'a.module', function(e) { // creating further jq objects in contextual situations var self = $(this); // or better var clicked = container.find(this); }); })(jquery, window)...

c# - How to sort and delete specific files? -

(i didn't realize long posts frowned upon) my program reads directory of files looks similar following: bkupsalesreportjan2011(txt).zip bkupsalesreportjan2011(pdf).zip bkupsalesreportjan2011(doc).zip bkupsalesreportfeb2011(txt).zip bkupsalesreportmar2011(doc).zip bkupsalesreportmar2011(pdf).zip goes on few hundred more files... i want save 1 copy of each report based on file type (in order of priority). want keep pdfs , delete duplicates. if there no pdfs keep docs , lastly keep txts. what best way implement sorting , deleting using visual c# , windows forms? you can use regex parse file names data , linq duplicates or distinct records. poco: public class filedata { public string original { get; set; } public string type { get; set; } public string name { get; set; } public int weight { { return getweight(type); } } private static int getweight(string option) { // put files in order pdf, doc, txt, etc switch(option)...

c++ - Incorrect serial port input/output -

i attempting activate serial port on beaglebone black , have connected tx rx. wrote test program. in it, setup serial port 1152000 baud , no parity according found @ how open, read, , write serial port in c . below main function: int main(void) { char *portname = "/dev/ttyo4"; int fd = open (portname, o_rdwr | o_noctty | o_sync); if (fd < 0) { printf ("error %d opening %s: %s", errno, portname, strerror (errno)); return 0; } set_interface_attribs (fd, baud_rate, 0); set_blocking (fd, 0); while (true) { write (fd, "hello!\n", 7); char buf [100]; int n = read (fd, buf, sizeof buf); std::cout << buf; std::cout.flush(); sleep(1); } return 0; } when run it, read on serial port rx, isn't hello, "ù¶" instead. can tell me why happening?? kind regards cornel

javascript - How can i alter the HEIGHT of PANEL in jquery mobile? -

how reduce height of panel in jquery mobile? $(function(){ $('#payable_panel').css('width','60%'); $('#payable_panel').css('height','30px'); } i've tried using code, doesn't seem work! in jqm panel min-height 100%. try following in style sheet. .ui-panel{ min-height: 200px !important; } here fiddle demo

java - Jenkins: Use Archived Artifact in Promoted Build -

i've archived artifact last step of build , it's available this: https://xxx.ci.cloudbees.com/job/xxx/52/artifact/target/xxx-1.2.1-snapshot-r8304-20130807-1507-app.zip how can access artifact in promotion process? please note need access specific build, not latest successful one. the goal of promotion process copy artifact s3 our deployment job further process it. might promote build #52 development (copy specific s3 bucket), later on promote build #50 production , on. ideally, can access artifact in shell script rename file etc. there environment variable access archived artifacts of build, cannot find or how should done? $build_url , $job_url specific promotion process , don't point build in shell scripts on promotion job. with copy artifact plugin can copy artifacts other builds in promotion process, don't need do. i believe have found solution. summary do not use specified permalink use specific build , set build number ${promoted_numbe...

meteor - Handlebar doesn't render a collection field correctly -

i'm having problem trying use collection field named created in template. reserved word, or something? the part of template that's struggling looks this: {{#each threads}} <tr> <td><a href="forumshowthread?id={{_id}}">{{topic}}</a></td> <td>{{creator.username}}</td> <!-- line below evil one. --> <td>{{created}}</td> <td>{{lastpost.poster.username}} {{datetime lastpost.posted}}</td> </tr> {{/each}} the threads find in console in browser following: [ object _id: "ngetonq8xm36ktg3s" created: 1375881336372 creator: function (){ creatorid: "zmkpmdhp4gtzqo98e" lastpost: function (){ posts: function (){ subcategory: function (){ subcategoryid: "axgd2xzctkfmphmwm" topic: "testing" __proto__: object , object _id: "xafemvavcrzpbkxg3" created: 1375882602652 creator: function (){ creatorid: ...

Including CoffeeScript file in rails -

i have taken @ coffeescript , want try out in rails app. know rails 3.1 coffeescript included within rails. having issues getting work. i have file called lens.js have renamed lens.js.coffee , , converted js coffee. screen casts have seen , blogs have read seemed needed. not picking file somehow. get http://www.cairo.dev/javascripts/lens.js 404 (not found) is console dropping. including other js files. = javascript_include_tag 'lens', 'jquery-ui.min', 'rails', 'application', 'popup', 'jquery.zclip', 'underscore-min' note: link haml which should work since compiles coffeescript js. wondered if wasn't installed added gem 'coffee-script' gemfile , bundled still nothing. am doing stupid. or missing? try not add gem 'coffee-script' in gemfile but: group :assets gem 'coffee-rails' end if doesn't work, can try removing lens javascript_include_tag , make sure have line...

Bootstrap textarea adding space characters inside text field -

i using bootstrap 3 rc1. problem having textarea — when page loads adds 3 spaces texarea, making placeholder text invisible, unless manually delete spaces. how stop happening? html <form id="notesubmitform"> <fieldset> <textarea id="note-text" rows="6" placeholder="add note" class="form-control"> </textarea> <div class="form group"> <button id="notesubmitbutton" type="submit" class="btn btn-success btn-custom"> save note </button> </div> </fieldset> </form> css textarea#note-text { width: 625px !important; } how stop happening? by not having whitespace between textarea tags, have right now: <textarea id="note-text" rows="6" placeholder="add note" …> </textarea> there’s line break (first line break directly @ beginni...

c# - Call Interface Method from Console Application -

i have web application have class: public class ptpostalcodeservice : iptpostalcodeservice { private readonly irepository<ptpostalcode> _ptpostalcoderepository; public ptpostalcodeservice(irepository<ptpostalcode> ptpostalcoderepository) { _ptpostalcoderepository = ptpostalcoderepository; } public ptpostalcodedto getptpostalcode(int postalcode, int? postalcodeextension) { ptpostalcode ptpostalcodedomain = new ptpostalcode(); ptpostalcodedomain = _ptpostalcoderepository.get( filter: p => p.postalcode == postalcode && (postalcodeextension.hasvalue == false || p.postalcodeextension == postalcodeextension), includeproperties: "ptcouncil, ptcouncil.ptdistrict").firstordefault(); var ptpostalcodedto = mapper.map<ptpostalcode, ptpostalcodedto>(ptpostalcodedomain); return ptpostalcodedto; } } now need access methid getptpostalcode consoleapplication, ide...

jsf 1.2 - JSF 1.2 hx selectone menu, on change update content without page refresh -

i have page selectonemenu , wondering if there way can update content in div without page refresh. trying right , doesnt work. know can onchange="submit()", refreshes page, dont want page refresh also, possible hx:behavior and/or ajaxrefreshsubmit? if yes can show me simple example achieve that. help <hx:selectonemenu value="#{bean.myvalue}" valuechangelistener="#{controller.valuechangemethod}"> <f:selectitems value="#{bean.values}" /> </hx:selectonemenu> <div id="divtobeupdated"> #{bean.displayvalue} </div> you use ajax above purpose. here sample code <h:form id="welcome"> <h:selectonemenu id="countrydropdown" value="#{pracbb.mycountry}" > <f:selectitem itemlabel="india" itemvalue="ind"/> <f:selectitem itemlabel="usa" itemvalue="usa"/> <a4j:support event="onchange" action...

node.js - nodejs request library, get the response time -

using nodejs request library: https://github.com/mikeal/request var request = require('request'); request('http://example.com', function (error, response, body) { ... }) is possible response time on callback? doc mentions response.statuscode. looking @ library source code see undocumented response.headers , response.href, don't see responsetime or similar. or, there alternative library request provides response time? ps: know this, that's not solution, making many async requests , cannot control when each request started. var request = require('request'); var start = new date(); request('http://example.com', function (error, response, body) { ... var responsetime = new date() - start; }) the request library can timing ( docs ): request.get({ url : 'http://example.com', time : true },function(err, response){ console.log('request time in ms', response.elapsedtime); }); as question implies,...

function - How do you get the values greater than a number from a list in scheme? -

how extract , return list numbers greater number found in given list? know how return max different. example (gfifty ‘(a b (c d) 1 56 67 g)) (56 67) in example above, returns list containing values greater 50. teach me master. :) the idiomatic solution use filter : (filter (lambda (x) (and (number? x) (> x 50))) '(a b (c d) 1 56 67 g)) => '(56 67) to see how write implementation scratch, take @ this answer. if search recursive (if must search inside sublists), study this other answer.

Find Type of Form Data -

so i'm not sure how word this. trying validate form data json schema. use dojo create form , fetch it's contents when user clicks submits. data in form returned strings. when schema finds field should number throws error because technically string if input '123'. there way form data while preserving it's primitive type? array.foreach(formdata, function(item) { postdata[string(item.title)] = domattr.get(item, "value"); }); any ideas? use parseint() or parsefloat() when validating string. check out here .

java - Access to one portlet from another -

i'm trying write portlet, in want create/edit .properties file inside other portlet (i want manipulate properties file responsible translates other portlet). want in following way: properties prop = new properties(); prop.setproperty("...", "..."); string pathtoohterportletpropertiesfile = ... prop.store(pathtoohterportletpropertiesfile); after run there following errors: severe: servlet.service() servlet seap servlet threw exception java.io.filenotfoundexception: (...my path...)\tomcat- 7.0.27\webapps (access denied) @ java.io.fileoutputstream.open(native method) @ java.io.fileoutputstream.<init>(unknown source) @ java.io.fileoutputstream.<init>(unknown source) @ main.translator.processaction(translator.java:49) does know solve problem? regards i suggest using portlet events solve instead. have first portlet send event portlet owns properties file. on event, pass along information other portlet need make update. have other ...

Connect local database c# -

Image
i want create empty local database inside project's folder , i've error: an unhandled exception of type 'system.data.sqlserverce.sqlceexception' occurred in system.data.sqlserverce.dll on line conn.open(); i'm lost need do. idea causing this? tried few solutions - 1 of them... sqlceconnection conn = null; try { conn = new sqlceconnection("data source = bd-avalia.sdf; password ='<asdasd>'"); conn.open(); sqlcecommand cmd = conn.createcommand(); cmd.commandtext = "create table cliente(id_cliente int identity not null primary key, nome varchar not null, password not null int)"; cmd.executenonquery(); } { conn.close(); } the error: if debug code (or output somehow) can check nativeerror property of sqlceexception , should tell cause of exception. see http://technet.microsoft.com/en-us/library/aa237948(v=sql.80).aspx explanation of code.

html - How to load an image using its real path in Grails -

my idea save images user uploads outside context path follow: d:\somefolder\myweb\web-app\ d:\somefolder\imagesoutsidecontextpath\ the code next (working locally): string path = servletcontext.getrealpath("/"); string parentfolder = new file(path).getparentfile().getparent(); string imagesfolder = parentfolder + "\\imagesoutsidecontextpath"; another idea (if 1 doesn't work on server) save images in current user's home folder @hoànglong suggested me . but i'm not able load images view. think this article official documentation not valid purpose. the next code desn't load anything: <img src="d:\\somefolder\\imagesoutsidecontextpath\\bestimageever.jpg" alt="if don't see message, i'll happier"> how use real path instead url path load these images? you can set src action . user not know images stored (security) , can change logic display them. in action, image , print bytes. example here . ...

javascript - Are there any performance costs of using JSLINQ -

when read question, please not answer "memory cheap" or yada yada. i wondering; , save me time , i'd grateful, if had timed difference between raw approach querying javascript arrays including memory usage, versus using linq. an application building getting quite large on memory , yet tool jslinq beneficial me, able scientifically measure pros , cons of performance using jslinq rather brawl through javascript arrays myself save teenytiniest of performance. if there no responses, of course find out myself, nice little experiment future users. my javascript object arrays range generating tables of users = , orderby yada yada... doing joins on users profiles. trying find out if it's better return datasets , refine snippets of data javascript, or continuously call server side pages using ajax. regardless of choose, it's performance hit i'm interested in. jslinq looking tempting because uses familiar technique me, query data... alas, cannot use if add...

ASP.Net codebehind - get google paid advert info -

i have ecommerce site written in asp.net. there way site code see when user referred site paid google ad? note should work on page - not search landing page. [more detail - can see in google analytics 20%+ of paid click traffic hits 'register' page, small portion registers. want check how many of these failing captcha check, , hence bots rather real traffic.] you can implement solution using global application class (global.asax) file. if implement application_beginrequest event along request.server["http_referer"] or request.urlreferrer can know current request coming from, , capture possible google ads domains it. void application_beginrequest(object sender, eventargs e) { string referer = request.servervariables["http_referer"]; if (referer != null && referer.indexof("google") > -1) { //coming google } }

arrays - Python: Calculate metrics from list of APIs -

i have array of data looks this: #api name, min, max, average ['findproductbypartnumber', '336.0', '336.0', '336.0'] ['findproductbypartnumber', '336.0', '339.0', '337.5'] ['findproductbypartnumber', '336.0', '339.0', '338.0'] ['findproductbypartnumber', '336.0', '341.0', '338.75'] ['findproductbypartnumber', '336.0', '353.0', '341.6'] ['findproductbyid', '841.0', '841.0', '841.0'] ['findproductbypartnumber', '336.0', '920.0', '438.0'] ['findproductbypartnumber', '336.0', '944.0', '510.29'] ['findproductbypartnumber', '336.0', '952.0', '565.5'] ['findproductbypartnumber', '336.0', '975.0', '611.0'] ['findproductsbycategory', '113.0', '113.0',...

Audio Mixing in iOS using AVFoundation doesnt work -

i trying stitch bunch of videos , add music on video in ios. audio added using avmutableaudiomix . when video exported audio mix missing. here how code looks : - (void)mergevideos:(nsarray *)videos{ avmutablecomposition *mixcomposition = [[avmutablecomposition alloc] init]; avmutablecompositiontrack *videotrack = [mixcomposition addmutabletrackwithmediatype:avmediatypevideo preferredtrackid:kcmpersistenttrackid_invalid]; avmutablecompositiontrack *audiotrack = [mixcomposition addmutabletrackwithmediatype:avmediatypeaudio preferredtrackid:kcmpersistenttrackid_invalid]; cmtime currenttime = kcmtimezero; (avasset *asset in videos) { // 2 - video track [videotrack inserttimerange:cmtimerangemake(kcmtimezero, asset.duration) oftrack:[[asset trackswithmediatype:avmediatypevideo] ob...

xcode - Workspace created by cocoapods is locked -

i'm using cocoapods project. ran pod install , installed correctly. when try open created xcworkspace xcode displaying error 'workspace file locked'. tried unlock it's not working. didn't include frameworks (security.framework, mobilecoreservices.framework etc.) in workspace. i had problem recently. don't know missing frameworks, if go project folder within terminal , modify permissions on project files, should able open project. had modify multiple files , folders able stop asking me if want unlock files. steps worked me: use terminal go folder contains xcworkspace file. type sudo chmod 777 nameofyourworkspacefile.xcworkspace (please don't literally use file name unless that's xcworkspace file called). should change permissions entire workspace, still have unlock problem pods project. from within same directory, can chmod on pods folder so: sudo chmod 777 pods after that, go pods folder typing "cd pods" , modify p...

How Javascript Parsing the syntax -

actually, statement like., (var = 0, ; < row; i++,) {} makes *.js not load in browser. in c/c++ easy find, syntax error. here took me 20 mins trace bug happened accidentally in cut/copy/paste. my question : facing issue., when , why issue occurs? how find easily. as comments on question say, use development add-ons in browsers. can speak firefox, there bunch of great tools available. for firefox, normal debug console useful of need debug , test, can validation on of content firefox displaying/running. for things out of debug consoles reach, use firebug. can need inspect, @ headers , responses of ajax requests. i know chrome has developer tools, , bet there great add-ons out there too. these tools make things go faster using alert('spot1') ... alert('spot2') debugging techniques. give line numbers syntax errors.

html - Content area height 100% taking the header into account -

i trying fill length of screen content area of 100% height ignores header makes area long. other solutions not work. i need able adjust growing content (with scroll bar on page not #mainview), , when there not enough content fill page, #mainview should fill screen (with no scrolling). http://jsfiddle.net/ssf8s/6/ css: html, body { height: 100%; margin: 0px; } #container{margin:20px;height:100%} #header { height: 80px; background: pink; } #mainview { height: 100%; background: red; box-sizing: border-box; border:solid 4px pink;border-top:none; } html: <div id="container"> <div id="header"> --header </div> <div id="mainview"> --main </div> </div> let header overlay main view, , pad top of main view avoid it: #header { height:80px; background:black; position: absolute; top: 0; left: 0; width: 100%; } #mainview { height:100%; background:red; padding-top:...

c# - Microsoft.Office.Interop.Excel.Application SaveAs() method does not preserve encoding -

i'm having issue saving excel files csv's , preserving encoding in c#. specifically, following takes excel file , saves csv file same name, passed loadcsvdata function, job insert data database in organized fashion. issue excel file contains fractional symbols not recognized in csv format, unless manually open each .xml , save csv (for reason works while microsoft.office.interop.excel.application method saveas() not): list<string[]> data = new list<string[]>(); string filename = (date.tostring("mm/dd/yyyy") + ".csv").replace("/",""); string excelfilename = (date.tostring("mm/dd/yyyy") + ".xml").replace("/",""); system.console.writeline("processing file: " + filename); system.console.readline(); // open excel , save csv. process data microsoft.office.interop.excel.application ap...

eclipse - Adding connector in Subversive -

i add connector testing in subversive. however, under preference > team > svn > svn connector, can't seem see how this. should re-install plugin , select more 1 connector? in eclipse, goto help--> install new software in,install window, enter below url in work text field http://community.polarion.com/projects/subversive/download/eclipse/2.0/update-site/ then in below box you'll list of connector, select , click next...

android - ath6kl: interface is not up for AP mode -

i have ar6003 chip on android 4.2.2 device. switched open source ath6kl driver, having issue getting access point running. actually, can, in weird way. i using: hostapd v2.0-devel-4.2.2 wpa_supplicant v2.0-devel-4.2.2 this how run hostapd service in init.rc: mkdir /data/misc/wifi/hostapd 0770 wifi wifi chmod 0660 /data/misc/wifi/hostapd.conf service hostapd /system/bin/hostapd -dd /data/misc/wifi/hostapd.conf class main socket hostapd_wlan0 dgram 660 root wifi user root group wifi oneshot disabled hostapd.conf file: interface=wlan0 driver=nl80211 ctrl_interface=/data/misc/wifi/hostapd ssid=androidap channel=6 ieee80211n=1 when enable wi-fi tethering option in android ui, checkbox checked, notification active tether no appearing , ap mode not working. android reports: https://gist.github.com/thewhisp/6176213 when ap mode in "semi-working" state, via adb shell manually start hostapd (with su permissions): hostapd -dd /data...

performance - Scrolling is not smooth in android Grid View -

in android application, loading images api's. after images loaded in grid view, scrolling not smooth. using asynchronous threads fetch images not block ui. any suggestions improve performance of scrolling. loading images in separate thread helps, there's important performance issue take care of here, , that's "view reusability", once you've set image in adapter, make sure reusing views provided in getview method of adapter, , not creating/inflating new layout(gridelement) every time method called, causes scrolling go slow once images have been loaded, there's several patterns available approach issue, should read viewholder, common , easy use pattern issue... hope helps... regards