Posts

Showing posts from February, 2011

javascript - SetTimeout Overlapping? -

this piece of code. image goes visible after 23 milliseconds properly, never turns hidden second line tells to. if change 17 milliseconds value greater 23 milliseconds, works. vice versa, if change first line 16 milliseconds, works. appear second line executes , completes before first line, , stays visible. how can fix that? settimeout(function(){img.style.visibility = 'visible';},23); settimeout(function(){img.style.visibility = 'hidden';},17); both of lines execute 1 right after other. then, later , functions you've passed settimeout called. they're called according delay gave. when give shorter delay second one, of course gets called first. if goal have img become visible after 23 milliseconds , invisible again 17 milliseconds later , want put second call inside first. settimeout(function(){ img.style.visibility = 'visible'; settimeout(function(){ img.style.visibility = 'hidden'; }, 17); }, 23); that ...

Use JSF, JPA, JTA, JAAS, CDI, Bean Validation with Tomcat? -

is possible use following apis tomcat (as lightweight server): jsf, jpa, jta, jaas, cdi, bean validation. yes . except of jaas . ​​​​​​​​

mysql - SQL: Get all rows with value n associated with id -

lets have following tables cart, cart_data , product: cart cart_id total_cost cart_data cart_data_id cart_id product_id product product_id product_name i'm trying select carts each product_id in cart_data must = 2 , return cart_id product_ids = 2 for example: if cart has 5 products have id = 2 cart_id should show. however, if cart has 5 products has 4 products = 2 , 1 product = 4 shouldn't show up. haven't tested should work: select cart_data.cart_id cart_data cart_data.cart_id in ( select cart_data.cart_id cart_data group cart_data.cart_id having min( cart_data.product_id ) = 2 , max( cart_data.product_id ) = 2 )

how to read and write SQLite database file in java (after making jar file) -

this question has answer here: read sqlite db file using java 2 answers i want create java application use sq lite database , after making jar file application read , write sq lite database file. how achieve this.... please give me overview how access sq lite database file , modify it. after making jar file. it simple place sqlite database file inside project folder , in program in order connect database file create connection like connection = drivermanager.getconnection("jdbc:sqlite:name of sqlite database file"); now in order connect database file after creating jar file of program place sqlite database file near created jar file... after able communicate database file(can access , modify data) application(jar file)... thanxxxx...... :)

initialization - Why doesn't Swift force my designated initializer to call super? -

