Posts

Showing posts from August, 2010

javascript - How to update kml file/layer dynamically? -

i using kml file displaying map custom boundary lines. kml file downloaded website. in file, inside placemark tag there no point tag display icons. eg: <placemark> <name>spot 2</name> <description>.....</description> <styleurl>....</styleurl> <multigeometry><polygon><outerboundaryis><linearring><coordinates> ......... </coordinates></linearring></outerboundaryis></polygon></multigeometry> </placemark> that placemark tag contains in kml file. , need, 1) how can add point tag placemark tag. there way add dynamically?. kml file has 5000 , above placemarks. 2) point tag coordinates refers center of polygon. i.e) need following <placemark> <name>spot 2</name> <description>.....</description> <styleurl>....</styleurl> <multigeometry><polygon><outerboundaryis><line

javascript - Gravity Forms - Show link after submission -

i have link set display: none url of file users can download after correct submission of gravity form. things want show link if submission successfull. the event have found far gform_post_render , triggered each time form loaded, if there error. any suggestions? it turns out found appropriate event: $(document).bind('gform_confirmation_loaded', function() { //do stuff });

amazon web services - Laravel and environment variables in command line production without .env file -

when upgraded laravel 5 started using env system set configurations inside file @ root. .env db_host=x.x.x.x.x db_username ... this file not part of repo , when deploy set same variables onto system environment variables (using amazon beanstalk here) accessible without need of .env file. so works when use command line in scripts in production these system environment variables don't seem accessible in command line. accessible when php served through web server. i found if copy add .env file works in command line that's why i'm confused, thought system prevent committing sensitive information repo , seems have so can use php artisan migrate , other commands in production. am missing something? there way system environment variables available in command line or have somehow create .env file dynamically in production? i thought .env file part of setting server. .env file ignored git, once it's setup, can push/pull heart's content , it'll

cq5 - Workflow session throws RepositoryException on updating Workflow data -

trying save properties in workflow metadata , below code snippet using same. try { if (workitem.getworkflowdata().getpayloadtype().equals("jcr_path")) { addvaluestometadata(workitem, workflowsession,metadatamap); } metadatamap wfmetadata=workitem.getworkflowdata().getmetadatamap(); set<string> keys=metadatamap.keyset(); (string key : keys) { if(key.startswith("xyz")){ wfmetadata.put(key, metadatamap.get(key)); } } workflowsession.updateworkflowdata(workitem.getworkflow(), workitem.getworkflowdata()); } catch (exception e) { e.printstacktrace(); } i not closing session, throws following exception. javax.jcr.repositoryexception: session has been closed. @ org.apache.jackrabbit.oak.jcr.delegate.sessiondelegate.checkalive(sessiondelegate.java:367) @ org.apache.jackrabbit.oak.jcr.session.sessionimpl$readoperation.checkpreconditions(sessionimpl.java:110) @ org.apache.jackrab

python - choosing reads with Hamming distance zero -

i have fastq files, reads.fastq . have list of 7-mer strings. each read in reads.fastq , want check if contains @ least 1 of 7-mer strings in list. condition that, if match found ( hamming distance ==0 ) read written array chosen_reads , next read fastq file matched. if match not found loop continues till match found. output array consists of unique reads, since matching loop terminates once first match found. wrote following code reads in output array not unique since matches hamming distance 0 reported. please suggest edits: def hamming(s1, s2): #return hamming distance between equal-length sequences if len(s1) != len(s2): raise valueerror("undefined sequences of unequal length") return sum(ch1 != ch2 ch1, ch2 in zip(s1, s2)) x in bio.seqio.parse("reads.fastq","fastq"): reads_array.append(x) nmer = 7 l_chosen = ['gttattt','attattt','tgctagt'] chosen_reads = [] x in reads_array: s2 = str

Why cant I use the variable "i" from my constructor in other member functions? C++ -

i'm working on creating bank program programming methodology and, reason, can't seem use value assign variable i in constructor in of other member functions. instance, if user input 6 , i calculated 0.005 constructor, value (0.005) not passed makepayment function. instead, i reset zero. can shed light on this? code below. loan_data::loan_data(double p, double n, double i) { cout << "enter loan amount: $"; cin >> p; cout << "enter loan length: "; cin >> n; cout << "enter credit score: "; cin >> i; = / 100; = / 12; n = n * 12; bal = p; = (p * ((i * pow(1 + i, n)) / (pow(1 + i, n) - 1))); cout << "a is: " << << endl; cout << "bal is: " << bal << endl; cout << "i is: " << << endl; } void loan_data::makepayment(double pay) { cout <&l

How to split slash / separated string in two variable in php -

assume applicant id passed other form.i have array variable coming database, here code : $array_id_applicants = explode(";",stripslashes($applicant_id1)); $applicants_num = count($array_id_applicants); $arr_app_num = array(); for($x=0;$x<=$applicants_num;$x++) { if($array_id_applicants[$x]){ $applicant_id = str_replace("'","",$array_id_applicants[$x]); $applicants = getdata("select cellphone personal applicant_id='".$applicant_id."'"); $replace_array = array("-","(",")","+","_"); array_push($arr_app_num,str_replace($replace_array,"",$applicants[1][cellphone])); } } $applicant_number = implode(";",$arr_app_num); echo $applicant_number; exit; assume value of array : $applicant_number = '639152478931 / 631687515455','631235497891' i want output : $applicant_number = '639152478931','631687515455','6312

monitoring - Monitor Hadoop Cluster using Collectl -

i evaluating various system monitoring tools use 1 monitor hadoop cluster. 1 of tools impressed collectl. have been playing around since couple of days. i struggling find how can aggregate metrics captured collectl when using colmux? say, have 10 nodes in hadoop cluster each running collectl service. using colmux can see performance metrics of each node in single view (in single , multi-line formats). great! but if considering aggregate of cpu, io etc on nodes in cluster. want find how cluster whole performing aggregating performance metrics each node corresponding numbers, thereby giving me cluster-level metrics instead of node-level. any appreciated. thanks! i had answered on mailing list benefit of not on i'll repeat myself here.. that's cool idea. if understand correctly might see sort of total line @ bottom? can add wish list no promises. think may have solution if don't mind doing little work on own ;) btw - can assume you've installed

Is it possible to install bcrypt manually -

my webhost, ipage, has not yet made bcrypt available cgi scripts, , because it's not server can't install bcrypt myself using pip or easyinstall etc. question is, possible download bcrypt tarball pc , unzip , load directories , files ipage site tree myself? thanks! bcrypt standard can implemented in different ways. i'm not familiar "ipage" sounds have file access. all need find library implements bcrypt in whatever cgi scripting language using, , include , use in code. for example if using php, php library offers bcrypt. might find this library implements bcrypt in php. need add password.php under lib directory site, in php scripts need bcrypt require new file , should able use functions. see library documentation information on that.

python - What are the loc and scale parameters in scipy.stats.maxwell? -

the maxwell-boltzmann distribution given maxwell-boltzmann http://mathworld.wolfram.com/images/equations/maxwelldistribution/inline9.gif . scipy.stats.maxwell distribution uses loc , scale parameters define distribution. how parameters in 2 definitions connected? appreciate if tell in general how determine relation between parameters in scipy.stats , usual definition. the loc parameter always shifts x variable. in other words, generalizes distribution allow shifting x=0 x=loc . when loc nonzero, maxwell.pdf(x) = sqrt(2/pi)x**2 * exp(-x**2/2), x > 0 becomes maxwell.pdf(x, loc) = sqrt(2/pi)(x-loc)**2 * exp(-(x-loc)**2/2), x > loc. the doc string scipy.stats.maxwell states: a special case of chi distribution, df = 3 , loc = 0.0 , , given scale = a , a parameter used in mathworld description . so scale corresponds parameter a in equation http://mathworld.wolfram.com/images/equations/maxwelldistribution/inline9.gif in general need read

Libgdx FitViewport shows black screen - Android -

i'm having problems libgdx viewport system on android. want set fitviewport on camera, , black screen. tried camera, without viewport , working. can't manage right on viewport. here's code: variables declaration: private texture texture; private sprite sprite; private orthographiccamera camera; private float virtualwidth, virtualheight; private float aspectratio; private spritebatch batch; private viewport viewport; initialization virtualwidth = 200; virtualheight = 200; aspectratio = gdx.graphics.getheight() / gdx.graphics.getwidth(); texture = new texture(gdx.files.internal("mapa.jpg")); sprite = new sprite(texture); camera = new orthographiccamera(); viewport = new stretchviewport(virtualwidth * aspectratio, virtualheight, camera); viewport.apply(); camera.position.set(virtualwidth / 2, virtualheight / 2, 0); batch = new spritebatch(); my render method: gdx.gl.glclearcolor(1, 0, 0, 1); gdx.gl.glclear(gl20.gl_color_buffer_bit); camera.update();

How to serialize a custom formatted time to/from xml in Go? -

when serializing datetime to/from xml how make use custom time format? just you'd implement json.marshaler , json.unmarshaler doing json (there many posts on stackoverflow , internet); 1 way implement custom time type implements encoding.textmarshaler , encoding.textunmarshaler . those interfaces used encoding/xml when encoding items (after first checking more specific xml.marshaler or xml.unmarshaler interfaces, later ones have full xml encoding themselves). e.g. something ( full example on go playground ): const fixedformat = "mon jan 02 2006" type mytime1 struct { time.time } func (m mytime1) marshaltext() ([]byte, error) { text := m.time.format(fixedformat) return []byte(text), nil } func (m *mytime1) unmarshaltext(text []byte) error { t, err := time.parse(fixedformat, string(text)) if err == nil { m.time = t } return err } or type mytime2 time.time func (m mytime2) marshaltext() ([]byte, error) {

javascript - jQuery - get value from a select when there are several -

i dynamically inserting many selects on page depending on user inputs. select lists identical , share similar names. when user chooses option, want grab value. (in end i'm trying accomplish disable chosen value other lists, re-enable if value changed. 1 step @ time) i assuming need use $(this) apparently not know how values second, third lists, , on. the html this: <select name="category[first]"> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> </select> <select name="category[second]"> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> </select> ** many more lists same naming convention as jquery, trying this: $('body').on('change', $('select[name^="category"]&#

c++ - Initialization of std::array with std::initializer_list in constructor's initialization list -

this question has answer here: how initialize member array initializer_list? 5 answers consider following piece of code: struct foo { std::vector<int> v; foo(std::initializer_list<int> l) : v{l} {} }; the code above compiles fine , initializes v expected. consider following piece of code: struct bar { std::array<int, 3> a; bar(std::initializer_list<int> l) : a{l} {} }; the above piece of code gives compile error. error: no viable conversion 'std::initializer_list' 'int' searching web found "proper" way initialize member std::array std::list_initializer use reinterpret_cast in following manner: bar(std::initializer_list<int> l) : a(reinterpret_cast<std::array<int, 3> const&>(*(l.begin()))) {} q: why can initialize member std::vector std::initializer_list in init

sql - PostgreSQL: Aggregate by more than one column -

i have following data format: id eventtime use 2015-01-01 00:00:00-01 5.2 . . 2015-06-06 23:59:50-01 5.7 b . . i'm trying output of form: id eventtime use 2015-01-01 1200 . 2015-06-06 1400 . b 2015-01-01 1500 basically sum of item use every user each day in database. i tried select id, eventtime, sum(use) table group id,eventtime i got aggregate in case can't make sense of i.e doesn't add should. appreciated, in advance! you need convert eventtime date removing time component. think simplest way using date_trunc() : select id, date_trunc('day', eventtime) eventday, sum(use) table group id, eventday order id, eventday; i'm not sure why sample query has id in select , user in group by .

python - Why can't I write() multiple times on an open file? -

i trying delete words open file loop. each loop open file , remove line file , rewrite content file. finally, want generate contents original file. the problem after loop, file not overwrote. remove 1 of words dictionary. seems when open file each iteration of loop, content of file not being updated each loop. please advise how handle file open/close in condition. my code: # want delete line contains pair dictionary. # example, if line contains "can_option" , "17", delete line. dictionary = {"can_optin" : "17", "appprevaddrstreet": "33"} fname = "test.txt" infile = open(fname, 'r') data = infile.readlines() infile.close() def readline(keyword, data, infile): line in data: linenumber = line.rsplit(none, 1)[-1] # line contains "can_option" or "apppreaddrstreet", # not write line file. if keyword[0] in line , linenumber == keyword[1]:

javascript - Naming modules with RequireJS -

i trying figure out how name modules without using relative path of module itself. for example: instead of doing this: //module defined in app/js/routers.js define('app/js/routers',['app/js/currentview'],function(currentview) { }); i rather this: //module defined in app/js/routers.js define('routers',['app/js/currentview'],function(currentview) { }); is possible or bad idea? obviously, names give each module have unique. guess don't see point of optional first parameter in define call if has same path of script it's contained in. i guess don't see point of optional first parameter in define call if has same path of script it's contained in. yep, if going put module in file path, relative baseurl give in requirejs configuration, name of module, not have provide module name define . in fact, should not give module name in case. requirejs documentation states: these [i.e. module names] generated opti

javascript - JS - iterate through an object and change its attribute values? -

suppose below wanted change 'valid' 'a','b' , 'c' equal true. object foo. var foo = { a: { valid: false, required: true }, b: { valid: false, required: true }, c: { valid: false, required: true } }; (var key in foo) { var obj = foo[key]; (var prop in obj) { if (obj.hasownproperty(prop)) { //how can assign valid true here? }; } you're making more complicated needs be. just this: for( var key in foo ) { foo[key].valid = true; } or, if you're concerned code in page may have extended object.prototype enumerable property, can instead: for( var key in foo ) { if( foo.hasownproperty(key) ) { foo[key].valid = true; } } but nobody should ever extend object.prototype enumerable property. breaks kinds of code. it's unlikely issue you'd need worry about.

angularjs - Unit test case is failing to load webpack based js file having require to load css -

i using webpack bunlde angular js code. not able write mocha based unit test cases bcz gulp-mocha failing "require" css. following code snippet details. benefits.js angular js directive: var utilities = require("./../../../../../utilities/utilities"); var apputilities = require("./../../../../../utilities/apputilities"); require("./../../../../css/benefits.css"); module.exports = { getbenefits: function ($sce) { return { restrict: "e", template: require('html!./../../../../templates/page/benefits.html'), replace: true, scope: { benefits: '=', productpagebenefits: '=', divider: '=' }, link: function (scope, element, attrs) { //get benefit details per given list of key scope.getbenefitslist = function (benefitkeylist, benefits) {

javascript - AngularJS pass directive to direcive -

i have common pattern occurs, simplified along lines of (pretend caps things directives) somestuff buttons header <div ng-repeat="blah in data"> content </div> footer this same , repeated throughout app, , repeated in subsequent apps. however, (particularly in future) have few pages buttons different else same. or maybe content different. obviously, make each of these sections directive , on each page put above, if decide there needs morestuff after footer on every page have go through every page , add this. therefore, feel ideal setup 1 big directive, contains each of above smaller directives, , able plug in other directives, along lines of: <bigdirective header="specialheader"> and generate big directive specialheader in place of header. equally <bigdirective header="specialheader" footer="specialfooter"> is idea, or possible? exist or have generate , compile sub-directives on fly?

excel - Python Standard Deviation Check -

i have written python code calculate standard deviation of list of numbers. checked answer on excel , appears off. i'm not sure if missed step or if should concerned, if has moment review code , see if notice error, please let me know. thank you. city_population = [2123,1284,7031,30788,147,2217,10000] mean = sum(city_population,0.0)/len(city_population) def stdev(city_population): length = len(city_population) total_sum = 0 in range(length): total_sum += pow((city_population[i]-mean),2) result = (total_sum/(length-1)) return sqrt(result) stan_dev = stdev(city_population) print "the standard deviation is",(stan_dev) output: the standard deviation 9443.71609738 excel: 9986.83890663 your problem due code within loop calculating total sum. in loop, you're calculating result @ each iteration, , returning function. means 1 iteration of loop runs. when running code, result 2258.72114877, calculated first value only.

vb.net - Calling sub in different class not working right -

i creating browser in vb.net using cefsharp. created custom lifespanhandler handle popup windows, when try call public sub in different class, not giving expected output. created lifespanhandler using following code: public class lifespanhandler implements ilifespanhandler public event popuprequest action(of string) public function onbeforepopup(browser iwebbrowser, sourceurl string, targeturl string, byref x integer, byref y integer, byref width integer, byref height integer) boolean implements ilifespanhandler.onbeforepopup raiseevent popuprequest(targeturl) my.settings.newpage = targeturl call form1.intnewtab() return true end function public sub onbeforeclose(browser iwebbrowser) implements ilifespanhandler.onbeforeclose end sub end class and have browser.lifespanhandler = new lifespanhandler initialized. (with browser being cefsharp.winforms.chromiumwebbrowser ) i save targeturl in my.settings.newpage , when browser initialized, opens url. in differ

css - Margin appearing when page is wide -

i'm new web design , have encountered problem margins. things work when page small, when increase width margin appears between main , right column divs. (red , green) here in jsfiddle: https://jsfiddle.net/jcn2ds03/ here's css: #container { /* padding , margin */ padding: 0px; margin: 0px; border: 0px; overflow: hidden; max-width: 50000px; min-width: 500px; } #container .inner { /* padding , margin */ padding: 0px; margin: 0px; border: 0px; /* dimensions */ min-width:700px; } #right-column { /* padding , margin */ padding: 0px; margin: 0px; border-left: 5px solid #e3e3e3; float: right; width: 200px; height: 1000px; background: green; } #right-column h2 { text-align: center; } #right-column u1 { /* padding , margin */ padding: 0px; margin: 0px; border: 0px; } #right-column li { /* padding , margin */ padding: 0px; margin: 0px; border: 0px; text-align: center; list-style-type: none; } #main

java - Multi producer single consumer queue without dedicated consumer thread -

i'm writing async application submits elements work queue processing. requirements are: there no background thread listening on queue. thread submits element queue may responsible consuming queue. there can multiple concurrent producers, 1 thread can active consumer. if thread submits element thread b actively consuming queue, thread should return immediately. no waiting allowed. here example of i'm trying do: final queue<t> queue = new concurrentlinkedqueue<>(); final atomicboolean processing = new atomicboolean(); void offer(t t) { queue.offer(t); (;;) { if (processing.compareandset(false, true)) { try { (;;) { t t = queue.poll(); if (t == null) { break; } // process t } } { processing.set(false); } // see if thread submitted element d

oracle - Data filtering performance:sqlldr+triggers or sqlldr+stored procedure? -

i have load millions of records on db, said records need further processing according of columns values. in particular if row satisfies condition save row in table b, otherwise save in table c. according documentation sqlldr direct path fast, anyway loading rows not trigger triggers. so, came 2 solutions: solution 1: using sql loader direct path=true load data in table a. calling stored procedure perform actual filtering. not sure seem in case oracle performs multithreading behind scenes. solution 2: using sql loader direct path=false triggers activated after insert on table a.in case, performance sake, need explicitely perform multithreading splitting data file in multiple files , calling sql loader multiple times (by way have no idea on how on bash script...) which 1 leads better performances?and there performance difference between two? in situations data loading requires processing/cleansing before adding core data strong preference load first staging table

sql server - Shaping dataset in MySQL with a multiple inner join -

Image
i learning mysql , working dummy tables set example online. the code create tables wasn't given, end result of should like, did best re-create them. i know design isn't ideal - i'd rather use enum customer_info.state column, , type of datetime getdate() dates, example, haven't had success (more appropriate setups) yet i'm working on joins first, they're relevant job. i'll fine-tuning on design later (my job involve lot of querying , joining, not lot of db design, although i'd learn better habits/skills in arena). i practicing inner join, , have joined 3 tables, result set isn't shaped way i'd like. currently, 3 tables are: customer_info (customerid int not null, firstname varchar(20) not null, lastname varchar(20) not null, city varchar(25), state varchar(2)) purchases (customerid int not null, order_month_day varchar(10), order_year int not null, item varchar(50) not null, quantity int not null, price float not null) customer_fav

c# - Web Forms Windows Authentication w/ Remote SQL Database -

i have asp.net 4.0 web application uses windows authentication against ad , sql server role management. basically, want users have ad account able access application, want further secure app using roles in sql server. not want users have enter in passwords authentication. is viable me check authentication in global application_start method, or should executing code elsewhere? application_start fired once when application initialized. httpcontext.current.user contain details of user making http request caused iis initialize application. instead use application_beginrequest raised every incoming request, ideally should check authorization (not authentication) when web-application intends perform action, not preemptively on every request.

excel - VBA Range Syntax Issue -

i'm trying create range use in concatinate function, i'm having unknown errors. have attached entire code, error appears during 'myrange' section. goal of code divide steps of process 360 minute shifts, , list of parts , tools required (found in column h). appreciated! private sub commandbutton1_click() dim duration integer, n long, integer, x integer, m integer dim myrange range n = 3 m = 3 duration = 0 x = 0 = 1 50 duration = 0 while duration < 360 x = worksheets("sr060-sr070").cells(n, "f").value duration = duration + x n = n + 1 wend myrange = range(worksheets("sr060-sr070").cells(m, "h"), worksheets("sr060-sr070").cells(n, "h")) worksheets("shifts").cells(1, i).value = concatinateallcellvaluesinrange(myrange) m = n next end sub function concatinateallcellvaluesinrange(sourcerange excel.range) string dim finalvalue string

python - Strange behaviour Django shell and iPython -

i doing stuff in django console , realized global variables not recognized inside lambda expression, example if execute following code inside python or inside ipython console works perfectly: a = 10 foo = lambda x: x + foo(10) # returns 20 but if execute inside django shell ipython doesn't work: in [8]: foo = lambda x: x + in [9]: = 10 in [10]: foo(10) --------------------------------------------------------------------------- nameerror traceback (most recent call last) /usr/local/lib/python2.7/dist-packages/django/core/management/commands/shell.pyc in <module>() ----> 1 foo(10) /usr/local/lib/python2.7/dist-packages/django/core/management/commands/shell.pyc in <lambda>(x) ----> 1 foo = lambda x: x + nameerror: global name 'a' not defined the ipython version 0.13.2 thank in advance! edit event if assign a before lambda funciton problem stills: in [1]: = 10 in [2]: foo = lambda x: x +

PHP cURL vs. file_get_contents when using proxy -

running in windows. the following code works fine. don't have specify username , password when setting proxy. $acontext = array( 'http' => array( 'proxy' => 'tcp://ip:port', 'request_fulluri' => true, ), ); $cxcontext = stream_context_create($acontext); echo file_get_contents("someurl", false, $cxcontext); however when try code won't work unless specify username , password proxy. $ch = curl_init(); curl_setopt($ch, curlopt_returntransfer, true); curl_setopt($ch, curlopt_protocols, curlproto_http | curlproto_https); curl_setopt($ch, curlopt_proxy, 'http://ip:port'); curl_setopt($ch, curlopt_url, "someurl"); $responsebody = curl_exec($ch); i http 407 error (received http code 407 proxy after connect) unless specify http://domain\user:password@ip:port any ideas how make curl work without specifying user , password (like file_get_contents does)? you can us

ruby on rails - How to only use tag_cloud for current_user? -

in application_controller have this: def tag_cloud @tags = tag.top_20.sort{ |x,y| x.id <=> y.id } if current_user end which make tag count work tags users, instead want tag_cloud show tags of current_user . tried this: def tag_cloud @tags = current_user.tags.top_20.sort{ |x,y| x.id <=> y.id } if current_user end but gave me error: nomethoderror (undefined method `top_20' #<activerecord::associations::collectionproxy []>): app/controllers/application_controller.rb:13:in `tag_cloud' even though top_20 defined in tag.rb : class tag < activerecord::base has_many :taggings scope :top_20, -> { where("taggings_count != 0").order("taggings_count desc").limit(15) } end i'm using acts-as-taggable-on gem. thank you! updates user.rb class user < activerecord::base acts_as_tagger acts_as_taggable has_many :notifications has_many :activities has_many :activity_likes

asp.net - Values wrong SUM rows in report viewer -

in report there 3 lines, last line should add previous lines. i'm using = sum (fields!num1.value), num1 dataset field loads report. sum of these fields returning wrong values. experiencing situation this? regards you may need add second parameter of sum() method (the scope). for example, if dataset called "dataset1", have: =sum(fields!num1.value, "dataset1") additionally, depending on values being filled these columns in dataset, may need convert them data type engine can sum. if you're filling column string representation of integer, example "15" (note string), have convert value integer.

java - getting request variable in DAO -

i have scenario unable access variable present in action class in dao. struts framework ejb , old code jsp written in java class file. reverse side code display jsp comes java , ejb class files interface. particular variable in action class obtained request variable. want use variable in dao class. can think of 2 options. set in form , use form in dao , value. wouldnt work form reinitialised in method used. 2nd set them in session or request value null in dao. how else can done. want access variable action class in dao. please suggest. thanks! use overloaded method say have public void save(string firstname, string secondname){ jdbc.save(firstname, secondname); } but need new parameter! create same method , this public void save(string firstname, string secondname, string userid){ //this keep backward compatibility if(userid == null){ //whatever in older method, in case simple save jdbc.save(firstname, secondname); } else {

Equivalent of and in JavaScript? -

what's equivalent of , in js because can't seem find answer }else if (i % 3 & 5 === 0){ console.log('...') a googling "javascript , operator" returns first hit of http://www.w3schools.com/js/js_comparisons.asp explains answer: if (i % 3 && 5 === 0) this answer you're looking for, given how it's written, might not give outcome expect depending on execution.

html - How to target specific text content in a paragraph which contains multiple line breaks? -

so here weird thing clueless on.. below sample snippet of html, <p>this paragraph <br><br> 2 weird line breaks <br><br> , twice!</p> now issue is, want apply css text this paragraph or content after first-double line breaks. i tried br + br or nth-selectors, css selectors think of, didn't worked out. tricky part is, not want javascript, or else have done accompanied 'complexity'. any hints or solution problem css only!! thanks! you adding in html. dont think there css specific way this. <p><span id="snippet">this paragraph </span><br><br> 2 weird line breaks <br><br> , twice!</p> then apply css this #snippet{ //css styles go here }

javascript - What's the best way To edit CSS and JS of Html Template -

i have html5 template in local computer. want edit template css , js use in project. use solution edit template open web site google chrome open notepad++ edit css file notepad++ , refresh page in google chrome view change result. if there's other method of doing so, please let me know. try livereload , works great me chrome . use workspaces , edit in browser.

Django admin field choices render as multiple checkbox -

i'm trying customise django admin page. want single model field render choices passed checkboxselectmultiple, can't work. here relevant part of models.py : from django.db import models django.contrib.auth.models import user django.contrib import admin class event(models.model): group_owner_choices = ( ('vcoe', "vcoe"), ('cssi', 'cssi'), ('essc', "essc"), ('tmscc', "tmscc"), ('inmc', "inmc"), ('ccs7', "ccs7"), ('ias', "ias"), ) group_owner = models.booleanfield(choices=group_owner_choices, blank=true, default=false) i can't use django formfield_overrides ( https://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.modeladmin.form ) because have more 1 booleanfield , keep other booleanfield's intact. here found other qu

python - Popup window not displaying Django messages -

i have django website displays different gantt charts based on user selections. have bunch of django's logging messages in code , want able set , display in popup window once user hits submit button, can't seem messages display in popup. my views.py looks this: from django.contrib import messages def gantt_search(request): if request.method == 'post': messages.info(request,"query submitted, beginning query results render for:") form_start = window_start_form(request.post,section_label="window_start") if form_start.is_valid(): ws_raw = form_start.cleaned_data['window_start'] messages.info(request,"window start time: {ws}".format(ws=ws_raw)) else: messages.error(request,"the start date entered incorrectly formatted.") else: messages.info(request,"rendering query page") form_start = window_start_form(section_label="window_start") return

Hive HBase integration failure -

i using hadoop 2.7.0, hive 1.2.0 , hbase 1.0.1.1 i have created simple table in hbase hbase(main):021:0> create 'hbasetohive', 'colfamily' 0 row(s) in 0.2680 seconds => hbase::table - hbasetohive hbase(main):022:0> put 'hbasetohive', '1s', 'colfamily:val','1strowval' 0 row(s) in 0.0280 seconds hbase(main):023:0> scan 'hbasetohive' row column+cell 1s column=colfamily:val, timestamp=1434644858733, value=1strowval 1 row(s) in 0.0170 seconds now have tried access hbase table through hive external table. while select external table getting below error. hive (default)> create external table hbase_hivetable_k(key string, value string) > stored 'org.apache.hadoop

html - CSS Position Image bigger than it's container -

so i've seen how center image if it's wider container? have this .section-background { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 0; overflow: hidden; } .section-background-image { position: relative; right:-30%; top: 0; left: 0; width: 100%; height: 100%; } .section-background-image img { position: relative; right:-30%; min-width: 100%; max-width: none; min-height: 100%; top: 0; left: 0; } <div class="section-background"> <div class="section-background-image " data-stellar-ratio="0.4"> <img src="my_huge_image.png" alt="" style="opacity: 0.3;"> </div> </div> and want right portion of image appear if not fit container, (by default top left hand corner portion). with code, doesn't work on first browser request (shows top left corner port

html - IE Vertical Text Issue -

i have feedback tab thats fixed right side of browser , rotated 90 degrees. tab looks fine in firefox , chrome in ie box rotates not text. simple button , have simple solution i'm missing. #feedback{ color:#fff; position:fixed; bottom:200px; right:-56px; width:140px; height:35px; line-height:40px; background:#727948; text-align:center; font-size:18px; border-bottom-left-radius:5px; border-bottom-right-radius:5px; -webkit-box-shadow: 0 8px 6px -6px black; -moz-box-shadow: 0 8px 6px -6px black; box-shadow: 0 8px 6px -6px black; opacity:0.8; -webkit-transform: rotate(90deg);/* safari , chrome */ -moz-transform: rotate(90deg); /* firefox */ -ms-transform: rotate(90deg); /* ie9 */ -o-transform: rotate(90deg); /* opera */ filter: progid:dximagetransform.microsoft.basicimage(rotation=2); /* ie8 */ writing-mode:tb-rl; /* ie8 */ } #feedback:hover{ opacity:1; } https://jsfiddle.net/nhf5m4y1/ writing-mode:tb-rl d