Posts

Showing posts from September, 2015

merge - Have nomatch return value as-is using match function in R -

merge - Have nomatch return value as-is using match function in R - i have much larger existing dataframe. smaller illustration replace of variables (replace state (df1)) newstate (df2) according column "first." issue values returned na since of names matched in new dataframe (df2). existing dataframe: state = c("ca","wa","or","az") first = c("jim","mick","paul","ron") df1 <- data.frame(first, state) first state 1 jim ca 2 mick wa 3 paul or 4 ron az new dataframe match existing dataframe state = c("ca","wa") newstate = c("tx", "la") first =c("jim","mick") df2 <- data.frame(first, state, newstate) first state newstate 1 jim ca tx 2 mick wa la tried utilize match returns na "state" matching "first" variable df2 not found in ori

json - Gson handling List Item Pairs of type -

json - Gson handling List Item Pairs of type <String, Object> - i'm reading in json string similar this... {"flags":{"0":null,"2166136261":null}} i have no thought on how handle class representation of this? smaller part of complex response i'm slowing trying class out create reading , writing gson simpler. i can't figure out how represent list item pairs of in class file. seems simple can't figure out @ moment. help appreciated. use code below class flag { map<object, object> flags; public map<object, object> getmap() { homecoming flags; } public void setmap(map<object, object> flags) { this.flags = flags; } } main class flag flag = new flag(); map<object, object> flags = new hashmap<object, object>(); flags.put("0", "test0"); flags.put("1", "test1"); flag.setmap(flags); system.out.println(new

SOLVED: Unable to authenticate via LDAP to directory (Active Directory) with Spring Security -

SOLVED: Unable to authenticate via LDAP to directory (Active Directory) with Spring Security - i'm using: - spring 3.1.3 and problem i'm unable connect active directory via ldap using valid credentials. i don't know if caused malformed pattern or configuration issue userdn or url's rootdn. although , @ first glance , seems correct. this current spring security config file: ... <security:authentication-manager alias="authenticationmanager"> <security:authentication-provider ref="ldapauthprovider" /> </security:authentication-manager> <bean id="ldapauthprovider" class="org.springframework.security.ldap.authentication.ldapauthenticationprovider"> <constructor-arg> <bean id="bindauthenticator" class="org.springframework.security.ldap.authentication.bindauthenticator"> <constructor-arg ref="contextsour

c# - ASP.NET Website: page with multiple forms -

c# - ASP.NET Website: page with multiple forms - i'm having problem while creating dynamically web page in asp.net (c#). i need insert multiple form tags in page, know can't set more 1 runat="server" attribute , don't need it. i want place them c# (one each element i've got manage), without runat attribute htmlform object utilize insert form adds runat attribute automatically , can't remove (tried form.attributes.remove("runat")) if utilize simple string like: "<form id="someid" method="post" action=""></form>" and add together multiple times div works. point don't want insert html objects writing them in string , add together innerhtml method. i'm looking object manage form without runat attribute or way remove htmlform. a user command cleanest solution can add together htmlgenericcontrol instead of htmlform object isn't bound specific attributes.

Drop and Inner shadow for button in javafx -

Drop and Inner shadow for button in javafx - i have button in javafx , pseudoclass .button:pressed supposed have drop , inner shadow. i'm trying is .button:pressed { -fx-effect: dropshadow( gaussian , rgba(0,0,0,0.7) , 10,0,0,1 ); -fx-effect: innershadow( gaussian , rgba(0,0,0,0.7) , 20,0,0,0 ); } however, sec effect seems applied button (actually, effect whichever comes sec applied). i've looked here: http://www.canoo.com/blog/2012/07/10/javafx-recipes-css-vs-code/?lang=de, don't see difference approach. there way apply 2 shadows 1 button? thank you. it's not possible in java 7 nor in java 8 chain effects or apply multiple effects via css. see oracle css documentation. the site reference mentions well: well @ moment not possible chain effects in css means apply 1 of needed effects lead next result code above… button javafx dropshadow

How to write API data to a computer file? -

How to write API data to a computer file? - i've never used api before. want start using api gives me prices , characteristics of items in online game. i'm in processing of learning how create api able extract available info specific website has such information. here's question: after extracting info website using api, want download info analysis. example, nice if download info excel file or csv file format can later import. know how can that? let me know if question still vague. here's api means: api, abbreviation of application programme interface, set of routines, protocols, , tools building software applications. api specifies how software components should interact , used when programming graphical user interface (gui) components. api makes easier develop programme providing building blocks. programmer puts blocks together. generally recieve info api json(java script object notation) or xml file.i prefer json because gives programmers

msbuild - TFS: Wix using TfvcTemplate.12 unable to find source files -

msbuild - TFS: Wix using TfvcTemplate.12 unable to find source files - i need utilize tfvctemplate.12.xaml because of pre , post build script execution back upwards , need run powershell script prebuild event. on tfs 2013, building wix project using old defaulttemplate.xaml works fine. while trying build using new default template tfvctemplate.12.xaml builds csharp project fine, wix unable find files, while files nowadays @ same location. here wix code: <?xml version="1.0" encoding="utf-8"?> <wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> <?define sourcedir=$(var.outdir)?> <?warning **************** target=$(var.targetdir) ***********?> <?warning **************** src=$(var.sourcedir) **************?> <product id="*" language="1033" manufacturer="test" name="testing" upgradecode="db7dac5a-ed29-45e6-8029-89f6486a9aca" version="1.0.0.0&qu

php - Acl vs RBAC in ZF2 -

php - Acl vs RBAC in ZF2 - i want incorporate component of access command in application, saw zf2 offer: zend /permissions/acl , zend /permissions/rbac , know more efficient , secured , , zfc-rbac ? give thanks . it totally depends on needs. rbac access command managed permissions on simply roles, acl solution managing both resources , roles. rbac of zend framework 2 has complexities going simplified in zf3. if consider using rbac suggest check zfc-rbac zf-commons built on top of prototype zf3's rbac. here on github can find zfc-rbac . if consider acl suggest take @ bjyauthorize can found here php security zend-framework2 zend-acl zfc-rbac

How to load a VAADIN Java web page using curl or anything else -

How to load a VAADIN Java web page using curl or anything else - for vaadin java application, created class wich loaded when go on designed web page. this class must started each day @ 12:00am, wanted create bash script wich uses curl request designed page tolaod class , start everything. them problem is, when tried page curl using curl http://localhost:8080/cub2dv725/mailengine i this: <!doctype html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <meta http-equiv="x-ua-compatible" content="ie=11;chrome=1"> <style type="text/css">html, body {height:100%;margin:0;}</style> <link rel="shortcut icon" type="image/vnd.microsoft.icon" href="./vaadin/themes/reindeer/favicon.ico"> <link rel="icon" type="image/vnd.microsoft.icon" href="./vaadin/themes/reindeer/favicon.ico"

javascript - How to set Backbone model to an objcet's child array? -

javascript - How to set Backbone model to an objcet's child array? - i've got backbone app gets info json array , appends html, when seek alter json info array object coundn't manage set related array model. note: i've took illustration of backbone construction website: http://bardevblog.wordpress.com/2012/01/16/understanding-backbone-js-simple-example/ here working code: json [ { "id": 0, "title": "abc", "list": [ { "type": 2, "date": "21.9.2012" } ] }, { "id": 1, "title": "cba", "list": [ { "type": 2, "date": "16.8.2013" }, {

java - Updating String variable in JLabel in JFrame -

java - Updating String variable in JLabel in JFrame - i have got little problem. have created 2 jframes, , in main 1 show string name. in other 1 can provide name. , when save 'name' variable name doesn't update in main frame. how update frame? public class main extends jframe { iframe frame = new iframe ("main"); jbutton button_name = new jbutton("enter name"); iframe frame_name = new iframe ("what name?"); point center = graphicsenvironment.getlocalgraphicsenvironment().getcenterpoint(); //get center of screen static image icon = toolkit.getdefaulttoolkit().getimage("icon.png"); buttonlistener button_listen = new buttonlistener(); /**************************************************************************/ string name = new string(); jbutton button_get_name = new jbutton("ok"); jtextfield field_name = new jtextfield(15); jpanel panel_name = new jpanel(); /*

asp.net - Is cookies shared between two applications on same host machine -

asp.net - Is cookies shared between two applications on same host machine - i have 2 application hosted on machine urls below. "//mymachine:port1/appl" "//mymachine:port2/app2" both app1 , app2 utilize same login credentials. problem when user logs out of app2, app1 seems logged out , redirects login page. there settings in iis logout in app2 not impact app1. browser stores cookies base of operations on domain name , path, if pay attending cookie tab of firebug see session cookies of localhost stores in localhost domain name. 2 application have same cookies. can store application cookies on different path. response.cookies.add(new httpcookie("data") { value = "....", path = "/app1" }); response.cookies.add(new httpcookie("data") { value = "....", path = "/app2" }); asp.net asp.net-mvc cookies iis-7.5

winforms - c# draw linklabel on usercontrol -

winforms - c# draw linklabel on usercontrol - i'm designing usercontrol hold list of linklabel s. this: public class itemcontrol : linklabel {} public class itemscontrol : usercontrol { private readonly list<itemcontrol> items; public taskbox() { this.items = new list<itemcontrol>(); } public list<itemcontrol> items { { homecoming this.items; } } } but how can draw items on usercontrol 1 time add together them list? how can add together clicked event them in code? you can set flowlayoutpanel command on itemscontrol , utilize next code draw itemcontrol s it: foreach (var item in this.items) { flowlayoutpanel1.controls.add(item); item.linkclicked += item_linkclicked; } void item_linkclicked(object sender, linklabellinkclickedeventargs e) { messagebox.show(((item)sender).name); } using flowlayaoutpanel arbitrary, if don't utilize flowlayoutpanel , can set each

java - concurrent threads for a method of EJB -

java - concurrent threads for a method of EJB - i have stateless ejb method process data. method works 5..20 seconds i need have 10 threads, executes method concurrently. made annotation method @schedule(second = "*", min = "*", hr = "*") container (glassfish 4) launches 1 thread method. i tried utilize annotation @asynchronous , create no effect what should do? write sec class using @schedule(second = "*", min = "*", hr = "*") phone call @asynchronous ejb method - then, if duration said, should start new thread every second. minimal example caller.java public class caller { @ejb asyncejb asyncejb; @schedule(second = "*", min = "*", hr = "*") public void call() { this.asyncejb.call(); } } asyncejb.java @stateless public class asyncejb { @asynchronous public void call() { // long running stuff. } }

java - How to get response of Status Command from Thermal printer using Tcp/Ip socket -

java - How to get response of Status Command from Thermal printer using Tcp/Ip socket - i working on new android application utilize (ethernet) thermal printer ,the smartphone , printer in same network (192.168.2.0 ) , till here works fine can print ticket , send command printer successfully, not able satuts of printer (paper status exemple ), send command (socket outputstream )but can't read response (inputstream ) using tcp/ip (socket) , question , how can read response of printer using inputstream ?? help appreciated. java android sockets tcp-ip thermal-printer

html - How to get two h4 tags on the same line? -

html - How to get two h4 tags on the same line? - i'd 2 <h4> tags on same row in bootstrap can't work. i'd have 1 <h4> aligned left side, , 1 right side. i've tried floating left , floating right no avail. http://jsfiddle.net/v8ufbbdl/2/ <div class="container"> <div class="row"> <div class="coolcontainer"> <h1>bootstrap jsfiddle skeleton</h1> <h1>bootstrap jsfiddle skeleton</h1> </div> </div> </div> css @import url('http://twitter.github.com/bootstrap/assets/css/bootstrap.css'); .container { margin-top: 10px; } .coolcontainer { border: 3px solid #bbb; } .coolcontainer h1:first-of-type { float: left; } .coolcontainer h1:last-of-type { float: right; } this works. floats first 1 left , sec 1 right. http://jsfiddle.net/x8eszw59/ edit er, guess you'd have alter &qu

charts - Advanced charting or plotting in JavaFx? -

charts - Advanced charting or plotting in JavaFx? - i'm looking way have more features basic javafx charts provide. "realtime" plotting of < 50 points divided multiple scatter series adding custom text labels points in scatter drawing lines within chart maybe custom color single scatter points i've seen people using multiple charts overlayed transparent background. i'm not sure if solution work future updates javafx. now i'm looking suggestions. in advance! i don't have exact solution, had similar need. found charting libraries poor in programming languages. however, found javascript had huge selection of charting (plotting) libraries. my suggestion utilize webview, , display chart in using javascript , html using library d3 or dimple. if don't know css/html/javascript there might learning curve. charts javafx real-time javafx-8

css - Fonts rendered incorrectly on SVG (Depending on browser) -

css - Fonts rendered incorrectly on SVG (Depending on browser) - i have svg: http://wefix.cf/resources/wefix2.svg the problem in chrome, looks fine, when switching net explorer, font changed. font using arial rounded mt. i want convert svg png, every online service returns image different font. why happening? as temporary solution, have ie query when browser ie, image displayed: http://wefix.cf/resources/wefix.svg which not appear on chrome... i can't svg work cross browser reason. can't convert of them png, keeps returning image false font. if http://wefix.cf/resources/wefix2.svg works browsers other ie, , http://wefix.cf/resources/wefix.svg works ie, can utilize conditional comments: <!--[if ie]> <img src="http://wefix.cf/resources/wefix.svg" alt="logo" /> <![endif]--> <!--[if !ie]> --> <img src="http://wefix.cf/resources/wefix2.svg" alt="logo" /> <!-- <

Constrain code to a fixed value or subset ValueSet via FHIR Profile -

Constrain code to a fixed value or subset ValueSet via FHIR Profile - would constrain particular code (defined valueset) fixed value or subset of original valueset via fhir profiles. clinical decision back upwards (cds) need 1) restrict status condition occurrence such status code cannot have value 'refuted' , 2) restrict status nonoccurrence status must 'refuted'. the core profile condition resource this: <element> <path value="condition.status"/> <definition> <short value="provisional | working | confirmed | refuted"/> <formal value="the clinical status of condition."/> <min value="1"/> <max value="1"/> <type> <code value="code"/> </type> <ismodifier value="true"/> <binding> <name value="conditionstatus"/>

java - why is Immutable Objects safe in Double-Checked Locking? -

java - why is Immutable Objects safe in Double-Checked Locking? - at bottom of http://www.cs.umd.edu/~pugh/java/memorymodel/doublecheckedlocking.html, says: double-checked locking immutable objects if helper immutable object, such of fields of helper final, double-checked locking work without having utilize volatile fields. thought reference immutable object (such string or integer) should behave in much same way int or float; reading , writing references immutable objects atomic. the sample , explanation of mutable 1 follows: // broken multithreaded version // "double-checked locking" idiom class foo { private helper helper = null; public helper gethelper() { if (helper == null) synchronized(this) { if (helper == null) helper = new helper(); } homecoming helper; } // other functions , members... } the first reason doesn't work the obvious reason doesn't

inheritance - Template syntax to accept an argument with the type of the derived object -

inheritance - Template syntax to accept an argument with the type of the derived object - i have class template in there function takes argument of type of class inherits template. can't seem find right syntax bring about. example, if template: // template promote simple c-style struct, t_c, // c++ class 't' constructors, destructors, // re-create , move assignment operators. template <typename t_c> class mytemplate { // in principle create templated re-create , move // constructors , assignment operators, they'd // implicitly deleted compiler unless explicitly defaulted // them: see // http://stackoverflow.com/questions/25246573/copy-assignment-operator-defined-in-template-being-deleted-by-compiler. // explicitly defaulting them works if template // contained in all-header library. however, on including // template-derived classes dll in visual studio 2013 // found that, when other methods // in class exp

postgresql - PDO pgsql is disabled -

postgresql - PDO pgsql is disabled - this confusing. commented out extension pdo pgsql php won't load it. restarted server after still no pgsql value on pdo. sees mysql driver. check if dll nowadays in extension directory, , yes is. missing? postgresql laravel laravel-4

Intellij Java/Scala: Delete to delimiter? (like Emacs Paredit) -

Intellij Java/Scala: Delete to delimiter? (like Emacs Paredit) - one of awesome features of emacs "paredit" mode works lisp-like other languages java/scala ability nail ctrl-k (kill), , smartly delete text until appropriate delimiter, closing quote-mark, or closing brace/paren/square-bracket. delete things while still keeping code syntactically valid, i.e. delete right number of closing parens/braces, etc. is there such action or keyboard shortcut in intellij idea? or how define macro this? i have solution works: record macro sequence (mac key-bindings): expand selection (alt up) expand selection (alt up) right selection (shift rightarrow) cut selection (cmd x) then bind macro ctrl-k. works great, e.g. (the vertical bar caret position when invoked): list( "first", "second", "third |string", "fourth") => list( "first", "second", "third ", "fourth") {100, 200, {300|, 40

sql server - Determining if one row's column equals another row's column -

sql server - Determining if one row's column equals another row's column - hello table this: id | name | description | location | effec_dte ---------------------------------------------- 1 | serv | ohcod01 | nyny | 2014-1-1 2 | serv | ohcod01 | cala | 2014-1-1 3 | serv | ohcoa11 | scco | 2014-5-1 4 | serv | ohcoa11 | scco | 2014-5-1 ... in illustration there 2 applications, 1 hosted in new york , la other hosted in columbia. want find each application , check first , sec row determine if in same city or hosted in 2 different cities. is there way this? thanks! edit: select name table (//logic find names exist in 2 locations) belong 2 or more different cities with cte ( select *, row_number() over(partition location order id ) row mytable ) cte.row>1 belong 1 cities with cte ( select *, row_number() over(partition location order id ) row mytable ) cte.row=1 sql-server

vb.net - Convert string to integer with CINT -

vb.net - Convert string to integer with CINT - const gconintrows1st integer = 15 const gconintrows4th integer = 20 i trying convert string integer by using: intnumber = cint(strnumberselected(intfirst5balls)) professor's inttemperature = cint(strtemperatures(intmonth)) but how not work. the professor's version worked fine cannot figure out why intnumber not. yes, first time doing vb it looks strnumberselected string array, correct? , you're asking string in array @ position intfirst5balls? take example: dim strarray string() = split("hi|there|everybody", "|") the split() function split our long string @ each occurrence of pipe ("|"). the resulting string array have next 3 elements: "hi" "there" "everybody" and you'd reference these elements indexes: strarray(0) = "hi" strarray(1) = "there" strarray(2) = "everybody" if yo

ruby - How do I document generated classes in Yard? -

ruby - How do I document generated classes in Yard? - i have class create mill function this: cake = myproject.struct(:type, :price) in yard, it's displayed along constants: cake = struct(:type, :price) i want show in "classes: " list. after reading on docs, lead believe work: # @!parse class cake; end cake = myproject.struct(:type, :price) but literally changed nothing. is possible yard document dynamically created classes classes? ruby rdoc yard

Rails: Not receiving email from contact us form -

Rails: Not receiving email from contact us form - i have app in hosted in heroku test if contact form work never receive email, contact model class contact < mailform::base attribute :name, :validate => true attribute :email, :validate => /\a([\w\.%\+\-]+)@([\w\-]+\.)+([\w]{2,})\z/i attribute :message attribute :nickname, :captcha => true # declare e-mail headers. accepts mail service method # in actionmailer accepts. def headers { :subject => "my contact form", :to => "contact@gmail.com", :from => %("#{name}" <#{email}>) } end end and thid production.rb file config.action_mailer.default_url_options = { :host => 'young-river-2391.herokuapp.com' } config.action_mailer.delivery_method = :smtp config.action_mailer.perform_deliveries = true config.action_mailer.raise_delivery_errors = false config.action_mailer.default :charset => "utf-8

How to convert xml data to data frame in R -

How to convert xml data to data frame in R - hello guys, need load xml file info frame in r. xml format shown below. how acheive same? <?xml version="1.0" encoding="utf-8"?><posts> <row id="1" posttypeid="1" acceptedanswerid="17" creationdate="2010-07-26t19:14:18.907" score="6"/></posts> i tried below code....it not give desired output. expecting tabular output column names , values listed below. library(xml) xml.url ="test.xml" xmlfile = xmltreeparse(xml.url) class(xmlfile) xmltop=xmlroot(xmlfile) print(xmltop)[1:2] plantcat <- xmlsapply(xmltop, function(x) xmlsapply(x, xmlvalue)) plantcat_df <- data.frame(t(plantcat)) xml.text <- '<?xml version="1.0" encoding="utf-8"?> <posts> <row id="1" posttypeid="1" acceptedanswerid="17" creationdate="2010-07

c# - Which pattern should be used to determine the builder to use for an item? -

c# - Which pattern should be used to determine the builder to use for an item? - i have builder-director implementation i'm using build item. public void main(itemkey itemkey) { director adirector = new director(); itembuilderfactory itembuilderfactory = new itembuilderfactory(); var builder = itembuilderfactory.getbuilderfor(itemkey); //<--- how this? adirector.construct(builder, itemkey); console.writeline(builder.item.businessname); console.writeline(builder.item.customername); console.writeline(builder.item.advancedname); } public class director { public void contruct(iitembuilder builder, itemkey itemkey) { builder.createitem(); builder.getbusinessiteminformation(itemkey); builder.getcustomeriteminformation(itemkey); builder.getadvancediteminformation(itemkey); } } public interface iitembuilder { item item { get; } void getbusinessiteminformation(itemkey itemkey); void getcustomerit

c++ - Default argument for STL container in templated function -

c++ - Default argument for STL container in templated function - i have templated function of form template <typename t> void my_fct( vector<t> ){...} and provide default argument, such my_fct() can called. clearly, compiler not know type "t" in case, there way give default type in case? i tried pass empty vector of type double template <typename t> void my_fct( vector<t> = vector<double> ){...} but not work. thanks! make t default argument: template <typename t = double> void my_fct( vector<t> = vector<t>() ) {...} so when user calls function 0 arguments, type of vector std::vector<double> initialized default argument. c++ templates stl

java - Using vector with JTable -

java - Using vector<String> with JTable - i have vector of string type entries formed as: vector<string> namelst = new vector<string>(); namelst.add("jacob"); namelst.add("stacey"); [...etc] i not know number of entries - hence vector instead of array. able display names in tale (with possibility of editing). problem is, jtable uses vector implementation uses list (rather table) trying go through entries of namelst , allocate in new vector: vector<vector<string>> helper = new vector<vector<string>> (string nametmp : namelst){ vector<string> = new vector<string>(); a.add(nametmp); helper.add((vector<string>)a.clone()) } however table (while formated correct) remains empty. expect info should remain safe , not go out of scope since i'm cloning helper vector. there way vector populate jtable? edit: illustration - don't have minimum working example, relevant code is: the dis

android pay - Is Gmail API supports Google wallet as upload parameter? -

android pay - Is Gmail API supports Google wallet as upload parameter? - as know can transfer money through gmail google wallet but want create process automated (as per requirement of project). everything fine! can't see upload_type parameter attaching wallet-money . there way it? no, unfortunately gmail api doesn't back upwards attaching wallet payment. gmail android-pay gmail-api

symfony2 - Populate join table in symfony 2 form -

symfony2 - Populate join table in symfony 2 form - i working on rest based sf2 back-end solution. have 1 mutual file responsible crud operations. now, working on module responsible storing mapping between user & address. user may have multiple address 1 of them active address. my user entity : id, name,email.... address : country, state,city.... bring together table : id,user_id,address_id,is_active. i using "entity" field type "address" in "user" form. scenario is, end user input user & address values (i using postman) & back-end code create rows in user & address tables & create relation between them using join_table(user_address). have followed instructions tutorial :http://www.prowebdev.us/2012/07/symfnoy2-many-to-many-relation-with.html but now, when passing value back-end, give error: { "code": 400, "message": "validation failed", "errors": { "chi

asp.net - Sitecore doesn't show changes on page unless recycle AppPool -

asp.net - Sitecore doesn't show changes on page unless recycle AppPool - sitecore version: sitecore 7.2 i have command queries web index item, when new items added or old items edited, changes won't show on page. i tried: disable htmlcache in web.config republish items , go web database create sure in web rebuild web index , utilize same query (from search.log) in luke check query result clear cache using /sitecore/admin/cache.aspx tool recycle apppool in iis (only worked) the items in web database , web index, won't appear on page unless recycle apppool. per previous comments, need rule out iis caching. can kernel-mode caching , regular output caching. can compression. if have configured compression , identified mime type static iis create compressed re-create of file in temp dir. remember items (potentially) cached, not html. should disable caching in various locations in config. utilize caching configuration reference , optimizing performa

sql - Select same number of rows even if data is not there -

sql - Select same number of rows even if data is not there - i want write query select same number of rows, if info not there. if info not there, still select in place. for example, if want select amount in bank business relationship lastly 5 years, have info lastly 3 years, still select 5 rows , have 0's 2 missing years? class="lang-none prettyprint-override"> | year | balance | | 2014 | $5 | | 2013 | $10 | | 2012 | $31 | | 2011 | $0 | << doesn't exist | 2010 | $0 | << doesn't exist is possible? help. using mssql, work. there other similar functions other dbs. select top 5 year, isnull(balance,0) yourtable sql select

ruby on rails - Query the associated table (without losing my hair) -

ruby on rails - Query the associated table (without losing my hair) - ok, here's deal .. should simple, , i'm screwing sort of syntax somewhere: i've got charge model has belongs_to relationship card . i'd retrieve charges belong card name "john doe". i've tried following, it's not working should (probably because i'm screwing syntax): charge.where(card: [name: "john doe"]) help brother? @floatingrock: seek this: charge.joins(:card).where(cards: { name: 'john doe' }) as per requirment, first need bring together charge card , apply condition. hope works you. ruby-on-rails rails-activerecord

angularjs - Need example of how to use angular-scroll -

angularjs - Need example of how to use angular-scroll - i'm trying figure out how utilize angular-scroll source on github: https://github.com/durated/angular-scroll i'm still new angularjs , think i'm having problem reading in between lines on example. i've correctly downloaded angular-scroll using bower, have set in index.html, , have injected dependency. i'm unsure how utilize it. if had jsfiddle quickly. want scroll element using id. i'm using $anchorscroll , it's working want smoother. any help/examples appreciated! providing have followed steps described above case of attaching directive element: <a href="#title" du-smooth-scroll>scroll top</a> by default smooth scroll element corresponding id: <h1 id="title">i scroll target</h1> source code: https://github.com/oblador/angular-scroll/blob/master/example/index.html demo: http://oblador.github.io/angular-scroll/ angularj

How do you get your application to deploy after the datasource has been bound in JBoss 4.2? -

How do you get your application to deploy after the datasource has been bound in JBoss 4.2? - i have jboss 4.2 appserver running, mysql-ds.xml defined. have set of custom jars want deployed mbean, utilize bounded mysql connection java:/mysqlds. however, seems jars loaded before datasource bounded. is there way ensure mbean loaded after datasource bounded? here log entries: 11:39:29,639 fatal [datasourceconnectionprovider] not find datasource: java:/mysqlds javax.naming.namenotfoundexception: mysqlds not bound @ org.jnp.server.namingserver.getbinding(namingserver.java:529) @ org.jnp.server.namingserver.getbinding(namingserver.java:537) @ org.jnp.server.namingserver.getobject(namingserver.java:543) ... 11:39:29,666 error [hibernateutil] building sessionfactory failed. org.hibernate.hibernateexception: not find datasource @ org.hibernate.connection.datasourceconnectionprovider.configure(datasourceconnectionprovider.java:56) @ org.hibernate.connection.con

ios - how can I rename simulator in Xcode 5? -

ios - how can I rename simulator in Xcode 5? - i using xcode 5 , want rename simulators 3.5 inches iphone 4 or 4s , on. please help.i couldn't find on web. that feature available in xcode 6. check out section change simulated device , ios version in ios simulator user guide. ios xcode5

How to efficiently bring in all raster files into R? -

How to efficiently bring in all raster files into R? - i bringing in 10+ raster files (one-band files, not big) r folder outside of working directory. individually calling files works, it's getting tedious. have seen people utilize code similar this: require(raster) current.list <- list.files(path="y:/spatial/rasterdata/current", pattern =".tif", full.names=true) c.stack<- stack(current.list) however, raising various errors me. including, ".rasterobjectfromfile(x, band = band, objecttype = "rasterlayer", : cannot create rasterlayer object file. (file not exist)" note, i've tried several different formats (.grd, .img) , require(rgdal) prior running command. in advance thoughts! i haven't tested it, think if add together "$" sign end of pattern = ".tif" portion, i.e.: current.list <- list.files(path="y:/spatial/rasterdata/current", pattern =".tif$",

javascript - How to respond to the user selecting a row in jQuery.dataTables? -

javascript - How to respond to the user selecting a row in jQuery.dataTables? - i'm writing web application using jquery.datatables. i'm sure did time before, i'm having problem figuring out proper way create page respond user clicking on row. the basic thought want able respond click on row showing user more info row. invoke function when row clicked. may need place 1 or more buttons in each row can clicked on row-specific functionality, such navigate form edit or delete row. $('#tbldata').datatable({ data: data, columns: columns, // column names specified bfilter: false, bpaginate: false, binfo: false }); i have thought "events" reference might reply (http://www.datatables.net/reference/event/), haven't had such luck. to place event on table's row utilize .on method: $("#tbldata").on('click','tbody > tr',function(e){ }); then, if place buttons within rows, can sa

c++ - How to tell if /GS compiler is enabled for a PE Win32 -

c++ - How to tell if /GS compiler is enabled for a PE Win32 - i able parse aslr, dep, seh, etc. dos headers not sure how tell if file compiled /gs stack canaries. i writing program, pointing me programme pestudio won't help me unless open source. is part of dos headers? or have scan .data section __security_cookie? go image_nt_headers then image_optional_header (image_nt_headers.optionalheader ) then image_data_directory (image_nt_headers.optionalheader.datadirectory) the 10th entry virtualaddress fellow member rva "load configuration directory". image_nt_headers.optionalheader.datadirectory[image_directory_entry_load_config].virtualaddress the load configuration directory image_load_config_directory structure. check securitycookie member: if it's not 0 /gs in utilize pe. c++ c winapi pe executable-format

arrays - Javascript error: object is not a function in a video poker script -

arrays - Javascript error: object is not a function in a video poker script - so have been writing script play video (or text-based) poker game exercise in learning javascript. have working play through instance of game once, on trying run sec time, develops error: "uncaught typeerror: object not function" this error comes when trying create new hand. here relevant code, left few functions out don't seem causing issues: //object constructor card function card(suite, facevalue) { this.suite = suite, this.facevalue = facevalue } //object constructor hand function hand(cards, handname, score, dochandname) { this.cards = cards, this.handname = handname, this.score = score, this.dochandname = dochandname } var deck = new array; var builddeck = function() { (var = 0; <= 52; i++) { if (i < 13) { deck[i] = new card("spades", + 2); } else if (i < 26) { deck[i] = new card("clubs", - 11); } el

android - Stretch image of button image from code -

android - Stretch image of button image from code - i'm programatically adding imagebuttons layout, problem can't command size of images retrieved database results in of them beingness small. i'd know if there's way define image button stretch displayed image. for(datamodel m : list){ imagebutton btn = new imagebutton(this); byte[] convert = base64.decode(m.getimage(), base64.default ); btn.setimagebitmap(bitmapfactory.decodebytearray(convert, 0, convert.length)); btn.setid(integer.parseint(m.getfoodid())); btn.setonclicklistener(new onclicklistener() { @override public void onclick(view v) { // later } }); btn.setlayoutparams(new layoutparams(layoutparams.fill_parent,200)); ((linearlayout) layout).addview(btn); } you can utilize setscaletype method o

jquery - jvectormaps Changing div onRegionClick -

jquery - jvectormaps Changing div onRegionClick - what have 3 divs each own id's in class. in css file have made class "display:none;". <div class="stat"> <div id="one"> <p>one</p> </div> <div id="two"> <p>two</p> </div> <div id="three"> <p>three</p> </div> </div> what want have map able alter display on specific div everytime click state. example, everytime click state a, div 1 appear, if click state b, div 2 appear div was. fiddle link if helps: http://jsfiddle.net/mrvvuh1n/ cheers quite late answer, hope help someone. if doesn't need templated, suggest solution jquery: $('path[data-code="#"]').click(function(){ $('#one').css('display', 'block'); $('#two').css('display', 'hidden'); //something that, illustration }); where instead of # data-

vba - Method 'frames' of object 'JScriptTypeInfo' failed -

vba - Method 'frames' of object 'JScriptTypeInfo' failed - i working on automation of net explorer 9 through excel vba, throws error when reach on lastly line below: set ie = createobject("internetexplorer.application") ie.visible = true ie.navigate "https://example.com/main.asp" 'delay till readystate finish set doc = ie.document set doc1 = doc.frames(2).document 'here comes error can please help? i have face same issue , got resolved this work ie 10+ set doc = ie.document.frames set doc1 = doc.frames(2) for script element, readystate no longer supported. starting net explorer 11, utilize onload ie 11 has different ways access attributes vba internet-explorer excel-vba frames comexception

php - Using a Twig variable inside the 'use' tag -

php - Using a Twig variable inside the 'use' tag - i want dynamically utilize twig template, reason can't work. when add together line, page crashes: {% utilize current_page %} current_page set "birthday.twig", exists. as twig documentation states: because utilize statements resolved independently of context passed template, template reference cannot expression. so unfortunately not possible have variable {% utilize xyz %} statement. however, can include using variable. see http://twig.sensiolabs.org/doc/recipes.html php twig

php - Only the last image displays from database -

php - Only the last image displays from database - i asked question before no 1 help me unfort. have images , headings coming database problem 1 image displaying(the lastly image) need both display. here revised code $query = "select page_title, page_image pages id='$page'"; $result = mysqli_query($connection, $query); confirm_query($result); while ($page_fetch = mysqli_fetch_assoc($result)) { $page_title = $page_fetch['page_title']; $images = $page_fetch['page_image']; echo "<div class=\"content \">"; echo "<h3 class=\"words\"><a href=\"\"> $page_title </a></h3>"; echo "<a href=\"\"><img src='pics/" . $images . "' width=\"340\" height=\"252\" alt=\"\" /></a>"; echo "</div>"; //end box } // close while loop here database pages page

java - Why does Play build report error: package org.json does not exist with chargebee-1.0 in build.sbt? -

java - Why does Play build report error: package org.json does not exist with chargebee-1.0 in build.sbt? - i'm trying import org.json play framework project, can't rid of error message: error: bundle org.json not exist using eclipse , i've added org.json-chargebee-1.0.jar java build path, , build.sbt file looks this: name := "sorlandsportalen" version := "1.0-snapshot" librarydependencies ++= seq( javajdbc, javaebean, cache, "mysql" % "mysql-connector-java" % "5.1.26", "org.hibernate" % "hibernate-entitymanager" % "4.3.1.final", "org.json"%"org.json"%"chargebee-1.0" ) play.project.playjavasettings i'm using play framework version 2.2.1 execute play eclipse in project's directory after having added dependency "org.json" % "org.json" % "chargebee-1.0"

extjs5 - ExtJS custom theme: Generating darker icons for panel. -

extjs5 - ExtJS custom theme: Generating darker icons for panel. - in project there requirement create custom theme. base of operations color of components light(almost white). issue icons appearing on header of panels/windows(close, maximize) invisible. sass variables need declare images used these panels , windows darker(in contrast white)? , in scss file need include them? you need replace images, in extjs 5 can find them at: yourprojectfolder/ext/packages/your-theme/resources/images/tools/ there have 2 files, tools-sprites.png , tool-sprites-dark.png can replace them there if using standard theme or can save new image in custom theme folder path. notice work browsers, have rebuild theme using sencha command. extjs extjs5

java - How to convert a string to camel case in phpstorms (velocity based) file tempates? -

java - How to convert a string to camel case in phpstorms (velocity based) file tempates? - what i've tried far is: ## $name 'my_controller_c' #set($name = $name.removeandhump($name)) #set($name = $name.underscorestocamelcase(string) but not work. first 1 nothing, sec 1 throws java error. i tried using regular expressions , loop through string, java knowledge basic. this is, ended doing: #set($ctrlname = $name.replaceall("-c$", "")) #set($ctrlnewname = "") #foreach($str in $ctrlname.split("-")) #set($str = $str.substring(0,1).touppercase()+$str.substring(1)) #set($ctrlnewname = $ctrlnewname + $str) #end #set ( $ctrlnewname = $ctrlnewname + "ctrl" ) java intellij-idea phpstorm velocity

Why get Unable to verify your data submission error in Yii2? -

Why get Unable to verify your data submission error in Yii2? - error: unable verify info submission error create 1 public function in yii2. but, submit info not take in method, see next error images. why happen? add in head section of layout: <?= html::csrfmetatags() ?> yii2

spring aspects - Gradle AspectJ plugin issue -

spring aspects - Gradle AspectJ plugin issue - i facing major issue spring application since migrated maven gradle: aspectj no longer works. for instance classes annotated @configurable (which rely on aspectj) don't dependencies injected. in order replace aspectj-maven-plugin , tried using plugin: from spring security code base seems not compatible gradle 2.1... i tried applying solution described here: http://architects.dzone.com/articles/working-gradle-spring-aspects no avail. i curious know how people utilize gradle + spring manage leverage aspectj... can please kindly advise? gradle spring-aspects

javascript - JS If statement not working on android 4.4.2 or iphone -

javascript - JS If statement not working on android 4.4.2 or iphone - on android or on iphone else when type glass on computer works fine <script type="text/javascript"> var x = prompt("wholesale users come in in password or nail come in consumer info "," "); if(x == "glass"){ window.alert("sometext"); } else { window.alert("else"); } </script> if([x] == "glass"){ should be if(x == "glass"){ when [x] , creating array. since using == check true. === not true. and comments there %20 aka whitespace change prompt not have whitespace in it r info "," "); to r info ",""); javascript android iphone

How do we correct an error in the button "previous" in SurveyMonkey? -

How do we correct an error in the button "previous" in SurveyMonkey? - when using surveymonkey appli, button "previous" between each question has orthographical error in french. reads "pr&#233", instead of "préc." due fact copy/paste ancient survey? how can fixed? help! older versions of surveymonkey required html codes non-us characters. can come in "préc". it's simpler now, might require updating old surveys. surveymonkey

xml - Unexpected element in result of EWS FindItem with GroupBy -

xml - Unexpected element in result of EWS FindItem with GroupBy - i'm using ews (exchange web services) access info exchange 2013 test server. i'm doing using php (somewhat dated) php-ews repository: github-jamesiarmes-php-ews , newer , composer enabled version: github-deakin-php-ews i can basic calls exchange service described in wiki 'jamesiarmes', ran in troubles when tried utilize groupby method: how to: perform grouped searches using ews in exchange as can see in xml response how-to guide, <groups> element should contain 0 or more <groupitems> contain items (in case calendaritems). got test server <group> elements in stead of <groupitems> caused $response object incomplete. the code used: $request = new finditemtype(); $request->traversal = itemquerytraversaltype::shallow; $request->itemshape = new itemresponseshapetype(); $request->itemshape->baseshape = defaultshapenamestype::all_properties; // define time