Posts

Showing posts from June, 2013

chef - Library doesn't process "DSL" for 'execute' -

can me please? nomethoderror ------------- undefined method `execute' chat::mattermost:class relevant file content: (file name libraries/chat.rb ) 4: 5: module chat 6: class mattermost 7: 8: def self.log_to_chat(message) 9>> execute "echo" 10: command "echo #{message}" 11: end 12: end 13: 14: end 15: end 16: i read dsl syntax isn't available in definition, guessing need resembling r = chef::resource::execute.new("echo #{message}") , r.run_command :run i'm not quite sure how it. other relevant code, method "called" this: log "this message" level :info notifies :run, chat::mattermost.log_to_chat("#{name}"), :immediately end edit: second attempt nomethoderror ------------- undefined method `events' nil:nilclass for code: 5: require 'chef/resource/execute' 6: 7: module chat 8: class mattermost 9: 10: def self.log_to_chat(m...

r - ggplot2: Independent Continuous Fill for Summary Row & Column -

Image
i using strategy plot summary (totals) rows in heatmap using geom_tile , involves creating rows in data_frame row , column totals: library(dplyr) library(ggplot2) entitites = letters[1:10] # create sample data df_foo = bind_cols( data_frame(group1 = rep(c("a", "b"), each = 100)), bind_rows( expand.grid( left = entitites, right = entitites, stringsasfactors = false ), expand.grid( left = entitites, right = entitites, stringsasfactors = false ) ), data_frame(value = rpois(200, 15)) ) # create summary row & column df_foo_aug = bind_rows( df_foo, df_foo %>% group_by(left, group1) %>% summarize( value = sum(value), right = "total" ), df_foo %>% group_by(right, group1) %>% summarize( value = sum(value), left = "total" ) ) # create plot df_foo_aug %>% ggplot(aes(x = right, y = left, fill = value)) + geom_tile()...

c# - How can i split excel sheet values and store it in new excel sheet? -

