Posts

Showing posts from July, 2013

php - Sentry 2 permissions array -

i have admin panel enables admins assign different permissions user. way through tick boxes , when ticked should assign 1 permission. the problem is, permissions dynamic , needs go through loop. i've had trouble trying grasp how got assigning permissions way in guess needs loop through array , place values array. does know how go this? i have tried things like... $park = input::get('parks'); $permissions = array(); for($i = 0; $i < count($park); $i++) { $permissions = $park[$i] => 1; } or... $park = input::get('parks'); for($i = 0; $i < count($park); $i++) { $park[$i] => 1; } obviously first 1 comes errors, second 1 come out [1,1,1,1] . any appreciated.

html - Why wont this menu get aligned in the middle of the page? -

Image
i have been trying create menu fixed in middle of page. menu of 1170px in width , 30px in height blue line @ bottom. now....i'd make menu positioned in middle of page rest of items on page. align: center doesnt seem work. doing wrong? <div align="center;" id="menu"> <ul> <li><a href="#">nuestros cursos</a> <ul> <li><a href="#">spanish</a></li> <li><a href="#">english</a></li> <li><a href="#">french</a></li> <li><a href="#">german</a></li> </ul> <!-- end inner ul--> </li> <!-- end main li--> </ul> <!-- end main ul--> <ul> <li><a href="#">preparación de exámenes</a> <ul> <li...

android - Fixed Size Screen Element -

i attempted make simple app see if make element fixed size, in case 4cm wide, regardless of device. tried use screen xdpi, use inch, multiply constant 4cm. doesn't appear working after trying on few different devices. final windowmanager w = (windowmanager) getapplicationcontext().getsystemservice(context.window_service); final display d = w.getdefaultdisplay(); final displaymetrics m = new displaymetrics(); d.getmetrics(m); //find correct x density , multiply 1.5748 4cm float density = m.xdpi; density = (float) (density * 1.5748); int intdensity = (int)math.ceil(density); //now set view dimensions want, must inside of it's own layout? box.setlayoutparams(new linearlayout.layoutparams(intdensity,100)); any suggestions?

dotnetnuke - Error while adding project -

i'm trying create new solution dot net nuke. i installed packages , configured iis work it. then visual studio created new solution. want import old module created, copied/pasted folder in "desktopmodules". then vs right click on solution , selects add existing project. this way error: web application project "name" configured use iis. web server " http://dnndev.me/desktopmodules/name " not found. it's because corresponding projet configured use web server depending on url you've got. suggest edit project file notepad (csproj or vbproj) , remove specified url configuration. have set useiis value false. note configuration stored in users project file (.vbproj.user or .csproj.user). then, try again add project solution.

Apigee to Send Host Header to Endpoint -

this question relating apigee configuration. i want able send request "host" header our endpoint. for example : request : int.api.com/path/uuid?apikey=key or request : test.api.com/path/uuid?apikey=key i should see in request x-host=int.api.com . i have created policy sends header x-host fixed. i don't know how dynamically set host header based on request host header. i have tried many things. any appreciated ! try using assignmsg save request host header (request.header.x-host) variable (let's call user3645204.variable ). can access user3645204.variable in response flow.

merge - Change column names after merging multiple data frames into one in R -

after merging multiple data frames one, know how change column headers in master data frame represent original files came from. merged large number of data frames 1 using code below: library(plyr) dflist = list.files(path=dir, pattern="csv$", full.names=true, recursive=false) import.list = llply(dflist, read.csv) master = reduce(function(x, y) merge(x, y, by="hours"), import.list) i columns belonged each original data frame named unique id original data frame/ csv file named (i.e. aa, ab, ac). unique ids in filenames comes before low line ("_") can isolate them using code below. however, having trouble applying column headers. appreciated. filename = dflist[1] unqid = strsplit(filename,"_")[[1]][1] you define function in llply call , have read.csv assign names. or rename them after reading them in , before merging @joran suggested #first names filenames = dflist #i unsure line below, unqid = lapply(filenames,function(x)...

c# WebBrowser not showing info inside -

