Posts

Showing posts from July, 2013

javascript - JqueryUI and bootstrap interference with dialog display -

i'm having problems getting jqueryui , bootstrap work together. example here https://jsfiddle.net/2hcwxudd/1/ my code: <div id="dialog" title="welcome"> <h1>hello world</h1> </div> $(function () { $("#dialog").dialog({ show: { effect: "fold", duration: 500 }, }); }); you can see on dialog show there small resize event @ end of animation looks horrible. can't seem figure out what's causing or how resolve it, removing bootstrap resolves problem. i've tried noconflict (it's not js css thats causing it), , i've tried using various themes seem have same problem. any appreciated this due box-sizing in bootstraping, have unset box-sizing property like, .ui-dialog,.ui-dialog *{ box-sizing:unset !important; } demo

javascript - Why does using transform="translate(x, y)" make scrollbar unclickable? -

i've spent way long trying figure out...i have svg g elements , foreign object. issue is, when g element gets translated, scrollbar have within foreign object becomes unclickable. (i using chrome need working on...firefox seems working fine though) i have example in jsfiddle here . if remove transform="translate(...)" in first g element, scrollbar becomes clickable...but position bit off. have hover few pixels on top of scrollbar or up/down arrow interact it. idea why transform=translate() messing scrollbar , how go fixing this? .content { width:100px; height:100px; font-size:1.5em; overflow : auto; background-color:yellow; } <svg width="1243" height="651"> <g class="graph" transform="translate(200,20)scale(1)"> <g class="output"> <g class="nodes"> <g class="node update" transform="trans...

vb.net - crystal reports print summary of a group in another group footer -

i trying print report of format: name (formula: lname,fname) details name group summary of group1(by week) sumary of group2 (by name) summary of group 3 in group2 footer i want consolidated summary of 1 group eg: somerset, mark 6-12-2009 writer $400 7-12-2009 actor $500 year 1 $900 6-12-2010 unemployed $0 7-12-2010 writer $600 year 2 $900 writer $1000 actor $500 unemployed $0 somerset, william 5-12-2009 writer $300 7-12-2009 actor $300 year 1 $600 5-12-2010 unemployed $0 6-12-2010 writer $800 year 2 $800 writer $1100 actor $300 unemployed $0 the report grouped name formula. cannot create subreport! can please help! create 2 more formulas , place in details after regular fields , take summary in section ...

wordpress - add a "added to cart message" to page -

need help, added "the add cart short code" items on page. wanted add add cart notices page well. i don't have lot of experience wordpress or woocommerce. added class "woocommerce-message" div , display function which display message, shows div when there no message can 1 please show me correct way this, step step example? thanks appreciate help i believe page needs have wc_print_notices(); on it. notices should appear when needed.

vb.net - Linq statement: Inner function call conflicts with enclosing method name -

cryptic title, start code poses problem , clarify afterwards: public readonly property max double dim res = (from double() in values select a.max).max return res end end property values jagged array of double, private values()() double that initialized elsewhere. want use linq extract overall maximum value. code above gives following exception first .max : bc30978 range variable 'max' hides variable in enclosing block or range variable defined in query expression. if change property name else getmaximum error disappears. why can't call .max function double() variable a selected jagged array? call has in slightest name of method in? i using visual studio community 2015 on windows 8.1. both answers in vb.net or c# appreciated. workarounds as workaround can example following: private function getmax(a double()) double return a.max end function public readonly property max double dim res = (from ...

Is it possible to delete an object's property in PHP? -

if have stdobject say, $a . sure there's no problem assign new property, $a , $a->new_property = $xyz; but want remove it, unset of no here. so, $a->new_property = null; is kind of it. there more 'elegant' way? unset($a->new_property); this works array elements, variables, , object attributes ** edit ** i don't know how using unset() , how works me : $a = new stdclass(); $a->new_property = 'foo'; var_export($a); // -> stdclass::__set_state(array('new_property' => 'foo')) unset($a->new_property); var_export($a); // -> stdclass::__set_state(array())

c# - How to coerce using direct class structuremap -

i have problem writing valid configuration classes. suppose have: interface ia{} class abstract : ia {} class a1 : a, ia { private readonly ib _ib; public a1(ib ib) { _ib = ib; } } class a2 : a, ia { private readonly ib _ib; public a1(ib ib) { _ib = ib; } } and want inject classes constructor of others, , think there have no problems that, doing this: for<ienumerable<ia>>.use(x => x.allinstances<a>()); but don't know resolve problem property ib, if want use different _ib class a1 , class a2. interface b{} class b1 : b {} class b2 : b {} i know if have 1 class b , class can this: for<ia>().use<asample>().ctor<ib>().is<bsample>(); but problem try use this: for<ia>().conditionallyuse(c => { c.if(t => t.concretetype == typeof(a1)) .thenit .is.constructedby(by => new a1(by.instanceof<b1>())); c.if(t => t.concretetype == typeof(a1)) .thenit...

sql - ORA-01722: Invalid number in oracle -

i have table called table_temp column amount varchar2(20) executing below query: select to_number(amount) amt table_temp dc in ('c','d'); result above query amt ---- 0 123 511 485 0 i want fetch records amt > o , using below query that select amount amt table_temp dc in ('c','d') , to_number(amount) > 0; getting error ora-01722: invalid number please suggest me.. if sure rows in table dc in 'c' , 'd' numeric try: with temp_res (select amount table_temp dc in ('c','d')) select amount amt temp_res to_number(amount) > 0;

swift - Animated resizing of a NSView does not effect layer. Bug or totally correct? -

i have 2 nsview subclasses: drawrectview draws background color using drawrect method layerbackedview draws background color using layer backing the following code snippet resizing animation via click actions on views: @ibaction func clickdrawrectview(sender: nsclickgesturerecognizer) { let height = drawrectview.frame.height * 1.2 let width = drawrectview.frame.width * 1.2 nsanimationcontext.runanimationgroup({ (context) in context.duration = 1.0 self.drawrectview.animator().frame = nsmakerect(self.drawrectview.frame.origin.x, self.drawrectview.frame.origin.y, width, height) }, completionhandler: nil) } @ibaction func clicklayerbackedview(sender: nsclickgesturerecognizer) { let height = layerbackedview.frame.height * 1.2 let width = layerbackedview.frame.width * 1.2 nsanimationcontext.runanimationgroup({ (context) in context.duration = 1.0 self.layerbackedview.animator().frame = nsmakerect(self.layerbackedvi...

How get Advantage Database Server installed license count in Delphi Code -

i able number of installed user licenses advantage database server instance in code using delphi. have found function lets me installed version, ie. ace.adsmggetinstallinfo(dm.adsconnection1.handle,@stinstallinfo,@ussize);, not lets me check license count. the ace.adsmggetinstallinfo api call mentioned should correct call. after call appropriate info in ads_mgmt_install_info structure (@stinstallinfo in example). field you're looking unsigned32 called ulmaxstatefulusers .

php - Count logged in users in real time Laravel -

i think laravel solves problem well, extend question little bit. is possible in laravel show how many users logged in, in real time? like if 10 users logged counter should show 10 users logged in. shown ten users , in real time. so if users logs out, counter should decrease. the approach used after attempting login, can increment counter of 1 of column in db. can use table, logged in table. when users logged out, decrement counter deleting auth::id of user , count reduced. but want try in real time, how possible laravel itself?? you can use event broadcasting features of laravel 5 in real-time. every time user log in, need broadcast event. can follow tutorial: http://www.sitepoint.com/real-time-apps-laravel-5-1-event-broadcasting/ then on client side, need use javascript listen event.

java - libGDX generate random 2d world & read / write a file for structures -

i'm tring make game mega jump. goals: read in premade structs items goldcoin. reuse not used items (collected or out or scene) questions: what file types read in structures? (fast) should reuse items or there better way? (im working box2d) xml , jon both fine. jon more readable humanoids. libgdx has functionalities read both of them. minimise iterating these files, best load them once. you should reuse as can.

php - Pretty urls Apache -

i have site url looks www.abc.com/abc.php?id=10 , want change these pretty url www.abc.com/abc/10 , possible without rewriting code if yes how can , possible way without htaccess . u can use rewrite url within htaccess file. url rewrite and if want rewrite url without using htaccess can refer this post

php - how to show record inserted successfully? -

<?php $id=$_session['id']; //$date1=date("y-m-d"); //echo $date1; $work=$_post['postinput0']; //echo $work; $project_name=$_post['postinput1']; $skills=$_post['postinput2']; $description=$_post['postinput3']; $file1=$_post['file1']; $budget=$_post['postinput4']; //$radio=$_post['radio']; $sql = "insert job_post (u_id,job_category,project_name,job_sub_category,project_description,image,budget) values('$id','$work','$project_name','$skills', '$description','$file1','$budget')"; if(mysql_query( $sql, $conn )) { echo "successfully"; } else { echo "not inserted"; } ?> show message before submit button. dont want> plz me. show mess...

spring - Error creating bean with name 'freeMarkerConfigurer' -

i have package spring boot project war maven package. when deploy tomcat have web projecting running on it, wired problem happen.i'm start learning spring boot, me issue. thx~ org.springframework.beans.factory.beancreationexception: error creating bean name 'freemarkerconfigurer' defined in class path resource [org/springframework/boot/autoconfigure/freemarker/freemarkerautoconfiguration$freemarkerwebconfiguration.class]: bean instantiation via factory method failed; nested exception org.springframework.beans.beaninstantiationexception: failed instantiate [org.springframework.web.servlet.view.freemarker.freemarkerconfigurer]: factory method 'freemarkerconfigurer' threw exception; nested exception java.lang.linkageerror: loader constraint violation in interface itable initialization: when resolving method "org.springframework.ui.freemarker.freemarkerconfigurationfactory.setresourceloader(lorg/springframework/core/io/resourceloader;)v" class loader...

c++ - Boost serialization : read varying type of data -

i have c++ / cli project uses boost serialization serialize 3 different classes. know if possible parse first line of boost serialization archive in order know class serialized in archive, , create object of appropriate class , deserialize archive object. line contain id (maybe int or value of enum class) identify class serialized. the file format handled choice of archive implementation. in practice boost::archive::text_oarchive , boost::archive::binary_oarchive , boost::archive::xml_oarchive . as long archive type doesn't vary, can use boost variant distinguish payloads. in other words, make serialization framework work you, instead of "duct taping" around it: here's demo serializes 3 different (compound) payloads , roundtrips fine without external knowledge of payload there: live on coliru #include <boost/archive/text_oarchive.hpp> #include <boost/archive/text_iarchive.hpp> #include <boost/serialization/variant.hpp> #includ...

sql - how to give rank serially -

i have table like name age ----------------- jagga 25 lipu 25 aswinee 24 lisu 23 ankita 25 jhon 23 i want out put name age rank ------------------------- ankita 25 1 jagga 25 2 lipu 25 3 aswinee 24 4 jhon 23 5 lisu 23 6 the name , age must have order by clause rank count start 1. we not know dbms using, so mysql set @id := 0; select test.name , test.age , @id := @id + 1 rank test order age desc, name; ms sql server / oracle / postgresql : select name , age , row_number() over(order age desc, name) rank test order age desc, name

html - javascript - why is this element non-visible on cnn.com? -

i'm developing chrome extension highlights parts of webpages. need decide elements visible user. current filtering logic checks these properties: visibility, opacity, getboundingclientrect dimensions. these properties recognize cases, still find exceptions. e.g. ul element class "quick-links" on main page of cnn.com this element has no obvious property makes invisible. why element non-visible? there way programmatically recognize scenario? it looks quick-links container <div class="more-mega-nav"> has following properties, make children invisible user: .more-mega-nav { opacity : 0; height: 0; overflow: hidden; } it looks overflow: hidden deciding factor, browser clips child content extends beyond parent's width , height .

c++11 - Removing mutations for D metaprogramming/compiletime array generation -

my plan write mutation-less code in d-language values available runtime. spoke me loop-unrolling , compile time code generation have no clear idea how that. have made d-template below has no guarantee evaluated @ compile-time because on 2 assignment statements(mutations) . advice appreciated. suggestions preferably in d or c++ without macros. import std.stdio; import std.string; import std.conv; const char[] alphabet="abfcdfrghdsthfg"; const string pattern="aba"; i[c] computeatcompiletime(s ,c,i)( const s pattern ){ i[c] table1; const int size = to!int(pattern.length) ;//length of pattern matched foreach( c; alphabet){ //initialise array table1[c] = size; } foreach(i; 0..size-1){ table1[pattern[i]] = size -i-1; } return table1; } enum tablefromcompiler = computeatcompiletime!(const string ,char, int)(pattern); void main(){ // enum tablefromcompiler = computeatcompiletime!(const string ,char, int)(pattern)...

c++ - Can we assume the last 2 bits of a memory address are 00 and reuse those bits? A windows 7 page fault blue screen -

my friend programming in c++ on 64-bit windows 7 pc , came crazy idea save little bit of memory: observed last 2 bits of memory addresses seemed 00, figured use bits other things , when memory address needed, use bit-mask set last 2 bits 0, either when writing or reading memory. reason why he's using last 2 bits needs work on 32-bit systems too. anyway, on windows 7 64-bit system got following blue screen error when running program: page_fault_in_non_paged_area could crazy memory savings idea causing this? i.e., can happen last 2 bits of memory address not 00, , he's accessing memory that's partly on 1 of memory pages, partly off page? in event, needs work on popular operating systems. question applies other operating systems well. if (in windows 7 64 bit, @ least) scheme guaranteed work (if coded properly), else causing unusual blue screen crash? your friend taking advantage of feature known tagged pointers . on windows, raymond chen has warning regardi...

How to create different view for different exception laravel 5? -

i want set different view blade template different exception , pass errors on following page. tried out following code it's not working. goes else portion of code , run parent::render($request, $e); code. public function render($request, exception $e) { if ($this->ishttpexception($e)) { if($e instanceof invalidargumentexception) { return response()->view('front.missing', [], 404); }elseif($e instanceof errorexception){ return response()->view('front.missing2', [], 404); } return $this->renderhttpexception($e); }else{ if($e instanceof invalidargumentexception) { return response()->view('errors.204', []); } return parent::render($request, $e); } } where problem here , now? invalidargumentexception not child class of httpexception, goes else portion.

javascript - Progress bar on Copy Folder VBS -

i have following hta using vbscript copy folder 1 source folder destination folder. have a, far not working, progress bar made in css , javascript show progress. script copying folder succesfully, have not found way show progress. i need find way show actual progress in progress bar when copying folder. have tried various methods using statement for each file in folder without luck. i know there other methods of showing progress bar, i.e windows progress bar, use own. the following code samples in 1 hta, i've dividede sciprts better overview. hope helps. the following code acutal copy folder vbscript: <script language="vbscript"> sub setup dim fso, newfile, thisfile set fso = createobject("scripting.filesystemobject") folderdir = fso.getfolder("..\") dim wshshell, desktop, pathstring, objfso set objfso = createobject("scripting.filesystemobject") set wshshell = createobject("wscript.shell") desktop = wshshell....

javascript - Google Map Condition on Town -

i want condition on code user input start point , end point, want make check on start point check located in london or not find code work in function want variable town make function outside of function create checkpoint. var input = document.getelementbyid('start'); var autocomplete = new google.maps.places.autocomplete(input); autocomplete.bindto('bounds', map); var infowindow = new google.maps.infowindow(); // when user has clicked on autocomplete suggestion google.maps.event.addlistener(autocomplete, 'place_changed', function() { infowindow.close(); var place = autocomplete.getplace(); // town of selected place function gettown(address_components) { var geocoder = new google.maps.geocoder(); result = address_components; var info = []; (var = 0; < result.length; ++i) { if (result[i].types[0] == "locality") { return result[i].long_name; }...

html - Centering an element with an adjacent element -

i have button need align center. next button need display (a checkmark example). have been trying have run problem that: 1) if use display:inline can't center 2) if use display:block can't add element next it i have been trying figure out display:inline-block no avail jfiddle: https://jsfiddle.net/2x5a5zdx/ code: <input type="button" class='btn btn-md btn-primary' value="submit responses" id="submitbttn"/> <span class="green-success" id="surveysuccess" >&#10004</span> <span class="red-danger" id="surveyfailure" >&#10006</span> and css #submitbttn { margin:auto; display:inline-block; } #surveysuccess, #surveyfailure { } thank you as have pointed out, margin: auto not center inline element. since inline / inline-block level elements respect text-align property , add text-align: center parent element. in doing so, children...

ios - swift not sure on layoutIfNeeded setNeedsUpdateConstraints or updateConstraints setNeedsLayout -

i calling api. depending on json data modyfing view controller in viewdidload() in order change views design display given data best way possible. what hide uiviews , set constraints .active = false changing of constraint eg: let nocbutton = nslayoutconstraint(item: alisttop, attribute: nslayoutattribute.centery, relatedby: nslayoutrelation.equal, toitem: alistbottom, attribute: nslayoutattribute.centery, multiplier: 1, constant: 0) view.addconstraint(nobidbutton) then before closing viewdidload() change/disable constraints call view.layoutifneeded() so question is, if change/disable constraints or hide uiview, should call view.layoutifneeded() afterwards? also, need call view.layoutifneeded() right after every change or can call once before closing viewdidload()? i dont errors in console either way, want make sure doing right way. noted functions updateconstraints layoutifneeded seems work, tho im not 100% sure difference thanks in advance, i c...

apache - send email using php with AWS EC2 -

i use aws ec2 server (ubuntu instance) , want send email through php code i installed sendmail , modify .mc file blow feature(`no_default_msa')dnl dnl daemon_options(`family=inet6, name=mta-v6, port=smtp, addr=::1')dnl daemon_options(`family=inet, name=mta-v4, port=smtp, addr=127.0.0.1')dnl dnl daemon_options(`family=inet6, name=msp-v6, port=submission, m=ea, addr=::1')dnl daemon_options(`family=inet, name=msp-v4, port=submission, m=ea, addr=127.0.0.1')dnl i removed addr , restart sendmail service but, cannot send email. i tested sendmail on console (sendmail to@mail.com from@mail.com) and php file php sendmailtest.php. both of them work! but, still doesn't work when tried browser. ( http://test.com/sendmail.php ) here apache log sh: 1: sendmail: not found [thu apr 25 03:40:53 2013] [error] [client xxx.xxx.xxx.xxx] xxx@gmail.com [thu apr 25 03:40:54 2013] [error] [client xxx.xxx.xxx.xxx] file not exist: /var/www/favicon.ico ...

jquery - Merge two arrays with equal number of objects into one array -

i have 2 arrays filled objects, looks so: arrayyear : array [ year: "1977", year: "1980"... ] object { year: "1977" } arraymeal : array [ meal: "carrot", meal: "beef"... ] object { meal: "carrot" } how merge 2 arrays 1 looks so? array [ {year: "1977", meal: "carrot"}, {year: "1980", meal: "beef"}... ] the 2 arrays populated so: arrayyear = []; $('.item-year').each(function(index){ arrayyear.push({ year: $(this).attr('data-year') }); }) arraymeal = []; $('.item-meal').each(function(index){ arraymeal.push({ meal: $(this).attr('data-meal') }); }) basically, want extend object. so, jquery has method called .extend . there 1 problem here, have array of object... to solve issue, have loop array. can use code (read comments understand each lines): // assign first array var arr1=[{year:1992},{year:1996},{year:2000}]; ...

Regex for overlapping fixed width matches -

so have string: 'aaggbb' and want find groups of type axxxb x char. thought regex: /(a(?:...)b)/ig would trick, gets first one: ' aaggb b' and misses second one: 'a aggbb ' how both? i searched around while trying figure out hope didn't miss obvious. thanks! if looking fixed length substrings, need specifify limiting quantifier {3} (match 3 symbols) , use capturing inside look-ahead match substrings: (?=(a.{3}b)) see demo the look-ahead not consuming characters, , enable overlapping matches. "consuming" means after lookahead or lookbehind's closing parenthesis, regex engine left standing on same spot in string started looking: hasn't moved. position, engine can start matching characters again. (from rexegg.com ) var re = /(?=(a.{3}b))/g; var str = 'aaggbb'; while ((m = re.exec(str)) !== null) { if (m.index === re.lastindex) { re.lastindex++; } document.getele...

Excel VBA Looping formula to change Range -

i've written code manipulate data in l9 : dc9 , need repeat l10 : dc10 , l11 : dc11 , etc.. i've tried for next loop replacing value in range li:dci , specifying ( i ) 9 30 error. how can make loop function? my current version of excel 2013 what looking syntax this sub looprows() dim integer = 9 30 activesheet.range("l" & & ":dc" & i).interior.color = rgb(100, 100, 100) next end sub this example formats color of cell in each row. notice how use for-loop create looping range selection.

charts - Getting series and values from CSV data in Zingchart -

Image
while creating mixed chart in zingchart can pass type attribute values values array. i'm not sure when reading data csv how can achieved. want create mixed chart on fiddle link below data read csv file. var myconfig = { "type":"mixed", "series":[ { "values":[51,53,47,60,48,52,75,52,55,47,60,48], "type":"bar", "hover-state":{ "visible":0 } }, { "values":[69,68,54,48,70,74,98,70,72,68,49,69], "type":"line" } ] } zingchart.render({ id : 'mychart', data : myconfig, height: 500, width: 725 }); <script src="https://cdn.zingchart.com/zingchart.min.js"></script> <div id="mychart"></div> i put demo using sample data provided in one of rela...

git - Remove saved credentials from TortoiseGit -

my credentials saved in tortoisegit (using wincred) password changed. way me pull repository remove credential helper. how can change password? alternately, can remove credentials , save new ones? normally invalid credentials should purged automatically (after 1 unsuccessful authentication attempt). go control panel\user accounts , family safety\credential manager , there saved credentials should listed (prefixed git: ). for ways remove saved credentials on other os, see https://stackoverflow.com/a/39944557/3906760 .

parse.com - Optional Types With Parse and Swift -

if var findpublisher:pfquery = pfuser.query(){ findpublisher.wherekey("objectid", equalto:quote.objectforkey("publisher").objectid)//error here } i getting error value of optional type 'any object'? not unwrapped. don't know have done incorrectly. beginner please bear me:) this place give each quote pointer user object, , publisher of quote without query. if want way, do: let query = pfuser.query()! query.wherekey("objectid", equalto: (quote["publisher"] as! string)) // can unwrap long sure quote not nil, , publisher set. query.getfirstobjectinbackgroundwithblock({ (user: pfobject?, error: nserror?) in // check errors , use object }) this way of doing creates parse security issues , app's id , key can full user list.

html - Populate bootstrap table in meteor with dynamic data using {{#each}} OR create dynamic column width in bootstrap grids -

my question sort of combination of unanswered parts of this question , this one. i'm using meteor , trying make table or grid populated dynamic data mongodb, i'm having trouble finding method accomplishes want to. have grid uses {{#each}} tag data mongo, based on jim mack's answer question in first link. here bit of sample code: <template name="projectlist"> {{#each projects}} {{> projectrow }} {{/each}} </template> <template name='projectrow'> <div class='row span12'> <div class="projectrow"> {{#each row }} {{> projectitem}} {{/each}} </div> </div> </template> <template name="projectitem"> <div class="span6 projectitem nameitem"> {{name}}</div> <div class="span6 projectitem numberitem">{{number}}</div> </template> this works great , gets dat...

java - Error Plugin SoupUI in Rational Application Developer 8.0 -

i trying install soupui in ibm rational application developer 8.0. i go "help , install new software" , check "available software site". add location " http://www.soapui.org/eclipse/update/ " , select "ok". in name , version box see, there no site selected. when type url in "work with" box , add url, getting error: "no software site found @ http://www.soapui.org/eclipse/update/ . wish edit location?" how can plugin soupui rad? please help. i suggest contact admins of website ... appears update site indicate not available.

json - Elixir: How to convert a keyword list to a map? -

i have keyword list of ecto changeset errors i'd convert map poison json parser can correctly output list of validation errors in json format. so list of errors follows: [:topic_id, "can't blank", :created_by, "can't blank"] ...and i'd map of errors so: %{topic_id: "can't blank", created_by: "can't blank"} alternatively, if convert list of strings, use well. the best way accomplish either of these tasks? what have there isn't keyword list, list every odd element representing key , every element representing value. the difference is: [:topic_id, "can't blank", :created_by, "can't blank"] # list [topic_id: "can't blank", created_by: "can't blank"] # keyword list a keyword list can turned map using enum.into/2 enum.into([topic_id: "can't blank", created_by: "can't blank"], %{}) since data structure list...

node.js - GA Analytics Reporting API - authentication stopped working -

we have had ga reporting api integration working smoothly since last year no changes. recently, more precise, starting 31st of july, authentication stopped working. getting { error: 'invalid_grant' } . using service account explained here, https://developers.google.com/console/help/new/#serviceaccounts , , it's node.js script, using .p12 keys, outlined here, http://dannysu.com/2014/01/16/google-api-service-account/ . we did try recreating service account, making sure go through steps, enabling api's need enabled. tried making service account users owners, still no luck. are aware of might have changed regards service accounts authentication process? or has of experienced similar issues? cheers, iraklis i able solve issue running command sudo ntpdate ntp.ubuntu.com on server hosting integration scripts. synchronizes time ntp servers. the time off few minutes, , seems make lot of difference.

xml - How do I use Saxon to do multiple search/replace on values, in a way that's efficient -

i used saxon v9 profile xsl transformation converts xml json. profiler tells me function escapes characters takes 70% of total processing time. conversion important because otherwise created json file invalid because of characters break strings. java -jar saxon9he.jar -xsl:jsontransform.xslt -s:input.xml -o:output.json -tp the "method" used escape values looks this: <xsl:template name="escapejson"> <xsl:param name="string"/> <xsl:sequence select="replace( replace( replace( replace( replace( replace( replace( replace( replace($string, '\\','\\\\'), '/', '\\/'), '&quot;', ...

mysql - Database Query Issue with count of each row -

i have 2 tables following structure details --------------- id | session_id 1 1 2 1 3 1 details_extra --------------- id | details_id 1 1 2 1 3 2 4 3 output looking - output --------------- id | subscribers(count) 1 2 2 1 3 1 the query writing - select id, count(details_extra.id) details left join details_extra on details_id = details.id session_id='1'; output {id:1, subscribers:4} can 1 please help. edit - got working adding group by. try group id: select id, count(details_extra.id) details left join details_extra on details_id = details.id session_id='1' group id;

javascript - Creating a PNG from uncompressed raw PNG data -

i using android screenshot library capture screenshots. want show screenshot in web browser. i have written small socket app on pc connects android phone , encode captured screenshot base64. string base64 = base64.getencoder().encodetostring(bytes); this base64 being sent web page on websocket. below html/js code should draw image on canvas. have stored base64 image data in text file test purpose. <div style="background: aqua; width: 500px; height: 660px;"> <canvas style="width: 480px; height: 640px;" id="sim"> </canvas> </div> <script type="text/javascript"> var ctx; var width = 480; var height = 640; (function start() { ctx = document.getelementbyid("sim").getcontext("2d"); loadfromfile(); })(); function loadimage(data) { var image = new image(); image.onload = function() { //this part never executes ...

r - Different colours in ggplot based on geom_smooth -

Image
i created ggplot linear geom_smooth have points, geom_point have different colour below , above linear smooth line. i know can add color point doing geom_point(aes(x, y, colour = z)) . problem how determine if point in plot below or above linear line. can ggplot2 or have create new column in data frame first? below sample code geom_smooth without different colours above , below line. any appreciated. library(ggplot2) df <- data.frame(x = rnorm(100), y = rnorm(100)) ggplot(df, aes(x,y)) + geom_point() + geom_smooth(method = "lm") i believe ggplot2 can't you. say, create new variable in df make colouring. can so, based on residuals of linear model. for example: library(ggplot2) set.seed(2015) df <- data.frame(x = rnorm(100), y = rnorm(100)) # fit linear regression l = lm(y ~ x, data = df) # make new group variable based on residuals df$group = na df$group[which(l$residuals >= 0)] = "abov...

javascript - nginx deny access to JS and CSS -

i have webpage set using node.js set behind nginx. everythings work fine, block direct public access css , js files in nginx config have this: location /style/ { deny all; } location /js/ { deny all; } it correctly block access - when view source on webpage , try navigate directly css or linked js files 403 error. however, prevents node/nginx being able correctly use files style/add functionality page what correct way prevent people directly accessing files, while still being able use them display page itself? there isn't way. either browser can access file , use in page, or can't access file @ all. you try using referer request header, you'll false negatives , people have downloaded page have access js anyway (either cache or script tab in browser's developer tools).

python - pandas calculate rolling_std of top N dataframe rows -

i have dataframe this: date 2015.1.1 10 2015.1.2 20 2015.1.3 30 2015.1.4 40 2015.1.5 50 2015.1.6 60 i need caculate std of top n rows, such as: date std 2015.1.1 10 std(10) 2015.1.2 20 std(10,20) 2015.1.3 30 std(10,20,30) 2015.1.4 40 std(10,20,30,40) 2015.1.5 50 std(10,20,30,40,50) 2015.1.6 60 std(10,20,30,40,50,60) pd.rolling_std used this, however, how change n dynamically? df[['a']].apply(lambda x:pd.rolling_std(x,n)) <class 'pandas.core.frame.dataframe'> index: 75 entries, 2015-04-16 2015-07-31 data columns (total 4 columns): 75 non-null float64 dtypes: float64(4) memory usage: 2.9+ kb it done calling apply on df so: in [29]: def func(x): return df.iloc[:x.name + 1][x.index].std() ​ df['std'] = df[['a']].apply(func, axis=1) df out[29]: date std 0 2015.1.1 10 nan 1 2015.1.2 20 7.071068 2 2015.1.3 30 10.000000 3 2015.1.4 40 12.909944 4 2015.1.5 ...

jquery - DataTable sorting: make one column stay fixed -

i'm using jquery datatables plugin. sorting works fine, there way make 1 column stay same no matter sorting applied? for example, first column simple order numbers: 1, 2, 3, 4, 5... , when sort date, or else, first column stays in same order: 1, 2, 3..? is there way this? so, not trying disable sorting first column, make first column stay same when sorting applied columns. you can using orderfixed option defines ordering applied table. for example, sort first column in ascending order: $('#example').datatable( { "orderfixed": [ 0, 'asc' ] } );

objective c - Caching with NSMutableDictionary -

i new caching thing, , want cache (just when app still open) arrays of data. can tell me how using nsmutabledictionnary ? thanks. nsmutabledictionary collection type allows store data via key / value pairs. key of pair search , value want retrieve. if have key named dob may expect value of "1-19-1989". if want cache right @ beginning of start in applicationdidfinishlaunchingwithoptions: in appdelegate file. go this... - (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions { //// whatever data need nsstring *key = @"dob"; nsstring *value = @"1-19-89"; // place dictionary nsdictionary *dictionary = @{key: value}; // , nsmutabledictionary nsmutabledictionary *mutabledictionary = [nsmutabledictionary new]; [mutabledictionary setobject:value forkey:key]; return yes; } and @abhinav said, can either store nsuserdefaults small data , advise coredata large amounts of data. ...

sql - How to retrieve collection name based on item? -

i doing dspace search project. here have created seperate item page. have 1 problem. not able retrieve collection name in in item appears. collection2item displays collection id.please help. savio, thank clarifying in dspace 5. the following code appears document migration of community.name dspace 4 dspace 5. https://github.com/dspace/dspace/blob/master/dspace-api/src/main/resources/org/dspace/storage/rdbms/sqlmigration/postgres/v5.0_2014.09.26__ds-1582_metadata_for_all_objects.sql#l133-l141 dspace 5 introduced "metadata objects" , collection.name appears stored metadatavalue of "title".

machine learning - ML enough features? -

i'm trying train random forest on accelerometer dataset. calculate features mean, sd, correlation between axes, area under curve , others. i'm ml noob. i'm trying understand 2 things: 1.if split dataset 1 person test , train , run rf prediction accuracy high (> 90%). however, if train rf data different people , predict, accuracy low (< 50%). why? how debug this? not sure i'm doing wrong. in above example, 90% accuracy, how many features "enough"? how data "enough"? i can furnish more details. dataset 10 people, large files of labelled data. have limited myself above features avoid lots of compute. most classifier overfits, when training on 1 person not generalizes well, may "memorize" dataset labels instead of capturing general rules of distribution:how each feature correlated other/how affect result/etc. maybe need more data, or more features. it's not easy question, generalization problem, there many th...

python - how to authenticate users with django ejabberd bridge -

i trying integrate ejabberd django authentication. following instructions on: https://github.com/ffalcinelli/django-ejabberd-bridge i have followed every step. i have defined path of script authentication {auth_method, external}. {extauth_program, "script.sh"}. ( have defined full path here ) script file's content : #!/bin/bash source <path>/env/bin/activate python <path>/manage.py ejabberd_auth $@ my problem want ejjaberd maintain state of every user ( online , offline , away etc ). think whenever user login ( or logout ), data needs sent ejjaberd server. tried login , logout, these users not registering @ ejabberd ( localhost:5280/admin ) i have tried command console : python manage.py ejabberd_auth $@ it should ask me username , password. in log file there 1 log : 2015-08-03 08:11:05,791 [debug] ejabberd_bridge.management.commands.ejabberd_auth: starting serving authentication requests ejabberd how can send user data ejabberd? ...

python - statsmodels ARMA to predict out-of-sample -

i want predict return of time series, first fitted data set doesn't work when come predict tomorrow's return. code date = datetime.datetime(2014,12,31) todaydate = (date).strftime('%y-%m-%d') startdate = (date - timedelta(days = 1)).strftime('%y-%m-%d') enddate = (date + timedelta(days = 2)).strftime('%y-%m-%d') data = get_pricing([symbol],start_date= date1, end_date = todaydate, frequency='daily') df = pd.dataframe({"value": data.price.values.ravel()},index = data.major_axis.ravel()) result = df.pct_change().dropna() degree = {} x in range(0,5): y in range(0,5): try: arma = arma(result, (x,y)).fit() degree[str(x) +str(y)] = arma.aic except: continue dic= sorted(degree.iteritems(), key = lambda d:d[1]) p = int(dic[0][0][0]) q = int(dic[0][0][1]) arma = arma(result, (p,q)).fit() pre...

issue saving R plot with transparent background -

i trying save r plot transparent background png format. have followed few recommended method in stackoverflow every time still getting white background. test date follows: structure(list(wd = c(7.5, 22.5, 37.5, 52.5, 67.5, 82.5, 97.5, 112.5, 127.5, 142.5, 157.5, 172.5, 187.5, 202.5, 217.5, 232.5, 247.5, 262.5, 277.5, 292.5, 307.5, 322.5, 337.5, 352.5), mp1 = c(17.6, 21, 20.5, 26.5, 32.7, 38.3, 40.7, 41.8, 41.6, 44.4, 52.4, 62.5, 70.7, 74.4, 71.1, 66.9, 66.9, 69.4, 69.4, 67.4, 63.4, 55.9, 43.9, 33.9)), .names = c("wd", "mp1"), class = "data.frame", row.names = c(na, -24l)) i tried 2 methods both fail remove background. method 1: library(ggplot2) library(cairo) ggplot(dat, aes(wd, mp1)) + coord_polar( start = 0, direction = 1) + xlab("")+ ylab("")+ scale_x_continuous(limits = c(0, 360), expand = c(0, 0), breaks = seq(0, 360-1, = 90), labels=c("north", "east","south", "west...

javascript - Query set of points in AREA within distance from line segment -

i have line segments , points stored in db. how query db in order retrieve points within distance of multiple line segments. purpose when user clicks on path (road), objects within distance path should highlighted. thank you. update: example... have path goes (0,0) (0, 10). program should find , highlight objects within x-distance of path. suppose x-distance "2"... then, program should highlight objects within rectangle (0,2)(10,-2). basically, same finding objects proximity line (not single point). it easy when line horizontal... don't know how solve cases, including line may slope. update: points stored in large database, cannot check each , every 1 of them proximity. i'm trying find way retrieve ones close enough without overlapping requests much... once retrieved, can refine search using method described in "distance between point , line segment". (i think!) thanks! this give distance point p line segment v,w. (based on questio...