i have excel sheet having values in 1 column splitted delimiter (|). coumn1|column2|column3|column4 (this column names in 1st row of excelsheet) value1|value2|value33|value4 val1||val3|val4 i want split values separate , create new excelsheet store splitted value. in new excel sheet want values like. column1 column2 column3 column4 value1 value2 value3 value4 val val3 val4 how can values this.anyone give me solution this. i data excel , store values in data table. using following code. public void loadexceldata() { using (spsite site = this.webapplication.sites[0]) { using (spweb currweb = site.openweb()) { string fullpath = ""; spquery query = new spquery(); splist currlist = currweb.lists.trygetlist("jdfieldmapping"); splistitemcollection itemcoll = currlist.getitems(query); query.viewfields ...

Oracle SQL Update using group by/case -

i have record table1 structure key1 key2 key3 emplid enrcd addl_seq ... (key1 key2 key3 emplid enrcd addl_seq) being keys i have rows emplid & erncd same different values of key1/2/3 increment addl_seq value 1 when multiple rows exist same emplid & erncd example - key1 key2 key3 emplid erncd addl_seq 001 a1 b1 12345 reg 1 001 a1 b2 12345 reg 2 updated sql update ps_xx_py40_apay_1 a1 set a1.addl_seq = ( select rank() over(partition xx_employee_id,erncd order xx_conversion_id,xx_ucpath_loc,xx_wrkr_instance,xx_appt_num,xx_dist_num,empl_rcd,emplid,effdt) ps_xx_py40_apay_1 b1 b1.xx_employee_id=a1.xx_employee_id , b1.erncd=a1.erncd , xx_conversion_id=xx_conversion_id , xx_ucpath_loc=xx_ucpath_loc , a1.xx_wrkr_instance=b1.xx_wrkr_instance , b1.xx_appt_num=a1.xx_appt_num , b1.xx_dist_num=a1.xx_dist_num , a1.emplid=b1.emplid , a1.empl_rcd=b1.empl_rcd , a1.effdt=b1.effdt ); ...

In Kafka, can I create a single kafka topic and have multiple producers write to it -

i have following use case : log files comes single data source pushed kafka topic (say topic 1). there consumer read , converts json format , writes topic (topic 2). consumer expecting data in json read topic 2 other modification , writes topic (topic 3). my question instead of creating 3 different topics, can create single topic , have these multiple producers write same topic? how consumer know partition read since group id cannot set producer? 1 solution learnt create partitions , make each producer write particular partition alone. problem approach number of producers , consumers might change , modifying topic not desired. please advice. as 1 commented should not push different type of schema's single topic. number of topics in kafka not issue. can use nomenclature manage them. "topic1", "topic1_json", "topic1_modification". if use case have unmanageable list of topics, same consumer can read json topics & don't want batc...

asp.net mvc - How can I use the Vue.js code from a webpack bundle in a Razor page? -

here razor page code: @using system.web.optimization; @{ bundletable.bundles.add( new scriptbundle("~/scripts/vuejs") .include("~/static/scripts/vuejs/vue.min.js")); } @section scripts { @scripts.render("~/static/vue/assets/bundle.js") @scripts.render("~/scripts/vuejs") } <div id="app_container"> {{text}} </div> and here entry of webpack javascript: import vue 'vue'; const v = new vue({ el: '#app_container', data: { text: 'abcdefg' } }); webpack config: export default { entry: [ 'babel-polyfill', './src/index.js' ], output: { filename: 'bundle.js', path: 'c:/websandbox/static/vue/assets', publicpath: '/vue/assets/' }, devtool: 'source-map', module: { loaders: [ { test: /\.vue$/, loader: 'vue' }, ...

r - How to get latest news posted on twitter by a website -

i using r , need retrieve few recent posts twitter user (@expressnewspk) using twitter api. have created account , have access token, etc. have used following command extract tweets: setup_twitter_oauth(consumerkey,consumersecret,accesstoken,accesssecret) express_news_tweets <- searchtwitter("@expressnewspk", n = 10, lang = "en" ) however, posts returned aren't recent ones user. have made mistake? i think searchtwitter search search string provided (here @expressnewspk). instead of giving tweets @expressnewspk give tweets directed @expressnewspk. to tweets @expressnewspk, have function named usertimeline give tweets particular user. so after done setup_twitter_oauth , can try usertimeline("expressnewspk") read more @ ?usertimeline

laravel 5.2 pagination pretty url -

i using laravel 5.2 is there way pagination pretty url in laravel 5.2? http://localhost:8000/backend/admin_user?page=10&page=1 and get,how generate link pretty url: http://localhost:8000/backend/admin_user/10/1 so can try that: route::get('test/{page}', function ($page) { return user::paginate(2, ['*'], 'page', $page); });

php - Session Values are not coming -

i have homepage.php , messages.php page both common "menu.php" there have started session in homepage.php messages.php , have not started session in menu page. trying these values here menu code: html code: <a href="#" class="dropdown-toggle dropdown-at" data-toggle="dropdown"> <span class=" name-caret"> <?= $_session['name'] ?><i class="caret"></i> </span> <img src="../images/user/<?= $_session['image'] ?>" style="width:100px; height: 61px;"> </a> home page.php <?php ob_start(); session_start(); if (!isset($_session['id'])) { header('location:index.php'); } include_once('includes/config.php'); include_once('includes/header.php'); include_once('includes/menu.php'); ?> so can show login user data of name , image on menu both homepage , messages page. ...

Set value of input element using javascript and get the value using php -

here have form , input element: cart.php <form id="cartform" action="cart.php?action=update&pd=<?php echo $row['product_id'] ?>" name="form1" method="post"> <?php $query = "select * cart customer_id='$user' "; $result = mysqli_query($con,$query);$payableamount = 0;$totalsavings = 0; while($row = mysqli_fetch_array($result)) { $productid = $row['product_id']; $query2 = "select * product product_id='$productid'"; $result2 = mysqli_query($con,$query2); while($row2=mysqli_fetch_array($result2)) { ?> <input tpe="text" name="quantxt[]" id="quantxt" value="<?php echo $qty = $row['quantity']; ?>" onkeyup="showsubmit(<?php echo $row['cart_id'] ?>,<?php echo $row['product_id'] ?>)"> <input type=...

websocket - Socket IO request Query String param meaning -

Image
what function of each query string (eio, transport, t) passed during each socket io connection request? , how generate t value?

android - ExpandablieListView Flat list position function gives wrong position when previous group collapsed -

i want flat list position child, flat list position code: int index = expandablelistview.getflatlistposition(expandablelistview.getpackedpositionforchild(groupposition, childposition)) its works fine, if , if groups expanded. problems ahead when 1 or 2 groups collapsed. position of same child of same group changed when 1 or 2 previous groups collapsed. for example if position of second group child 3 when first 1 group collapsed. after expanding first group, position of second group child(same child previous selected) gets changed. for practically can see code , please run code proper understanding. @override public boolean onchildclick(expandablelistview expandablelistview, view view, int i, int i1, long l) { int index = expandablelistview.getflatlistposition(expandablelistview.getpackedpositionforchild(i, i1)); toast.maketext(getapplicationcontext(), string.valueof(index), toast.length_short).show(); expandablelistview.setitemchecked(index...

javascript - Necessary to pass limit to data when subscription already limits the dataset? -

in example pagination, different number passed route in terms of how many results should displayed. // lib/router.js router.route('/:postslimit?', { name: 'postslist', waiton: function() { var limit = parseint(this.params.postslimit) || 5; return meteor.subscribe('posts', {sort: {submitted: -1}, limit: limit}); }, data: function() { var limit = parseint(this.params.postslimit) || 5; return { posts: posts.find({}, {sort: {submitted: -1}, limit: limit}) }; } }); i wondering if it's necessary still give posts.find() arguments in data attribute. seems kinda redundant here because subscribe in waiton limit dataset getting server. know data used provide data context different parts of templates. however, providing same arguments here data posts.find() seems redundant. have tried using posts.find() without argument , worked. also, wondering way access data in router? accessing posts collections outside individual ro...

html - Input attribute pattern does'nt work on IOS devices -

the attribute pattern not working without required , required attribute not yet compatible ios devices. i'm having trouble minlength because it's not working on code maxlength works fine. can't use oninvalid because i'm using dynamic form , jquery validate. any thoughts or recommendations? <form method="post"> <input type="text" required pattern=".{3,}"> <input type="submit"> </form> jsfiddle

Bootstrap: Semi-transparent navbar overlay on carousel breaks page css -

Image
i trying implement transparent bootstrap navbar overlay onto bootstrap carousel , having bit of issue, can navbar in position want in code provided below, issue breaks page css , content should below slider appears on navbar. css: .navbar-wrapper { position:relative; } .carousel { position:absolute; top:60px; } .carousel-inner { width: 100%; overflow: hidden; } .navbar { position:absolute; top:0; z-index:10; background: rgb(0, 0, 0); opacity: 0.85; width:100%; } as can see navbar html have added navbar class of "navbar" wanted use less code until navigation positioned wanted be, add other lines when page breaking issue fixed. leaving code in or out not change page breaking issue guessing actual css carousel causing issue. html: <div class="navbar-wrapper"> <div class="navbar"> </div> </div><!-- /navbar-wrapper --> <!-- simple bootstrap car...

c - Free() : invalid next size (fast) error -

so keep running error: free(): invalid next size(fast) when run code. if remove free @ end of function know leaking memory don't understand why getting error. i assume has me allocating memory incorrectly can't seem find fix, here code: bool parse(const char* line) //not working quite { char* copy = malloc(sizeof(line)); //allocate space copy of line parameter strcpy(copy, line); //copy line parameter char* method = strtok(copy, " "); //pointer method char* reqline = strtok(null, " "); //pointer requestline char* version = strtok(null, "\r\n"); //pointer http-version if (strcmp(method,"get") != 0) //if method not { printf("%s\n", method); printf("error 405\n"); return false; } if (strncmp(reqline, "/", 1) != 0)//if request line not begin / character { printf("%c\n", reqline[0]); printf("%s\n", reql...

PHP CLI running out of memory -

i'm trying reserialize 1gb sql dump using fix-serialization.php file https://github.com/blogestudio/fix-serialization/blob/master/fix-serialization.php with command: php -d memory_limit=-1 fix-serialization.php dump.sql but following error php fatal error: out of memory (allocated 2328100864) (tried allocate 18446744071742389167 bytes) i same error when try: php -d memory_limit=2000m fix-serialization.php dump.sql obviously computer not have 18446744071 gb of ram. i'm getting error on both mbp , ubuntu machine , i've tried running script on php5.6 , 7 looks shoud make own solution. script won't fit since reads whole file @ once , passes whole file preg_replace . regex quite complex, needs lot of memory processing such big strings. should read 1 data line , proccess line , write output file. open input file reading, , output file writing, data won't corrupted.

javascript - How do I link cells interactively with jquery? -

Image
how able link cells create new cell call add global value in snippet. in snippet there 3 chosen rows can chosen @ random user , number of them. what want able link chosen rows add new cel has overall value captured user. how link cells depending on ones user chooses. jquery in interactive way not reload page. i want know how go solve problem. the code snippet shows visual example after rows chosen user should create new cel next it. they have linked 3 have global value of new cell... $(document).ready(function() { $('tbody tr').eq(0).find('td').eq(7).css('background-color', 'green'); $('tbody tr').eq(3).find('td').eq(7).css('background-color', 'green'); $('tbody tr').eq(4).find('td').eq(7).css('background-color', 'green'); }); table, td { border: 1px solid #000; } td { width: 40px; height: 40px; } <script src="https://ajax.googleapis.c...

javascript - changing a textbox value when selected index from a combobox -

i have combobox has data fetched database. when index selected combobox, textbox value gets value database depending on index selected combobox. have following codes. <form action = '' method = "post"> <b> school id: </b><br /> <select name = "school_id" required id = "schoold_id" onchange="get_data(this.value)"> <option value = "" selected></option> <?php $sql = "select distinct school_id school"; $result = $db->query($sql); if ($result->num_rows > 0){ while($row = $result->fetch_assoc()){ echo "<option value = ".$row["school_id"].">".$row["school_id"]."</option>"; } } ?> </select><br /><br /> <b> batch number: </b><br /> <input type= "text" name = "batch_no" /required><br /...

html - Image map change image on hover -

i have problem , love help! website have interactive header. made image map character on header when clicked redirects page. i switch image when hovers on image map. reading discovered change class b when hovering class sibling markers ~ or + tried these respectively didn't work. here html concerning header image , image map. <div class="td-main-content-wrap td-main-page-wrap"> <div class="td-container"> <div class="vc_row wpb_row td-pb-row"><div class="wpb_column vc_column_container td-pb-span12"><div class="wpb_wrapper"> <div class="wpb_raw_code wpb_content_element wpb_raw_html"> <div class="wpb_wrapper"> <a href="http://breakline.nl/about/meet-giovanni-boerstra/" class="giomap" title="meet gio!" style="position: absolute; left: 70.63%; top: 20.32%; width: 13.85%; height: 39.57%;...

javascript - ReactJS: Why doesn't CSS Flexbox's alignItems work? -

in reactjs, using material-ui's <textfield/> http://www.material-ui.com/#/components/text-field , trying make of float left spaced out in between two, alignitems isn't working. floats left , not spaced out in between. what may issue? render() { return ( <div style={{display: 'flex', flexflow: 'row wrap', alignitems: 'stretch'}}> <div> <textfield/> </div> <div> <textfield/> </div> </div> ) } you don't use correct property. in row context, should use justify-content place elements on x-axis. render() { return ( <div style={{display: 'flex', flexflow: 'row wrap', justifycontent: 'space-between'}}> <div> <textfield/> </div> <div> <textfield/> </div> </div> ) }

android - Getting only last item of List View -

i've parsing xml inside listfragment , it's working fine onlistitemclick throwing last item, i've searched did not found matches case. this inside onpostexecute : xmldomparser parser = new xmldomparser(); inputstream stream = new bytearrayinputstream(xml.getbytes()); document doc = parser.getdocument(stream); nodelist nodelist = doc.getelementsbytagname(key_item); newss = new arraylist<news>(); news = null; (int = 0; < nodelist.getlength(); i++) { news = new news(); element e = (element) nodelist.item(i); news.setid(parser.getvalue(e, key_id)); news.setdate(parser.getvalue(e, key_date)); news.settitle(parser.getvalue(e, key_title)); news.setdescription(parser.getvalue(e, key_desc)); newss.add(news); } listviewadapter = new newsadapter(getactivity(), newss); getlistview().setadapter(listviewad...

Python is not recognizing text file that is in the same directory? -

my current project tree: redditbot/ -- commands/ ----__init__.py ----comment_cache.txt ----readcomments.py --mainbot.py what attempting read comment_cache.txt file via open('comment_cache.txt') in readcomments.py file., reason getting filenotfounderror. when try print(os.path.isfile('comment_cache.txt')) , returns false. am making beginner mistake here? maybe keep missing? edit: appreciate answers/comments, believe problem python interpreter itself. kept moving around file between redditbot/ directory , commands/ package until started working. reason whenever call print() , pycharm tells me undefined... i assuming mainbot.py entry point run application, problem i based on project tree, file should available @ path open('commands/comment_cache.txt') problem ii i kept moving around file between redditbot/ directory , commands/ package until started working. you ended placing file in same folder mainbot.py problem...

asp.net mvc - Cannot assign attibutes to form using Html.BeginForm -

i have form begun html.beginform() helper method: @using (html.beginform( null,null, new { @id = "maintenanceform", @class = "datatable", @nonvalidate="nonvalidate" } )) and form rendered as: <form action="(controller's name)/(current action's name)/maintenanceform?class=datatable" method="post"> the attributes such id, class, , nonvalidate aren't assigned. not want default http method. can do? your current code matching below overload of beginform method public static mvcform beginform( htmlhelper htmlhelper, string actionname, string controllername, object routevalues ) the third parameter here object route values. these added querystring key value(s) form's action attribute value. reason seeing big url action attribute value. if want specify html attributes( id,class etc), use overload has fourth parameter takes html attributes. third parameter formmetho...

ruby on rails - How should I check if an expiry date has expired? -

for example, want current_user.subscribed changed false if current_user.expiry_date of date before date.today . i don't know implement this. controller or action should link (if should @ all?). there way have automatically happen? try this: subscribed = date.today < current_user.expiry_date it return false if user date expiry.

grails - How to get index being tested on where block using spock? -

is there way index being tested on spock? have block this: where: column1 | column2 1 | 3 1 | 4 2 | 5 6 | 8 i want know if it's possible index being executed on test. if i'm running first test (1 | 3) index 0. if i'm running third test (2 | 5) index 2. is there way index inside test? you need add, @unroll test definition , in test name put #column1 output value @unroll def "something #column1 , #column2"() { ... }

python - Could not convert string to float: ...Sometimes -

i'm having strange things happen when converting strings floats in loop. so when use following code writes: [1468436874000, 0.00254071495719], [1468528803000, 0.00341349353996], [1468688596000, 0.000853373384991], [1468871365000, 0.00256012015497], it stops short, there should 30 lines more , wrong calculations. the function is: def main(): minprice = pricelist('min') maxprice = pricelist('max') avgprice = pricelist('avg') avgsqft = sqftlist() datelist = getdates() index = fileparser() open('/home/andrew/desktop/index3.htm', 'w') file: file.writelines(data[:index[0]]) date, minprice, maxprice in zip(datelist, minprice, maxprice): file.writelines('[%s, %s, %s],\n' % (date, minprice, maxprice)) file.writelines(data[index[1]:index[2]]) date, avgprice in zip(datelist, avgprice): file.writelines('[%s, %s],\n' % (date, avgprice)) file.writelines(data[index[3]:index[4]]) d...

c# - id not attaching to custom control -

hey having problem attaching id custom control. i'll state i've tried first , if there's out there can shed light on why element isn't appearing on dom id attached awesome. i've added inheritance public class barbutton : control i've attached button.(100% right button) <cc2:barbutton id="btndeleterow" buttontype="deleterow"></cc2:barbutton> attached in designer protected global::scncontrols.barbutton btndeleterow; anyways after have function delete button based on it's id using jquery. problem occurs when load page button has no id. var btndeleterow = <%= btndeleterow.clientid%>; ^^^^this returns null value. anyways little light if @ possible appreciated. i've checked elements on page see being rendered , it's normal barbutton no id attached. again.

matlab - Nelson - Siegel Model -

i working on yield curve (nelson - siegel model) in matlab. problem accurency of evaluation parameters isn't enough. my code:- x=[1/12, 3/12, 6/12 ] ; % xdata y =[3.66, 4.26, 4.39 ] ; % ydata x=[0, 0, 0, 0]; % vector coefficients x0 = [1 ,1, 1, 1 ]; %initial values beta1 , beta2, beta3, lambda modelfun = @(x,x) ( x(1) + (x(1) + x(2)) * x(4) * (( 1 - exp(-x/x(4)))/x) - x(3) * exp(-x/x(4)) ) ; [x,resnorm,~,exitflag,output] = lsqcurvefit(modelfun,x0,x,y) i need more accurate evaluation coefficients. have read somewhere should fix lambda parameter first fminsearch function , estimate betas parameters , don't know how implement in matlab. ask how should fix initial values?

uibutton - How to have custom UIControlState in Swift 2.2 using bit masks? -

i have custom uibutton unique states want have like: enum positioncontrolstate : int { case available = 0, pending, waiting, approved, declined } i've done bit of googling , found stuff bitmasks, , uicontrolstate.application in objective-c. feel have pieces of puzzle, not quite sure how put in swift 2.2.

angular - Do I need constructor body in Angular2? -

i couldn't find difference between: constructor (private router: router) { } and router: router; constructor (private _router: router) { this.router = _router } variable router available in whole class , contains same data. what's difference between first , second syntax? basically this: constructor (private router: router) { } is short form of this: private router: router; constructor (_router: router) { this.router = _router } personally use first format in projects because makes files shorter, , easier read. if question block inside of constructor, answer - no. if using short form showed before, there no need put in constructor. needed init stuff can put in ngoninit function. short example: @component({ selector: 'my-cmp', template: `<p>my-component</p>` }) class mycomponent implements oninit { constructor( private router: router, private myservice: myservice ) { } ngoninit() { ...

sql server - T-SQL - Aliasing using "=" versus "as" -

is there particular reason (performance or otherwise) use ahead of = when aliasing column? my personal preference (for readability) use this: select alias1 = somecolumn alias2 = anothercolumn tables etc... instead of this: select somecolumn alias1 anothercolumn alias2 tables etc... am missing out on reason why shouldn't doing this? other people's preferences when comes formatting columns? ‘=’ isn't valid ansi sql, you'll have difficulty should wish run application on different dbms. (it's when ansi form used optional ‘as’ omitted find results difficult read, personally.)

python - Object permissions with read only access for anonymous users in Django Rest Framework -

the problem i using django rest framework - , far have been using djangoobjectpermissions permissions class. use django-rules determine users have permissions objects. however, permissions class seems deny read access anonymous users. i need find best way allow read-only access users (authenticated or not). additions, modifications , deletions - object permissions should applied normal. what best approach solving problem? django not seem provide can_view permission default. perhaps involve manually adding can_view permission each model. or maybe it's better somehow implement djangoobjectpermissionsoranonreadonly permissions class? the fix simple. it's possible create custom permissions class extending djangoobjectpermissions , , override authenticated_users_only variable. class djangoobjectpermissionsoranonreadonly(djangoobjectpermissions): authenticated_users_only = false

ios - Programmatically add tab to tab bar -

Image
i have app uitabbarcontroller initial view controller. currently i'm doing in storyboard want programmatically add tab tab bar based on user being logged in or not. i made testviewcontroller test out. right have 2 tabs (pictured below). want have third tab positioned on right programmatically. put code in appdelegate's didfinishlaunching method. based on print statements view controller being added tab bar not appearing in tab bar app loads. any suggestions? func addtabtest() { let storyboard = uistoryboard(name: "main", bundle: nil) let tabcontroller = storyboard.instantiateviewcontrollerwithidentifier("roottabcontroller") as! uitabbarcontroller let testvc = storyboard.instantiateviewcontrollerwithidentifier("testviewcontroller") as! testviewcontroller let icon = uitabbaritem(title: "test", image: nil, selectedimage: nil) testvc.tabbaritem = icon print("tab controllers 1: \(tabcontroller.v...

javascript - Getting submit type to post its value -

i trying value of button sent along form post, have: <form id="form1" name="form1" method="post" action="getdata"> <h1>quick query</h1> <div class="floating-placeholder"> <input id="origin" name="origin" type="text" placeholder="number" value="5"/> <label for="origin"></label> </div> <div class="floating-placeholder"> <input id="destination" name="destination" type="text" placeholder="number" value="4"/> <label for="destination"></label> </div> <label> <input type="submit" name="submitdriving" id="submitdriving" value="driving"/> <input type="subm...

google maps - Open the gmapInfoWindow of a specific marker from the Managed Bean -

i have problem primefaces version 5.2. used gmap , gmapinfowindow. need managed bean open gmapinfowindow of specific marker. here code infowindow.xhtml <h:form> <p:gmap id="gmap" center="36.890257,30.707417" zoom="13" type="hybrid" model="#{infowindowview.advancedmodel}" style="width:100%;height:400px"> <p:ajax event="overlayselect" listener="#{infowindowview.onmarkerselect}" /> <p:gmapinfowindow id="infowindow"> <p:outputpanel style="text-align: center; display: block; margin: auto"> <p:graphicimage name="/demo/images/antalya/#{infowindowview.marker.data}" height="150" /> <br /> <h:outputtext value="#{infowindowview.marker.title}" /> </p:outputpanel> </p:gmapinfowindow> ...

javascript - What limitations apply to opaque responses? -

opaque responses defined part of fetch api , , represent result of request made remote origin when cors not enabled. what practical limitations , "gotchas" exist around how opaque responses can used, both javascript , resources on page? access opaque responses' headers / body the straightforward limitation around opaque responses cannot meaningful information of properties of response class, headers , or call various methods make body interface, json() or text() . in keeping black-box nature of opaque response. using opaque responses resources on page opaque responses can used resource on web page whenever browser allows cross-origin resource used. here's subset of elements cross-origin resources, , therefor opaque responses, valid, adapted mozilla developer network documentation : <script> <link rel="stylesheet"> <img> , <video> , , <audio> <object> , <embed> <iframe> a n...

c# - WPF Design-time Data Binding to Sample Data -

wpf, c#, .net 4.52, visual studio 2015, mvvm, prism/unity, telerik ui wpf - listbox "radlistbox" control based on following class pseudo-structure gets populated database calls @ run-time: <process> <steps> <step> <submodules> <submodule> <submodule> <submodule> </submodules> </step> <step> <submodules> <submodule> </submodules> </step> </steps> </process> i have view model property called selectedstep represents current step. of type step . i have view listbox control itemssource property bound selectedstep.submodules . works great @ runtime , shows me list of submodules selected step. but want see list of sub modules @ design time can style list. created sample data in file called step.xaml structure looks this:...

Delete tables having exactly 10 rows in MySQL -

is possible delete tables 10 records in single statement using statement this? .. drop table ... name in (select table_name information_schema.tables table_schema = 'my_db' , table_rows = 10); first of all, don't trust table_rows in information_schema.tables. it's estimate , it's not precise. how precise, given @ given moment, there might transactions uncommitted either insert or delete rows? number of rows in table may or may not include changes. secondly, drop table statement supports fixed list of tables drop. here's syntax reference http://dev.mysql.com/doc/refman/5.7/en/drop-table.html : drop [temporary] table [if exists] tbl_name [, tbl_name] ... [restrict | cascade] this statement not support where clause or conditions. must name tables explicitly. you should develop habit of reading documentation find out syntax supported. biggest complaint have questions on stack overflow: many people skip reading reference documenta...

active directory - Python LDAP: LDAPObject.search_s() works, but LDAPObject.search() doesn't -

i trying implement basic ldap authentication script in python, , trying perform simple ldap search , see if works. believe have correctly created , set ldap object , connection. after binding, try perform search. using ldapobject.search_s() method returns list of strings user information. when use ldapobject.search() method, though, method returns result code 2, protocol error. reason want use search() method because returns int , not list. understand according the python ldap documentation , 2 methods can take in same arguments, don't understand why 1 method returning error , not other. here code: import ldap import getpass # login info username = raw_input("enter username: ") password = getpass.getpass("enter password: ") ldap_server = "ldap://ipaddress:port" base_dn = "ou=domain users,dc=dummyname,dc=com" user_dn = username + "@dummyname.com" search_filter = "(&(objectclass=user)(samaccountname=" + user...

mysql - SQL Trigger doesn't work (based on schedule) -

i want create trigger allow insert execute on work hourse (mon fri 9 5 pm). have create definer=`root`@`localhost` trigger `noworkhour` before insert on `empleado` each row begin if dayofweek(now()) between (2, 6) , curtime() between '09:00:00' , '17:00:00' signal sqlstate '45000' set message_text = 'solo se pueden ingresar en horario de trabajo'; end if; end but when try insert something, shows: /* error de sql (1241): operand should contain 1 column(s) */ /* affected rows: 0 filas encontradas: 0 advertencias: 0 duración para 0 of 1 query: 0,000 sec. */ i use mariadb this. after @mustaccio comment, messing other thing rather trigger itself. trigger goes follow: create definer=`root`@`localhost` trigger `noworkhour` before insert on `empleado` each row begin if dayofweek(now()) not between 2 , 6 , curtime() not between '09:00:00' , '16:00:00' signal sqlstate '45000' set message_text =...

c# - Business objects and multiple data sources -

on wpf application, made 2 separate projects: ui (with xaml , viewmodels) , "core" (it has people call "domain objects" or "business objects" - objects represent discrete concepts in use cases). understand practice. but many of business objects interact multiple data sources. example, document object might contain data database file. and then, of things can "do" document - implement methods on document - involve other resources. instance, document.submitforprocessing() calls web service. so wrote this: public class document { public string name { get; set; } public string filepath { get; set; } public string filedata { get; set; } private document() { } public static document getbyid(int documentid, string databaseconnectionstring, string basefilepath) { // using dapper document newdoc = db.query<document>("select name, filepath documents id = @pid", new { pid = documentid ...

vb.net - how to avoid #Error and NaN in SSRS -

Image
i have expression in report in order calculate ratios: = sum(fields!paidlosses.value) / lookup(fields!yearnum.value & fields!monthnum.value, fields!yearstartrisk.value & fields!monthnum.value, fields!earnedpremium.value, "earnedallcoverages") when choosing parameter not enough data got #error , nan. result of nan division of "-" on "-" values. , result of #error division of "-" on 0 values. try: =sum(fields!paidlosses.value) / iif( isnothing( lookup(fields!yearnum.value & fields!monthnum.value, fields!yearstartrisk.value & fields!monthnum.value, fields!earnedpremium.value, "earnedallcoverages") ) or lookup(fields!yearnum.value & fields!monthnum.value, fields!yearstartrisk.value & fields!monthnum.value, fields!earnedpremium.value, "earnedallcoverages") = 0,1, lookup(fields!yearnum.value & fields!monthnum.value, fields!yearstartrisk.value & fields!monthnum.value, fiel...

magento - rest-assured OAuth 1.0a How can I insert both Header and Query params in the request -

magento's 1.9 rest api needs both authorization header , oauth query params, oauth() allows either oauthsignature.header, or query_string given().auth().oauth(consumer_key, consumer_secret, access_token, secret_token,oauthsignature.header) i tracked code down com.jayway.restassured.internal.httpauthconfig.process(..), not sure here. q: there filter or method allow me force both? tl;dr started referring this: how use postman rest client magento rest api oauth. how token , token secret? last statement note, must check "add params header" checkbox in order magento rest calls work properly. using postman, oauth 1.0 works when check box , fails when don't, 403 access denied. same response when use oauthsignature.query_string in rest-assured. works: sent postman (add params header) /api/rest/products?oauth_consumer_key=<my-consumer-key>&oauth_token=<my-oauth-token>&oauth_signature_method=hmac-sha1&oauth_timestamp=...

jquery - Fancybox navigation right bottom corner -

Image
is possible make navigation in fancybox located on right bottom corner , having respond screen/fancybox image scaling while making screen bigger/smaller? fancybox template example http://fiddle.jshell.net/t91p3g7s/?utm_source=website&utm_medium=embed&utm_campaign=t91p3g7s my goal: navigation in right bottom corner of fancybox window: in fancybox 2 exists 2 properties move popup, leftratio , topratio default both receive value 0.5 means center, in leftratio if put 1.0 popup go right if put 0 left, topratio if put 1.0 go bottom , 0 top. jquery(document).ready(function($) { try{ $(".fancybox").fancybox({ helpers: { buttons: { tpl: '<div id="fancybox-buttons"><ul>' + '<li><a class="btntoggle" title="toggle size" href="javascript:;"></a></li>' + '<li><a cla...