(first of all, sorry english) well, have problem in 1 client message try show doesn't appear in component showing component empty, happends in 1 client 1000. started fail since yesterday, client has windows 7, don't know ie version in case, i'm doing newvalue introduce words bold. i can't reproduce error on machine, knows reason (windows update, ie version, text inside,...) make fail or show blank?? webbroser inside form, use messagebox, can print colors or else figure in message. private void setwebbrowsertext(string newvalue) { try { if (this.webbrowser1.document == null) this.webbrowser1.navigate("about:blank"); if (!string.isnullorempty(newvalue)) newvalue = string.concat("<div><font color=\"#000000\" size=\"2\" face=\"verdana\">", newvalue.replace("\n", "<br>"), "</font></div>...

Python 2.7: if code block not working -

i have tested out following program, , there no errors. whenever enter "hangman" won't start new block of if statement code named "if response_2" . why not running it? response_2 = raw_input("what play? hangman or word guess?") if response_2 == ("hangman", "hangman"): print "running hangman..." print "catching criminals..." print "building gallows..." print "getting 1 song boy pirate's of carribean" elif response_2 == ("word_guess", "word_guess", "word guess", "word guess", "word guess", "word guess", "word_guess", "word_guess"): print "not completed yet" this because directly comparing tuple == , give false raw_input gives string, not tuple . need check if 1 of responses in sequence. in : if response in ('hangman', ...

mercurial - why is a new head created during this push? -

Image
my production code in default branch, new features go named branches merged default when new features ok. merged development daytemp default , started work on branch separate processes . pushed had bitbucket, status shows now: i realized there bug in default so, @ computer, pulled, updated default , fixed bug. commited commit a7cf17ca158e ( "bug: bars displayed..." ) , wanted push bitbucket. tortoise hg on computer shows: can please me understand problem is? mercurial docs understand have standard situation (i have 2 heads, 1 default , 1 separate processes ) not understand new 1 bitbucket warns me creating when pushing. edit turned out that, following vince 's comment, there indeed new head hidden down graph. output hg outgoing : changeset: 152:ce343f208e48 parent: 150:ebd10baed373 user: wojtek date: thu may 15 06:21:43 2014 +0200 summary: bug: time string when no connection changeset: 161:a7cf17ca158e tag: t...

php - Trying to relate tags to products by product category -

ok here's trying do. have tags column (pid,tag) , products column (id, name) . there ton of tags related 1 product. i have tags filter option can select tags , filter products tags. there can 1 tag being queried or 10 tags being queried. instance, there check boxes tags , user can select many tags want , should filter products have tags associated. can't seem figure out fastest way this. i can each products tags pretty quick, how each product tags tags. here expecting. tags being searched by: 'deck mount, single, 3in' products id, name, array(deck mount, single, 3in, strait, black, green, blue) select p.* products p having p.loc_cat = 'faucets' , (select pid tags pid = p.id , tag = 'body:deck mount'); that's example of query using. here 2 tables. create table `tags` ( `id` int(11) unsigned not null auto_increment, `tag` varchar(255) not null default '', `pid` varchar(255) not null default ...

Android App Crashing Depending on how Array of Objects is declared? -

thanks reading , helping out! appreciate it. on 1 of activities in app have list view, supposed display array of custom type "memberlistobject" have custom memberlistobjectadapter class. code works great when delcare array such(in oncreate method). list displays how want too memberlistobject[] memberlistobject_data = new memberlistobject[]{ new memberlistobject(r.drawable.icon_pin,"chocolate") }; memberlistobjectadapter adapter = new memberlistobjectadapter(this, r.layout.listview_item_row, memberlistobject_data); listview1.setadapter(adapter); however when delcare array this memberlistobject[] memberlistobject_data= new memberlistobject[5]; memberlistobject_data[0].icon=(r.drawable.icon_pin); memberlistobject_data[0].title="chocolate"; memberlistobjectadapter adapter = new memberlistobjectadapter(this, r.layout.listview_item_row, memberlistobject_data); listview1.setadapter(adapter); my app crashes when activi...

java - In JavaFX & Scene Builder, how do I open a new window when clicking a button? -

i've got fxml file second window, , i'm lost here. how program open new window , fxml after press button? this how have first window set @override public void start(stage primarystage) throws exception { parent root = fxmlloader.load(getclass().getresource("main.fxml")); scene scene = new scene(root); primarystage.setresizable(false); primarystage.setscene(scene); primarystage.settitle("hello world!"); primarystage.show(); } so copy change values new window? how link button? i've tried event handlers no avail. if using fxml, on button there property called onaction. can find on "code" section in scene builder, or directly on .fxml file. there type name of method. then, need create method in controller class of scene. if have not created controller scene, need set property "controller" in scene's root element, did onaction of button. in method have created, type code open new sc...

javascript - Opening multiple pages at once with one script -

i have code below, want open pages user checks, 1 opens right now. <form> <input type="checkbox" id="site1" name="site1" value="site1">site1<br> <input type="checkbox" id="site2" name="site2" value="site2">site2 <input name="submit" value="check" type="submit" onclick="validate()"> </form> and script: function validate() { if (document.getelementbyid('site1').checked) { window.open('http://www.site1.com'); } else { } } i have in separate scripts maybe there way? function validate() { if (document.getelementbyid('site2').checked) { window.open('http://www.site2.com'); } else { } } your answer appreciated! loop on selected checkboxes , call window.open . function validate() { $(":checkbox:checked").each(functi...

javascript - After AJAX call, newly loaded CSS selectors not available to jQuery.each() -

note though i'll defer wisdom of herd, don't agree duplicate (at least not linked), , unable find answer problem on linked page. goal: load html element via ajax modify css of newly loaded elements based on information in data-attributes. dilemma: after finishing (1) above, newly loaded selectors don't seem available. i've been trying variations of jquery.on() try jquery register these newly added dom elements. don't need event handling; want alter css of of newly arrived elements. i've tried dozen variations on below—most of attempt make style changes within ajax.success() callback, rather after it; last effort. this has simple, i'm hour in , jsut can't see it... here's sample of loaded html: <div class="jsonprinter-row indented-0 odd-row has-children" data-tab-offset="0" data-key-offset="0"> <div class="jsonprinter-key">category</div> <div class="jso...

android - I am getting the Following error when executing the code -

fatal exception: main java.lang.runtimeexception: unable start activity componentinfo{com.bugs3.munishgupta.cabup/com.bugs3.munishgupta.cabup.wannahier}: java.lang.nullpointerexception @ android.app.activitythread.performlaunchactivity(activitythread.java:1956) @ android.app.activitythread.handlelaunchactivity(activitythread.java:1981) @ android.app.activitythread.access$600(activitythread.java:123) @ android.app.activitythread$h.handlemessage(activitythread.java:1147) @ android.os.handler.dispatchmessage(handler.java:99) @ android.os.looper.loop(looper.java:137) @ android.app.activitythread.main(activitythread.java:4424) @ java.lang.reflect.method.invokenative(native method) @ java.lang.reflect.method.invoke(method.java:511) @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:825) @ com.android.internal.os.zygoteinit.main(zygoteinit.java:592) @ dalvik.system.nativestart.main(native method) caused by: j...

regex - domain name regular expression not matching -

i have shell script @ /www/cgi-bin/test can access on network @ http://192.168.1.1/cgi-bin/test . i attempting parse query string, should d=domain.com , , validate against regular expression: #!/bin/sh echo "content-type: text/html" echo "" domain=${query_string#d=} if [[ ! $domain =~ [a-za-z0-9-]+(\.[a-za-z0-9-]+)*(\.[a-za-z]{2,}) ]]; exit fi echo "validation success!" when didn't work, tried using regex stole here : if [[ ! $domain =~ \ ^(([a-za-z](-?[a-za-z0-9])*)\.)*[a-za-z](-?[a-za-z0-9])+\.[a-za-z]{2,}$ \ ]]; exit fi i can't regex match either. in both cases, tried escaping curly braces ( \{2,\} ) according advanced bash-scripting guide , didn't make difference. in case it's relevant, platform i'm on openwrt 12.09. edit: realized shell script might not support bash's [[ ... =~ ... ]] syntax. unfortunately openwrt doesn't ship bash. if don't have bash , and/or cannot replace s...

javascript - mongodb native driver get collection names without database name -

how can collection names without database name mongodb native driver nodejs? db.collectionnames(function(err, collections) { if (err) { log.error(err); } else { log.info(collections); } }); this code returns this: databasename.collection1, databasename.collection2, databasename.collection3 but want names: collection1, collection2, collection3 the exact structure of response sub-document "name" key in array: [ { name: 'test.cursors' }, { name: 'test.episodes' }, { name: 'test.zips' }, { name: 'test.scripts' } ] so use map regex replace : db.collectionnames(function(err, collections) { console.log( collections.map(function(x) { return x.name.replace(/^([^.]*)./,""); }) ); }); and strip out first . database prefix. in case have collection names . in them.

c++ - More than one enum declaration -

there quote sec. 3.3.1/4 of n3797 working draft: given set of declarations in single declarative region, each of specifies same unqualified name, — 1 declaration shall declare class name or enumeration name not typedef name , other declarations shall refer same variable or enumerator, or refer functions , function templates; we can declare enum type name several times in single declarative region: enum a; // declared first time, other declaration same // unqualified name shall refer same variable or enumeration. enum a; // , other declarations shall refer enumeration extern int a; // fail, enum hidden , can access // via elaborated-type-specifier i'm confused. can explain behavior? find corresponding references current working draft. the full quote n3797 3.3.1/4 is: given set of declarations in single declarative region, each of specifies same unqualified name, — shall refer same entity, or refer functions , f...

php - how to get and display my site name from other table (laravel) -

i wanted create view able list site user have admin rights. how pass , show site name in view? let user id no 1, view show site name have admin rights. i use people_site (admins) table record rights. sites table: -------------------- id | site_name | address 101 | abc | 2131 102 | cde | 23212 103 | efg | 23231 104 | hij | 1234 peoples table: -------------------- id | first_name | last_name | paswword 1 | alex | lee | ******* 2 | bryan | john | ******* people_site (admin )table: -------------------- id | people_id | site_id 101 | 1 | 101 102 | 1 | 102 103 | 2 | 103 104 | 1 | 104 105 | 2 | 101 controller: public function getmanage(){ return view::make('account.manage') ->with('admins', admin::where('people_id', '=', auth::user()->id)->orderby('updated_at', 'desc')->get()); } view: <ul> @foreach...

JavaScript / Jquery call controller synchroneousely -

i need synchronously call controller (url) in javascript. ajax function so: $.ajax({ type: 'post', url: base + '/publication/storeworldcat', data: data, success: success, datatype: datatype, async:false }); i don't understand why should use ajax function async:false parameter ajax asynchronous definition. $post() asynchronous too. is there better way? thanks help! looking @ the documentation of jquery.ajax (quoting ) : by default, requests sent asynchronously (i.e. set true default) . if need synchronous requests, set option false .

java - Generate link with two input fields -

i have 2 input fields field1 , field2 i want generate external link when clicking submit button e.g. of link follow, www.mystie.com/field1 + sometext + field2 i need formula use google map direction user request.getparameter( "field1" ) in action servlet string link = request.getparameter( "field1" ) +"sometext" + request.getparameter( "field2" ); where html is <form action="myservlet" method="post"> <input name="field1"/> <input name="field2"/> </form>

php - Offering file download within a session -

i trying make file download dependent inside session. here code: <?php> session_name("my-download"); session_start(); $_session['download-authorized'] = 1; echo "<a class='invlink' rel='nofollow' download target='_blank' href='download.php?download_file=file.to.download.pdf'>name of file</a><br /><br />"; ?> the download script ('download.php') comes next: <?php session_start(); if(!isset($_session['download-authorized'])) { exit; } $path = $_server['document_root']."/downdir/"; $fullpath = $path.$_get['download_file']; if ($fd = fopen ($fullpath, "r")) { $fsize = filesize($fullpath); $path_parts = pathinfo($fullpath); header("pragma: public"); header("expires: 0"); header("cache-control: must-revalidate, post-ch...

constructor - get/set methods and constrcutors in class diagram -

recently assigned develop use case diagram , class diagram conference management system.first developed use case diagram , class diagram. in class diagram have following unclear parts: do need show , set methods private fields in every class. or can omit , set methods, since obvious. do need show constructors in class? if not necessary, reason not showing them? have seen lot of class diagrams without constructors reason beyond understanding. any on above questions appreciated. gets , sets methods not uml definition. way how manipulate attribute values in programming languages. pure uml know attribute , type, name , other properties. typical usage of getters , setters in programing implement readonly or derived (calculated) attributes. you not have define getters , setters in uml class diagram. constructor: you can define constructor operation in class of course. constructor operation has keyword "create" @ beginning of name. can assign behavior de...

python - how to add dynamic arguments to urls in django -

i have website ,i let user manager account . in account page ,it show articles submitted . to make simple ,i let can choose show how many articles in 1 page.by default show 10 articles in 1 page ,it done django pagination function ,if user want show 20 articles in 1 page, add arguments current urls . for example : ?num=20 then second page url should ?num=20&page=2 the problem ,once click page next button ,the url change ?page=2,there no num arguments pass django. and there more arguments need pass django ,like show articles in subject in sports,so should add 1 more arguments ,like ?num=20&sub=sport&page=2 but how can make work? all know give every argument parameter ,like url(_(r'^post/(?p<num>\w+)/(?p<sub>\w+)/(?p<page>\w+)/$'), views.post, ), how can design url ? if have 5 arguments need post . if use url arguments ?num=20&sub=sport&page=2 have them in request.get . print request.get['num'], r...

centos capture the output from the java background process -

i running java process in background. prints out log through system.out. supposed run long time, can't stop now. running on centos 6. is there command capture output java process running in background? thanks. it doesn't matter it's java, problem capture stdout of running process in linux, , quick search produces this: how can process intercept stdout , stderr of process on linux? .

windows - Batch script for checking if a server is online -

i want have windows batch script goes through list of servers , checks every server ping if online. list of servers should simple plain text file , should this: ... "google" www.google.com "node1" 221.12.123.1 "download server" dl.myserver.com "login server" login.myserver.com ... here simple rundown program should do: print list of descriptions of servers in list screen. ping first server server 4 times if 1 ping succeeds should return online if 4 pings fail should return offline. print online or offline next first server in printed list run step 2 , 3 other servers in list. the output should following: ... google: online stackoverflow: online node1: online download server: offline login server: offline ... i want know if possible in (windows) batch , how it. if isn't possible in batch, programming language should use? possible program in python? i thankful if post code how this, thanks! @echo off setloc...

reporting services - SSRS/MDX - Needs to display all months -

i want display 12 months (january-december) in matrix. i'm passing 1 parametr @year . when have these months in cube, it's ok if not - doesn't display months. should do, have missing months , zeros in them? example: @year = 2013 jun | feb | ... | dec 19 | 3 | ... | 6 i have: @year = 2014 jun | feb 12 | 23 what want have: @year = 2014 jun | feb | mar | apr |... 12 | 23 | 0 | 0 |... thanks in advance, monica

sqlite - Android select multiple records -

with query select record, want select record next id, should combine these 2 select, how can do? string sql ="select _id, date, score, score1 points score = '"+score_ricevuto+"' order date desc"; string sql ="select _id, score, score2 points score = '"+score_ricevuto+"'; like so: select _id, date, score, score1, score2 points score = '"+score_ricevuto+"' order date desc";

javascript - Converting SVG path data into a usable image -

i new raphael js. trying take svg data image , make usable. however, documentation not intuitive @ all. i have tried various ways resize paper image , vice-verse no success. can show me how make image: not upside down when renders be reasonable size the code: took out horrible attempts... <div id="paper"></div> function drawperson(raphael) { var paper = raphael('paper'); var path = "m 677 5943 c 8 -6 -21 -25 -86 -59 l -97 -51 l 14 -59 c 7 -32 11 -77 7 -99 c -3 -22 -7 -60 -9 -85 c -4 -53 -19 -118 -41 -179 c -20 -58 -20 -58 20 -65 c 43 -8 44 -11 38 -66 c -4 -38 -11 -49 -35 -63 c -23 -13 -29 -23 -27 -45 c 2 -15 -4 -38 -14 -52 c -9 -13 -17 -33 -17 -43 c 0 -10 -6 -28 -14 -40 c -7 -12 -21 -62 -31 -112 c -9 -49 -25 -110 -35 -135 c -35 -89 -120 -466 -120 -534 c 0 -18 -10 -40 -25 -56 c -40 -42 -57 -163 -40 -277 c 8 -56 54 -110 100 -119 c 64 -12 68 -27 35 -131 c -37 -119 -50 -214 -47 -338 c 3 -95 16...

google app engine - How to store data from Android to some cloud and access it from Windows 8 app? -

i making app in android need store images/videos on cloud , need view/retrieve data in windows 8 (dextop) app. cloud service better use , can use free (i need @ max 1 gb) app engine google cloud storage. perfect use.

javascript - extend function in jquery -

i new query , trying understand below plugin function doing, not understanding. var pluginname = 'widgets'; function plugin(element, options) { /** * variables. **/ this.obj = $(element); this.o = $.extend({}, $.fn[pluginname].defaults, options); this.objid = this.obj.attr('id'); this.pwctrls = '.jarviswidget-ctrls' this.widget = this.obj.find(this.o.widgets); this.toggleclass = this.o.toggleclass.split('|'); } i thankful if 1 great in jquery explain step step. thank in advance. regards, mona jquery's $.extend merges contents of 2 or more objects first object. in other words, takes object default settings plugin, gets object passed in options , , joins them options overwrite defaults. example var defaults = { setting1 : '2', setting2 : true } function plugin(options) { var settings = $.extend({}, defaults, options); /* settings contain { setting1...

php - How to go prevent a song from uploading if the query fails and vice versa? -

i have music application user uploads , song , song information added mysql database. right stands script takes song, renames it, , uploads server. after done takes renamed song , additional information passed form , queries database. there way prevent either action happening if either fails? right if upload fails query not run if upload works , query fails option delete song uploaded every time happens? might not possible , didn't post code because i'm looking idea not fix. thanks. you can send ajax request server run query. if query succeeds can start upload. if fails, upload wont start. if succeeds, can retrieve inserted id of database entry , put in hidden field on page. start upload of file , include inserted id in request. if upload files whatever reason, remove id database. note: sure run sorts of security checks id.

neo4j - Get subpath when there is connection between concrete node and each node in subpath -

i have events ordered in chain according dates. see example . want subpaths have happend on specific date. lets date known. have written this: start d=node(73) // date node match node=d-[:when]->(l)<-[:follows*0..]-(f)<-[:when]-d return f,l; and seems work more or less ok. have 2 issues: it returns 2 items result. there little issues parsing. can unite 2 values whole path? i'm not sure order. can possible 1st element in sequence l last element in path? i think easier construct paths if know last element in subpath find. posible last element belongs date (it means last element should belong date , next him should absent or belong date) ? update: have found way merge values collenction: start d=node(74) match node=d-[:when]->(l)<-[:follows*0..]-(f)<-[:when]-d [ f,l ] qwe return qwe; if interested in path can do: start d=node(73) // date node match (d)-[:when]->(l),(d)-[:when]->(f), path=(l)<-[:follows*0..]-(f) retur...

python - Using the twitter API in Django -

i've been using python twitter tools automate stuff (automatically add tweets favourite etc.). useful, thought i'd turn open-source program called "mojito". problem i'm not expert in python/django, , i'm stuck here: this form used collect 2 variables: mkeyword (the keyword on twitter) , mcount (how many tweets): from django import forms class getvariables(forms.form): mkeyword = forms.charfield(max_length=100) mcount = forms.integerfield(max_value=100, min_value=1) i have "mojitoform" function uses python-twitter-tools' auto_fav function. both below: def mojitoform (request): try: form = getvariables(request.post) if form.is_valid(): mkeyword = form.cleaned_data['mkeyword'] mcount = form.cleaned_data['mcount'] success = true tweets = auto_fav( mkeyword, mcount)['text'] except: notloggedin = true return render (request, '../templates/dashboard.html', locals()) this...

dojo - dijit.layout.ContentPane Image blinks at page load and disappears -

i using following code show picture. image blinks @ page load , disappears. below php code. echo " <div data-dojo-type=\"dijit.layout.contentpane\" class=\"dojopane\" data-dojo-props=\"region: 'top'\" style=\"height: 25px; background-color: #eeeeee;\"></div> <div data-dojo-type=\"dijit.layout.contentpane\" class=\"dojopane\" data-dojo-props=\"region: 'center'\" style=\"overflow: hidden; padding: 0px;\"> <img src=\"$profilephotofile\" style=\"width: 100%;\"> </div> <div data-dojo-type=\"dijit.layout.contentpane\" class=\"dojopane\" data-dojo-props=\"region: 'bottom'\" style=\"height: 25px; background-color: #eeeeee;\"></div> ...

security - Java Wep Application Deployment -

i wrote first web app using vaadin framework , i'm trying deploy online. exported .war file , uploaded here: http://www.eatj.com/ error security when trying run. (project name - jtpwebapp) type exception report message description server encountered internal error () prevented fulfilling request. exception javax.servlet.servletexception: servlet.init() servlet com.example.jtpwebapp.jtpwebappui$servlet threw exception org.apache.catalina.authenticator.authenticatorbase.invoke(authenticatorbase.java:472) org.apache.catalina.valves.errorreportvalve.invoke(errorreportvalve.java:98) org.apache.catalina.valves.accesslogvalve.invoke(accesslogvalve.java:927) org.apache.catalina.connector.coyoteadapter.service(coyoteadapter.java:407) org.apache.coyote.http11.abstracthttp11processor.process(abstracthttp11processor.java:987) org.apache.coyote.abstractprotocol$abstractconnectionhandler.process(abstractprotocol.java:579) org.apache.tomcat.util.net.jioendpo...

android - Getting TextView view object from "onCreate" Activity's method -

i'm having trouble on trying retrieve textview object id inside oncreate method activity. my activity's xml fragment textview's section: <textview android:id="@+id/message_display_field" android:layout_width="fill_parent" android:layout_height="wrap_content" /> the oncreate method: protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_display_message); if (savedinstancestate == null) { getfragmentmanager().begintransaction() .add(r.id.container, new placeholderfragment()).commit(); } intent intent = getintent(); string message = intent.getstringextra(mainactivity.extra_message); // create text view textview tv = (textview) findviewbyid(r.id.message_display_field); tv.settext(message); } textview tv = (textview) findviewbyid(r.id.message_display_field); not return textview expect r...

python - Paramiko ssh with tor sock proxy -

i trying use tor proxy ssh. first simple connection without ~/.ssh/config ~$ ssh -p <server_post> <user>@<server_host> <user>@<server_host>'s password: ~$ echo $ssh_connection <my_real_host> <my_real_port> <server_host> <server_port> second next ~/.ssh/config : host * proxycommand connect -4 -s 127.0.0.1:9050 $(tor-resolve %h 127.0.0.1:9050) %p and connect: ~$ ssh -p <server_post> <user>@<server_host> <user>@<server_host>'s password: ~$ echo $ssh_connection <not_my_real_host> <not_my_real_host> <server_host> <server_port> now paramiko : >>> import paramiko >>> client = paramiko.sshclient() >>> proxy = none >>> client.set_missing_host_key_policy(paramiko.autoaddpolicy()) >>> client.connect(hostname=host, username=user, password=password, ... port=port, sock=proxy) >>> stdin, stdout...

python - Bold a table cells -

i have following code: table = document.add_table(rows=1, cols=8) hdr_cells = table.rows[0].cells hdr_cells[0].text = 'name' hdr_cells[1].text = 'surname' hdr_cells[2].text = 'telephone' (...) is possible make cells bolded? that: hdr_cells[0].text = 'name' hdr_cells[1].text = 'surname' hdr_cells[2].text = 'telephone' hdr_cells[0].text.bold = true hdr_cells[1].text.bold = true hdr_cells[2].text.bold = true this should trick in particular case: hdr_cells[0].paragraphs[0].add_run('name').bold = true or, more step-by-step: col_names = ('name', 'surname', 'telephone') table = document.add_table(rows=1, cols=len(col_names)) hdr_cells = table.rows[0].cells idx, name in enumerate(col_names): paragraph = hdr_cells[idx].paragraphs[0] run = paragraph.add_run(name) run.bold = true

javascript - How secure is window.location for identifying the hosted server -

i have script inserted unknown number of other websites via <script> tag. after being inserted, script read window.location of webpage , use information bring in content specific webpage. how secure window.location when attempting determine host name of webpage loading script? spoofed?

change dimensions videos format via ffmpeg-php to a custom size without stretch -

Image
i use code convert , change dimensions videos format each other... exec("ffmpeg -i $sourcepath -ar 22050 -ab 32 -f flv -s 1200x800 $uploadpath1 2>&1") but have poblem... for example if input video dimensions 600 * 300...output video dimensions 1200*600 without stretch...just black background 1200*600 video inside it... if u did not underestand mean...i attached pic question explain mean better... if want embedd small video input in larger video, can use pad filter in below example put 720x404 video in 1280x720 video top left pixel @ (0,72) ffmpeg -i in.mp4 -vf pad=1280:720:0:72 out.mp4 ffmpeg version n-58949-g0e575c2 copyright (c) 2000-2013 ffmpeg developers built on dec 9 2013 22:06:49 gcc 4.8.2 (gcc) configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetype --...

mongodb - Why can the documents referred to by a PHP MongoCursor object changes after a for each loop iterates through it? -

first explain situation, ask question. situation: assuming php mongodb database object "db" refers database has collection called "products". each document in our "products" collection looks this: { _id: <objectid> upc_code: <int> discontinued: <bool> for_sale: <bool> modified: <date> } imagine there thousands of these documents. imagine each, "discontinued" false, , "for_sale" true. modified dates not same. step 1: search 100 oldest-modified products: $newproducts = db->products->find(array('discontinued'=>false))->sort(array('modified'=>1))->limit(100); step 2: "for each" loop through $newproducts, , check each one's "upc_code" via api external web service. each product has been discontinued, update database, setting "discontinued" value true : foreach($newproducts $product) { $discontinued = checkapi($p...

Python Awis API giving not IOError -

i have installed https://github.com/muhuk/python-awis in order url information alexa. i using import awis api = awisapi(access_id, secret_access_key) tree = api.url_info(("example1.com", "example2.com", "example3.com"), "rank", "linksincount") elem = tree.find("//{%s}statuscode" % api.ns_prefixes["alexa"]) assert eenter code herelem.text == "success" when try run script, error: traceback (most recent call last): file "c:\users\john\desktop\python scripts\domains\alexa api\alexaurl.py", line 3, in <module> tree = api.url_info(("example1.com", "example2.com", "example3.com"), "rank", "linksincount") file "c:\users\john\desktop\python scripts\domains\alexa api\awis\__init__.py", line 121, in url_info [finished in 0.5s exit code 1] return self.request(params, **kwargs) file "c:\users\john\desktop\python sc...

ios - Xcode launch app error in Mac 10.9 Mavericks -

i using macosx 10.9.3 maverick, xcode 5.1.1 . try launch app in simulator, happen black screen , close xcode. notice: process: xcode [625] path: /applications/xcode.app/contents/macos/xcode identifier: com.apple.dt.xcode version: 5.1.1 (5085) build info: ideframeworks-5085000000000000~10 app item id: 497799835 app external id: 520942841 code type: x86-64 (native) parent process: launchd [151] responsible: xcode [625] user id: 501 date/time: 2014-05-19 09:43:47.454 +0700 os version: mac os x 10.9.3 (13d65) report version: 11 anonymous uuid: 9c94cd1d-3b3c-6a87-75c0-b9fadf7f71b3 crashed thread: 7 dispatch queue: dbglldblauncher serial queue exception type: exc_crash (sigabrt) exception codes: 0x0000000000000000, 0x0000000000000000 application specific information: productbuildversion: 5b1008 assertion failed: (out_port != 0), function startdebugserverprocess, file /sourcecache/lldb/lldb-310.2.37/source/...

android - Selendroid - ANDROID_HOME not found even after setting it -

i trying run selendroid test mobile website run test exception saying: may 19, 2014 11:48:59 io.selendroid.selendroidlauncher launchserver info: starting selendroid-server port 4444 may 19, 2014 11:48:59 io.selendroid.selendroidlauncher launchserver severe: error occurred while building server: io.selendroid.exceptions.selendroidexception: environment variable 'android_home' not found! java.lang.runtimeexception: io.selendroid.exceptions.selendroidexception: environment variable 'android_home' not found! @ io.selendroid.server.model.selendroidstandalonedriver.initapplicationsundertest(selendroidstandalonedriver.java:142) @ io.selendroid.server.model.selendroidstandalonedriver.<init>(selendroidstandalonedriver.java:80) @ io.selendroid.server.selendroidstandaloneserver.initializeselendroidserver(selendroidstandaloneserver.java:91) @ io.selendroid.server.selendroidstandaloneserver.<init>(selendroidstandaloneserver.java:65) @ io.se...