this code legal in swift: class snapper : nsobject { var anim : uidynamicanimator init(referenceview:uiview) { self.anim = uidynamicanimator(referenceview:referenceview) // super.init() } } observe in initializer didn't call super.init() ; commented out line. swift compiler doesn't complain. why? thought there rule designated initializer must call designated initializer of superclass. , have superclass, namely nsobject. is bug? or having nsobject superclass special case? if so, why? realize nsobject has no instance variables need initialization, how know init doesn't other things need doing? shouldn't swift giving compile error here? it's not answer of why adding symbolic breakpoint on [nsobject init] shows gets called if super.init() commented out. it seems special case replacing nsobject other class makes compiler warn again missing super call. guess the compiler handles special case given it's our base cla...

java - Error 404 consuming Google Cloud Endpoint -

i have google cloud endpoint created android studio. i testing consume locally backend endpoint using http server , client running android studio in pc. using google cloud endpoints api explorer, can execute resource "doregister" without problem. but when try consume cloud backend in app, 404 error in http request. know can use classes generated android studio consume backend, i´d use http. i using serverurl = " http://10.0.2.2:8080/_ah/api/contactendpoint/v1/doregister "; don´t know if correct. please, me doing wrong? server backend: @apimethod(name = "doregister") public contact doregister(@named("from") string from, @named("reg_id") string reg_id) { contact contact = findrecordbyemail(from); if (contact == null) { contact = new contact(from, reg_id); try { contact = this.insertcontact(contact); } ...

java - MigLayout, aligning all components at center of JFrame -

Image
how can align components @ jpanel @ center of jframe. here codes , got i want this mainframe import javax.swing.jframe; import javax.swing.jpanel; public class mainframe extends jframe { private static mainframe instance = new mainframe(); public static mainframe getinstance() { return instance; } public static void switchtopanel(jpanel p) { getinstance().setcontentpane(p); getinstance().validate(); } private mainframe() { settitle("favmovies"); setsize(400, 400); setlocationrelativeto(null); setvisible(true); setdefaultcloseoperation(jframe.exit_on_close); } public static void main(string[] args) { mainframe.switchtopanel(new loginpanel()); } } loginpanel import javax.swing.*; import net.miginfocom.swing.miglayout; public class loginpanel extends jpanel { // properties private jtextfield inputusername; private jpasswordfield inputpassword; // constructor public loginpanel() { setsize(400,400); ...

wicket - IE10 - Atmosphere Unsubscribed when AJAX Call Made -

we integrating atmosphere our current application. works great in ie 11 , latest version of chrome. in ie 10 however, unabled receive push notifications after client makes ajax call server. we turned on atmosphere debugging, , here log in ie 10. invoking executewebsocket using url: ws://t1c.lh.com:8080/wicket/page?12-iresourcelistener.9-&x-atmosphere-tracking-id=0&x-atmosphere-framework=2.0.8-jquery&x..... websocket opened invoking 1 global callbacks: opening ....do existing ajax request..... invoking 1 global callbacks: unsubscribe websocket closed normally after unsubscribe call, client no longer receives server push events. unsubscribe call not happen in ie 11. ie 11 receives push notification without issue. any ideas on how fix? here our atmosphere setup. using tomcat 8.0.23. <servlet> <description>atmospherefilter</description> <servlet-name>atmospherefilter</servlet-name> <servlet-class>org.at...

ruby on rails - User sessions and logins -

i trying implement signup & login features on ror. on index page have created 2 links saying 'new user' , 'login' , in userscontroller have signup & login methods(updated routes accordingly). prob: upon clicking new user or login getting error saying "the action 'show' not found userscontroller" routes.rb: rails.application.routes.draw resources :users 'users/register', :to=>'users#register' 'users/signup', :to=>'users#signup' post 'users/signup', :to=>'users#signup' post 'users/login', :to=>'users#login' 'users/login', :to=>'users#login' post "users/change_password" => "users#change_password" "users/change_password" => "users#change_password" index.html.erb <%= link_to "new user", users_register_path %><br> <%= link_to "login", users_login_path %>...

php - Laravel5 illuminate composer messagebag package -

i'd install illuminate/support/messagebag can't seem find composer address this. is still available laravel5 , if so, composer details need use? if need general purpouse message package, can try this 1 here , if need flash message bag, can try this one edit: said in comments, thought needed one. messagebag there, wasn't removed. i've done fresh installation , got working. check composer.json, there's nothing rare in there, laravel: "require": { "php": ">=5.5.9", "laravel/framework": "5.1.*" }, "require-dev": { "fzaninotto/faker": "~1.4", "mockery/mockery": "0.9.*", "phpunit/phpunit": "~4.0", "phpspec/phpspec": "~2.1" }, maybe there's problem installation, should there.

c# - Encrypted Querystring in URL getting changed to lowercase in Outlook -

i providing cancel button in registration email, user can click link , cancel registration. this works fine except outlook converting links lowercase. when user clicks link, can't decrypt url because encrypted querystring lowercase , longer valid. what can prevent outlook converting links lowercase, or how can provide link url encrypted , case insensitive? summary : domain.com/cancel?qs= ylway3mdmmwmw is getting changed to: domain.com/cancel?qs= ylway3mdmmwmw which breaks ability decrypt querystring. if outlook sabotaging links, need make links case indifferent. if absolutely must keep upper , lowercase in links decryption, use marker character: generate encrypted string. before each upper case character, insert marker character (pick valid character encryption scheme not use). insert new string link. to decrypt, remove marker characters parse string , make uppercase/lowercase appropriate. here pair of helper methods if find easier readin...

link library to all targets in cmake project -

let me describe think sufficiently common use case, should supported. consider project consists of library , set of executable use library. straightforward approach add_library, followed sequence of add_executable() target_link_lib() pairs. this lot of boilerplate coding. nice able set(project_link_libs, lib1 ...), , have cmake remove boilerplate. thinking on more, realize link_libraries function behaves include_directories. argue this: would useful in lot of cases. would lead dryer cmakelists. would encourage better code organizations -- there natural incentive organize folders, code, , executables in such way executables have same dependancies -- clean practice. is there this? it appears cmake_standard_libraries variable exists, can append libraries according need. however, variable seemingly expect full path libraries. see here .

Unable to access model using cancan gem in rails -

i using spree build e-commerce application.i have created 1 model offer(spree::offer) . have created 1 role seller,and trying give seller access view,update , manage model(offer) in admin panel using following code if user.respond_to?(:has_spree_role?) , user.has_spree_role?('supplier') > can :manage,offer but when login seller,i unable see offers tab in admin panel but,when login admin ,i able see offers tab.admin has following access can :manage,:all i new rails, should prior, desired result you need define ability offer model under spree module , can access spree::offer recourse. if user.respond_to?(:has_spree_role?) , user.has_spree_role?('supplier') can :manage, spree::offer end

c# - Highlight date in WinRTXamlToolkit.Controls.Calendar -

i using winrtxamltoolkit.controls.calendar in windows 8.1 phone app , can display calendar using following code: <page... background="{themeresource applicationpagebackgroundthemebrush}" xmlns:wpcontrols="using:winrtxamltoolkit.controls"> <grid> <viewbox> <wpcontrols:calendar x:name="cal" /> </viewbox> </grid> and in .cs file set display date using following code in onnavigatedto cal.displaydate = new datetime(2015, 7, 7); but cannot highlight date , if has used control please give me advise on how set , highlight selected date? thank thanks had set following date hhighlighted: cal.selecteddate = new datetime(2015, 6, 7);

jquery - Variable as a function at the same time in JavaScript -

i want implement this. myvar.myanothervar; myvar.mymethod(); myvar("sample text"); and how jquery implemented it jquery.fn; jquery.ajax(); jquery("#mybtn"); how can implement jquery holds on single namespace? prototype? how can variable can used invoke function @ same time? thank :) functions in javascript objects, can arbitrarily add properties them other object: function foo() { // code when call `foo` goes here } foo.somedata = "bar"; foo.somefunction = function() { // code when call `foo.somefunction` goes here }; what jquery more complicated, , bit unusual, in couple of ways: the jquery function (usually aliased $ ) wrapper around call constructor function creates new object. (the constructor function called init .) they've added reference init function's prototype property in property on jquery function called fn . both properties ( jquery.fn , init.prototype ) refer object become instance's pr...

Android design support navigation drawer huge actionbar -

i implementing design support navigation drawer , got working, problem toolbar huge, extends on entire activity height. the code using: activity_main: <android.support.v4.widget.drawerlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/drawer_layout" android:layout_height="match_parent" android:layout_width="match_parent" android:fitssystemwindows="true"> <include android:id="@+id/toolbar" layout="@layout/toolbar" /> <framelayout android:id="@+id/frame_container" android:layout_width="match_parent" android:layout_height="match_parent" /> <android.support.design.widget.navigationview android:id="@+id/nav_view" android:layout_height="match_parent" android:layout_wi...

java - Extended server_name (SNI Extension) not sent with jdk1.8.0 but send with jdk1.7.0 -

i have implemented jax-ws client using apachecxf (v3.0.4) , works problem comes when want use secure connection (ssl/tls) java 8 (jdk1.8.0_25). i see following exception in log (-djavax.net.debug=all): main, handling exception: java.net.socketexception: connection reset main, send tlsv1.2 alert: fatal, description = unexpected_message main, write: tlsv1.2 alert, length = 2 main, exception sending alert: java.net.socketexception: connection reset peer: socket write error after depeer analysis have observed problem caused because java 8 server_name (sni) not sent java 7 sent , web service invocation works successfully. java 8 log (-djavax.net.debug=all): missing "extension server_name" [...] compression methods: { 0 } extension elliptic_curves, curve names: {secp256r1, sect163k1, sect163r2, secp192r1, secp224r1, sect233k1, sect233r1, sect283k1, sect283r1, secp384r1, sect409k1, sect409r1, secp521r1, sect571k1, sect571r1, secp160k1, secp160r1, secp160r2, sect1...

java ee 6 - Precedence of EJB Deployment Descriptors -

if have ejb packaged in war because exposed rest web service, according this link , need have ejb-*.xml files @ root of web-inf directory. current environment websphere 8.5 , ejb 3.1 if later add multiple ejbs ( in separate ejb projects ) in same application , define deployment descriptors in respective projects, seem ignored. appears of descriptors should defined in descriptors in web-inf directory - or in other words, seems should augment descriptors in web-inf directory ejbs defined separate projects. is how needs or missing forcing me this? not find documentation explaining part. more details: how application.xml looks like <?xml version="1.0" encoding="utf-8"?> <application xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/application_7.xsd" version="7"> ...

html - japanese character is not supported in localhost -

i have project has japanese characters in it. when run project on server (the live version) japanese characters displayed. however, same files no changes in code, if run on localhost japanese characters displaying "レストラン". files includes . , i'm using google chrome. should make support japanese characters? appreciated. add following: <meta charset="shift-jis"/> to file if use html5, or <meta http-equiv="content-type" content="text/html; charset=shift-jis" /> if use html 4.01. the reason why works on webserver because transmits http headers correct encoding. on local copy of .html , there no such headers, browser checks <meta/> tags (which missing), , if fails find these, guesses encoding, in case utf8. (if use webserver in localhost too, might misconfigured. in case, it's practice include charset information.) @ashishacharya i'm pretty sure op uses shift-jis rather utf8. page ren...

php - DOMElement nodeValue inconsistant get vs set -

i have discovered when reading nodevalue domelement returns raw value (i.e. not encoded) when set value must encode first or truncates text @ first invalid entity. <?php $doc = new domdocument('1.0', 'utf-8'); $element_p = $doc->createelement('p'); // domelement $element_p->nodevalue = 'this & that.'); print($element_p->nodevalue); // 'this ' $element_p->nodevalue = 'this &amp; that.'); print($element_p->nodevalue); // 'this & that.' // setting truncates text! $element_p->nodevalue = $element_p->nodevalue; print($element_p->nodevalue); // 'this ' // encode before setting, don't decode after getting $element_p->nodevalue = htmlspecialchars('this & that.'); print($element_p->nodevalue); // 'this & that.' // using htmlspecialchars() preserves original text $element_p->nodevalue = htmlspecialchars($element_p->nodevalue); print($element_p-...

html - jqxListBox doesn't fit its container -

Image
i'm making small website uses jqxlistbox display list of item. actually, default, doesn't auto resize fit container. container's inner height , set jqxlistbox, don't know why jqxlistbox gets larger container. here code : var wordselectionheight = $("#wordselectionarea").innerheight(); $("#lstwords").jqxlistbox({ height:wordselectionheight}); ->wordselectionarea div, size 500px (this size not fixed). ->lstwords jqxlistbox. and result: scrollbars still appears. can me please ? thank you. p/s: if needs see code, here : <html> <head> <link rel="stylesheet" type="text/css" href="css/general.css"> <link rel="stylesheet" type="text/css" href="css/special_box.css"> <link rel="stylesheet" type="text/css" href="lib/jqwidgets/styles/jqx.base.css"> <script type="text/javascript" src=...

Create plan on stripe through laravel -

i want create plan application on stripe. scenario users charged different prices recurring payments. so, why want create plan each user. i using laravel 5 , using "laravel/cashier": "~5.0" laravel/cashier doesn't have functionality baked in. aren't out of luck though easy use stripe's api should downloaded dependency in vendor folder. if not can download composer. composer require stripe/stripe-php 2.* you can use with use \stripe\plan; plan::create(array( "amount" => 2000, "interval" => "month", "name" => "amazing gold plan", "currency" => "usd", "id" => "gold") ); you can read more here - https://stripe.com/docs/api#create_plan

javascript - AngularJS filtering by code -

i'm working angularjs. how can search code ? current implementation searches ever type: id , name, city, code... how can search code? app.js: var app = angular.module('stack', []); app.directive('filterlist', function ($timeout) { return { link: function (scope, element, attrs) { var td = array.prototype.slice.call(element[0].children); function filterby(value) { td.foreach(function (el) { el.classname = el.textcontent.tolowercase().indexof(value.tolowercase()) !== -1 ? '' : 'ng-hide'; }); } scope.$watch(attrs.filterlist, function (newval, oldval) { if (newval !== oldval) { filterby(newval); } }); } }; }); example on jsfiddle var app = angular.module('stack', []); app.directive('filterlist', function ($timeout) { ...

c# - code structure for streamWrite -

is there better way me streamwrite without needing repeat code every button press? below example working on 1 button it's own thing , writes accordingly vowels , other same thing except writes accordingly no alpha characters: private void btnvowels_click(object sender, eventargs e) { string wholetext = ""; string copytext = richtextbox1.text; if (system.io.file.exists(second_file) == true) { system.io.streamwriter objwriter; objwriter = new system.io.streamwriter(second_file); string vowels = "aaeeiioouu"; copytext = new string(copytext.where(c => !vowels.contains(c)).toarray()); wholetext = richtextbox1.text + copytext; objwriter.write(wholetext); richtextbox2.text = wholetext; objwriter.close(); } else { me...

ios - Apple Beta Review Process -

i want distribute app 100 people before open public. i'm planning submit app beta review process , there buttons in application still not functional. we in beta , it's important 100 people see features in bucket list. questions if place buttons in screen , submit beta review, apple reject application ? i know reject if submit app store same beta review ? cheers apple not care button, while you're in beta process, should add note under beta review information , tell them buttons. when you're sending review process app store, reject. hope it's helps.

visual studio 2005 - ASP.NET Development Server Failed to start on port -

Image
i have created website in visual studio 2005. when run shows following 2 error. i have googled got lost of suggestions not working.i had set specific port , opened in firewall getting same error. , other projects in visual studio 2010 working fine. make sure port not in use: open command prompt , type netstat -a if in use, find using it. run vs admin. also check iis not bound port , check user tray see if vs using local iis webserver on port. little yellow icon kind of looks web page, right click , click close. try restarting pc , see if problem goes away.

html - CSS: background image with gradient "overlay" -

Image
first, wanna accomplish: i want background: http://codepen.io/anon/pen/mjwyye with similar gradient 1 on image: (image' source) now, problems tackle: i'd gradient's center 100% transparent. i'll have text , other things @ center of page, in other words want no gradient color "blocking" center of page. i'd gradient "overlay" cover whole page, instead of each repeat of image i tried many different ways place gradient on background image, worked without results wanted. 1 worked places gradient on image, per every {image} repeat. this last try won't work. not mention, failing replicate gradient on sample image provided: body { background: url('http://www.juvera.me/_img/vista.png') center center repeat, radial-gradient(ellipse @ center, rgba(181,189,200,1) 0%,rgba(130,140,149,1) 50%,rgba(40,52,59,1) 100%); /* w3c */ opacity: .8; } it better set different properties 1 one, it's easier chec...

json - Mule Server 3.6 > Anypoint Studio > Data Extraction -

how can extract information against json data, when have sessionvars.filters containing: ["account", "billing"] ...where json data contains: { "billing": { "billnumber": 25, "billperiod": "06 dec 14 - 05 jan 15", "accountnumber": 78781843, "previousbalance": 0.00, "currentbalance": 1237.49, "duedate": "jan 26, 2015", "totalamountdue": 1237.49, "previousbalance": 0.00, "currentbalance": 1237.49, "duedate": "jan 26, 2015", "totalamountdue": "1237.49" }, "product": ["hilly"], "account": { "name": "lee g. ive", "address": "214 maya st., g2 village highlands city, somewhere 1630" }, "content": { ...

html - Avoid white vertical line on the left side of mobile version -

Image
the mobile version of website displays annoyed white vertical line on left side (see below). to see on desktop computer, used google chrome, open console (f12) click on mobile icon on left side. thanks !! see here (on mobile) : http://azurconsult.wix.com/test1 there unintentional margin pushing over. best thing pull smaller hunks of html render , repeat untill line goes away know start repairs. first @ margins , padding. please post code.

javascript - Changing image src & href path -

i want change multiple images path there wrong whit this. can me figure out pls. code working thumbnail images , href path appears in same image source (01_sml.jpg) & (picture1.jpg). js -- $img = $('#adv1 li img'); $img.attr('src', $img.attr('src').replace("img/","img/_advertorial/00/") ); $img = $('#adv1 li a'); $img.attr('href', $img.attr('href').replace("img/","img/_advertorial/00/") ); html -- <ul class="thumbs" id="adv1"> <li><a class="venobox" data-gall="mygallery" href="img/picture1.jpg"><img src="img/01_sml.jpg" /></a></li> <li><a class="venobox" data-gall="mygallery" href="img/picture2.jpg"><img src="img/02_sml.jpg" /></a></li> <li><a class="venobox" data-gall="mygallery"...

node.js - Why datastax/nodejs-driver is slow? -

it takes 20 seconds response simple select query using nodejs driver. cqlsh takes less 1 second. enabled logging on connection , shows lot of connection events below select * developer username=? 2015-06-13t05:48:39.635z log event: info -- "controlconnection" 2015-06-13t05:48:39.635z log event: info -- "controlconnection" 2015-06-13t05:48:39.637z log event: info -- "connection" 2015-06-13t05:48:44.641z log event: warning -- "connection" 2015-06-13t05:48:44.641z log event: info -- "connection" 2015-06-13t05:48:49.646z log event: warning -- "connection" 2015-06-13t05:48:49.647z log event: info -- "connection" 2015-06-13t05:48:49.647z log event: verbose -- "connection" 2015-06-13t05:48:49.648z log event: verbose -- "connection" 2015-06-13t05:48:49.648z log event: verbose -- "connection" 2015-06-13t05:48:49.651z log event: verbose -- "connection" 2015-06-13t05:48:49.651z l...

python - Access local server on AWS ubuntu machine image -

i have created local server @ 0.0.0.0:8000 on ubuntu virtual machine on aws following command python -m simplehttpserver this gave me following response serving http on 0.0.0.0 port 8000 ... how can access server browser? if on host running web server, go to: http://localhost:8000 if on computer, access host via ip address: http://ip-address:8000 (eg http://54.22.18.93:8000 ) if accessing computer, security group need allow inbound access on port 8000.

How to use/implement this Chef recipe? -

i new chef, trying use chef recipe: https://gist.github.com/kardeiz/7273938 i thought needed create new cookbook , put recipe default.rb, , .erb templates/default, when try use cookbook ("dcpromote") in chef-client, getting error: compiling cookbooks... ================================================================================ recipe compile error in c:/chef/cache/cookbooks/dcpromote/recipes/default.rb ================================================================================ nameerror --------- uninitialized constant windows::helper cookbook trace: --------------- c:/chef/cache/cookbooks/dcpromote/recipes/default.rb:8:in `from_file' can tell me why getting compile error , how eliminate it? thanks, jim looks need depend on windows cookbook https://supermarket.chef.io/cookbooks/windows / github: https://github.com/opscode-cookbooks/windows . try adding following cookbook's metadata.rb depends 'windows'

caching - Infinispan remote cache access -

i newbie infinispan , learning experimenting. need after failed trying access remote cache of different name. here scenario of infinispan client-server mode not embedded. 1) started node1 in infinispan cluster , set default remote cache name node1_cache. --hotrod server started 2) started node2 in infinispan cluster , set default remote cache name node2_cache. --hotrod server started now in hotrod client can see remotecachemanager can initialize , cluster being setup , nodes getting added each other in console. but problem 1 single client 1)when trying remotecache using name node1_cache, getting instance. 2) when try access node2_cache, giving me null remotecache instance. now correct in accessing such way or missing in ? is not single client can access caches of node configured across cluster ? please guide me. thank you. after amount of digging concepts of distributed cache, figured out following concept. 1) using 2 cluster-configuration files 2 infi...

sql - Using if else block in pivot query -

i have table studentid studentname subject marks 1 savita ec1 50 1 savita ec2 55 1 savita ec3 45 1 savita ec4 34 1 savita ec5 23 2 rajesh ec1 34 2 rajesh ec2 56 2 rajesh ec3 12 2 rajesh ec4 45 2 rajesh ec5 23 3 smita ec1 76 3 smita ec2 45 3 smita ec3 67 3 smita ec4 56 3 smita ec5 76 4 rahul ec1 66 4 rahul ec2 34 4 rahul ec3 22 4 rahul ec4 18 4 rahul ec5 33 i wrote query like select studentname, ec1,ec2,ec3,ec4,ec5,totalmarks, case when ec1<30 , ec2<30 'fail' when ec1<30 , ec3<30 'fail' when ec1<30 , ec4<30 'fail' when ec1<30 , ec5<30 'fail' when ec2<30 , ec3<3...

Spring AOP what is not jointpoint -

i need information spring aop jointpoint. have read below in stackoverflow explains difference between jointpoint , pointcut. per joint "a joinpoint candidate point in execution of application aspect can plugged in. point method being called, exception being thrown, or field being modified. these points aspect’s code can inserted normal flow of application add new behavior." after reading me looks every method , field in class jointpoint. there couldn't jointput , hence advice couldn't applied. spring aop: what's difference between joinpoint , pointcut? as difference between 'jointpoint' , 'pointcut' you're right far. jointpoint every spot in code aspect might woven in, whereas pointcut matches concrete aspect definition.acoording spring documentation, every method of bean defined pointcut. consider using spring aop definition of pointcuts limited method calls. if you're searching supports more sophisticated aop logic, ma...

ruby on rails - How to get model with relation as hash? -

i want hash representation of post model posts's related comments included array of hashes. my models: class post < activerecord::base has_many :comments end class comment < activerecord::base belongs_to :post end so output should this: { "id": 3, "body": "this post", "comments": [ { "id": 1, "post_id": 3, "body": "this comment", } ] } things have tried (that return post, not related comments: post.includes(:comments).as_json post.eager_load(:comments).as_json you can try following: post.as_json(include: :comments)

c++ - C++11: template parameter redefines default argument -

when compiling following source code gcc there no errors / warnings: template< typename t = int > t func( ); template< typename t = int > t func( ); when compile same source code clang++, got following error: redeftempparam.cc:2:24: error: template parameter redefines default argument template< typename t = int > t func( ); ^ redeftempparam.cc:1:24: note: previous default template argument defined here template< typename t = int > t func( ); ^ 1 error generated. command compile [clang++|g++] -wall -werror -std=c++11 redeftempparam.cc (version information: gcc 4.7.2, clang version 3.3 (trunk 171722)) my question: is type of redefinition allowed? if not: can please point me appropriate point in c++ standard? §14.1.12: a template-parameter shall not given default arguments 2 different declarations in same scope. [example: template<class t = int> class x; template<class...

javascript - redirect image file get requests express 4.x and handlebars -

i have following routes: index.js: router.get('/', function(req, res, next) { var flag = "true"; var hflag = "true"; res.render('index',{title:"my blog",header: hflag, login: flag, categories:blogengine.getblogentries()}); }); router.get('/article/:id', function(req, res) { var entry = blogengine.getblogentry(req.params.id); var img = entry.img; res.render('article',{title:entry.title, gedjit:entry}); res.redirect(img); }); in '/' route, load list of images public static file folder 'images'. works fine until click on 1 of images. want show clicked image in new page. here handlebars file; article.hbs: <h1>{{gedjit.title}}</h1> <div class="gedjit"> <img class="img" src="{{gedjit.img}}"> </div> <br> <p>description: {{gedjit.description}}</p> the problem handlebars sending "localhost/ar...

c# - Way to have a class Schedule behaving like List<DateTime>? -

this question has answer here: overloading assignment operator in c# 3 answers i have: public class schedule { public list<datetime> dates {get; set;} // methods } i'd schedule behave list: var date = schedule[idx]; dates = list<datetime>; schedule = dates; dates = schedule; ... schedule should list of dates in reality, adding member dates, feels computer object, adding layer of abstraction , moving away modeled object. there 2 possibilities not perfect: overloading operators (e.g. "[]") "="can't overloaded. alias "using" won't have method. for example, in c++, have overloaded operators , keep private member _dates. thanks if schedule is list of dates, make one: public class schedule : list<datetime> { // more stuff } schedule myschedule = new schedule(); myschedule.ad...

ios - Button stays selected after UIScrollView swipe event -

i trying fix problem ran while implementing uiscrollview . when button being pressed , scrolled simultaneously, button becomes "stuck" (it pretty remains in selected state , can't interacted anymore. problem: http://makeagif.com/zjtj5p what tried far: disabling , reenabling uiscrollview inside @ibaction function, self.scrollview.userinteractionenabled = false , user not scroll, when button being tapped (i guess it's wrong approach , since buttons connected "touch inside" event , @ stage it's them react self.scrollview.userinteractionenabled = false disabling buttons when swipe gesture recognized. used scrollviewdidscroll method, way buttons can't pressed @ all. i believe need create method "touch drag exit" of uibuttons, , disable uiscrollview when "touch drag exit" recognized. best approach?

osx - JSFiddle CSS and Result text areas squeezed -

Image
i using chrome on osx , have encountered infuriating bug makes jsfiddle unusable: as screenshot shows css , result text areas squeezed off screen no handle pull them back. how can make them visible , usable? it hasn't rendered this, i'm not sure has caused it. what i've tried disabling chrome extensions resizing browser ridiculous width clearing local, session , cookie storage jsfiddle on chrome removing secondary screens changing screen resolution none of have changed anything. update the bug not replicated when using safari.

javascript - Where does this extra space come from? -

Image
as seen in picture(i put code in try , make little easier). website scrolled sideways (which shouldn't happen) , body in blue outline there scrollable space @ right hand side. as can see in css can hide "extra" space using overflow-x: hidden; it's not enough because if use float: right; on element, while using overflow-x: hidden; , float: right; element off edge of screen. my question "extra" space coming from? <!doctype html> <html> <head> <meta charset="utf-8"> <title>test site</title> <meta name="viewport" content="width=device-width, initial-width=1, user-scalable=0"> <link rel="stylesheet" type="text/css" href="assets/css/style.css"> <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css"> <link rel="stylesheet" href="http...

xml - attribute Android: name is not allowed here -

Image
i using intellij idea, have problem why when copy project folder result this? have attribute android: name not allowed here if copy old project new project 100% same source different this. how fix it?

How do I include variable between {} brackets in a php preg_match? -

so have php code preg_match('/^([^.!?]*[\.!?]+){0,**3**}/', $text, $abstract); instead of number 3 variable example > preg_match('/^([^.!?]*[\.!?]+){0,**$variable**}/', $text, $abstract); please lot :) use double quotes instead of single quotes, , variable substituted: preg_match("/^([^.!?]*[\.!?]+){0,$variable}/", $text, $abstract);

java - How to get Icon of Google Maps marker? -

with marker.gettitle() title of marker, how can ask icon? want ask if icon of marker set drawable , if something. well can create marker new markeroptions() this: map.addmarker(new markeroptions() .icon(bitmapdescriptorfactory.fromresource(r.drawable.house_flag)) .anchor(0.0f, 1.0f) // anchors marker on bottom left .position(new latlng(41.889, -87.622))); so can store data in linked list or hash map

python 2.7 - Reshaping Pandas data frame (a complex case!) -

i want reshape following data frame: index id numbers 1111 5 58.99 2222 5 75.65 1000 4 66.54 11 4 60.33 143 4 62.31 145 51 30.2 1 7 61.28 the reshaped data frame should following: id 1 2 3 5 58.99 75.65 nan 4 66.54 60.33 62.31 51 30.2 nan nan 7 61.28 nan nan i use following code this. import pandas pd dtframe = pd.read_csv("data.csv") ids = dtframe['id'].unique() temp = dtframe.groupby(['id']) temp2 = {} in ids: temp2[i]= temp.get_group(i).reset_index()['numbers'] dtframe = pd.dataframe.from_dict(temp2) dtframe = dtframe.t although above code solve problem there more simple way achieve this. tried pivot table not solve problem perhaps requires have same number of element in each group. or may there way not aware of, please share thoughts it. in [69]: df.groupby(df['id'])['numbers'].appl...

c# - .Net MVC 4 using Windows Authentication - redirect unauthorized user -

i have mvc 4 intranet app created using visual studio 2012. used windowsauthentication , authenticates users expected. on actions restricted users roles using authorize attribute. when user clicks on link invokes controller action user has no authorization pops 'authentication required' dialogue. when login account has no authorization keeps on popping dialogue. instead this: when user not authorized access page, pop dialogue doing. when user inputs login valid not authorized access page redirect page saying access forbidden. how go doing this? relevant information customized role provider using approach discussed here for need custom authorization handle unauthorized situations yourself. you need method this: [attributeusage(attributetargets.class | attributetargets.method, inherited = true, allowmultiple = true)] public class authorizeattribute : system.web.mvc.authorizeattribute { protected override void handleunauthorizedrequest(system.web.mvc.a...

javascript - How to send data from input to service? -

i have problem sending data form input service. example have input: <input type="text" class="form-control" placeholder="city name..."> <span class="input-group-btn"> <button class="btn btn-default" type="button">go!</button> </span> and service geting data rest api: app.factory('forecast', ['$http', function($http) { return $http.get('http://api.openweathermap.org/data/2.5/forecast/city?q=warsaw&units=metric&mo') .success(function(data) { return data; }) .error(function(err) { return err; }); }]); how can send city name input after clicking button "go" construct own api link ? , display data in view ? mean http://api.openweathermap.org/data/2.5/forecast/city?q=value_from_the_input&units=metric&mo you should assign input ng-model direct...