Posts

Showing posts from August, 2015

c# - Missing type Microsoft.CSharp.RuntimeBinder.Binder -

my project won't build because of following error: predefined type 'microsoft.csharp.runtimebinder.binder' not defined or imported. what reference need add? thank alex. add reference microsoft.csharp .

php - Laravel 5 Class 'Illuminate\Support\Facades\FormFacade' not found -

ok, driving me mad. i'm trying include forms functionalities formfacade laravel 5, keep getting error: class 'illuminate\support\facades\formfacade' not found i'll write down have done: after laravel 5 installation, added formfacade laravel. updated app.php file following lines: providers: 'illuminate\html\htmlserviceprovider', aliases: 'form' => 'illuminate\support\facades\formfacade', 'html' => 'illuminate\support\facades\htmlfacade', then, checked composer.json file: "require": { "laravel/framework": "5.0.*", "illuminate/html": "~5.0" }, did composer update checked if downloaded files all of done, still cannot find whats going wrong. searched nothing seems work. search effort: laracasts tutorial class 'illuminate\html\htmlserviceprovider' not found laravel 5 http://tutsnare.com/class-form-or-html-not-found-in-laravel-5/

angularjs - MEAN stack user delete -

i've got users list delete button on /users url. delete route looks this: app.route('/users/:userid') .get(users.read) .put(users.updatebyid) .delete(users.delete); app.param('userid', users.userbyid); but problem is, delete button calling delete on /users url, i'm getting delete http://localhost:3000/users 404 (not found) . how can solve problem? controller remove() function can see below. how can pass '/user/' + user._id it? user removed correctly scope :( $scope.remove = function(id) { var user = $scope.users[id]; var modaloptions = { closebuttontext: 'cancel', actionbuttontext: 'delete user', headertext: 'delete ' + user.displayname + '?', bodytext: 'are sure want delete user?' }; modalservice.showmodal({}, modaloptions).then(function() { if (user) { user.$remove(); (var in $scope.users) {

javascript - how do i automatically adjust the height of a tab to fit content -

i tab adjust height of content within when calender pops within tab. here code. thanks! <script> $(function(){ $( "#accordion-1" ).accordion({collapsible: true, heightstyle: "content"}); $("#enable").click(function(){ $("#accordion-1").accordion("option", "disabled", false); $("#accordion-1").accordion("option", "active", 2); }); $("#disable").click(function(){ $("#accordion-1").accordion("option", "disabled", true); }); }); $(function() { $( "#datepicker-1" ).datepicker(); }); $(function() { $( "#datepicker-2" ).datepicker(); }); </script> <div id="accordion-1" > <h3>tab 1</h3> <div> departure city: <input id="dep"></input> arrival city: <input id="arr"></input> </div&g

java - Can't find a class using Class.forName() -

Image
this "test-addon" and i'm trying load "main class" using: class<?> jarclass; try { classloader cls = classloader.getsystemclassloader(); jarclass = cls.loadclass("main.addon"); } catch (classnotfoundexception e) { throw new invalidpluginexception("\"addon class\" not found", e); } as can see in image, class exists, still returns: line 21: jarclass = cls.loadclass("main.addon"); question: why happen the jar or directory contains main.addon isn't on classpath. try addon (no package specifier). in maven-style projects, src/main root (default) package.

java - Trust not trusted certificates and skip hostname verification -

i have server witch running https web server. when enter browser errors domain not match (because use ip of server) , cerificate not trusted. need send requests server using apache httpclient 4.2.1. found piece of code online helps me: httpclient = new defaulthttpclient(a, b); sslsocketfactory sslsocketfactory = new sslsocketfactory( new truststrategy() { @override public boolean istrusted(x509certificate[] arg0, string arg1) throws certificateexception { return true; } }, sslsocketfactory.allow_all_hostname_verifier); httpclient.getconnectionmanager().getschemeregistry().register(new scheme("https", 443, sslsocketfactory)); because dont understand code ask questions. 1) understand correctly first parameter of sslsocetfactory bypass "not trusted" part of certificate problem? returns every certificate trusted? 2) second parameter needed because cerifica

knockout.js - Set viewModel = $data for Component -

i'm starting head around knockout components. right i'm trying create "template only" component. issue ran getting viewmodel of component set $data of i'm using component. i've modified example knockout page ( http://knockoutjs.com/documentation/component-overview.html ) here's plunk shows i've done: http://plnkr.co/edit/23pvew9aq63a9yq2wrjp i'm using component in foreach like: <ul data-bind="foreach: products"> <li class="product"> <strong data-bind="text: name"></strong> <div data-bind="component: { name: 'like-widget', params: {data: $data}}"></div> </li> </ul> here's component: ko.components.register('like-widget', { viewmodel: function(params) { // data: value either null, 'like', or 'dislike' this.data = params.data; // behaviors this.like = function() { t

javascript - AngularJS: No "Access-Control-Allow-Origin" header is present on the requested resource -

this question has answer here: why javascript “no 'access-control-allow-origin' header present on requested resource” error when postman not? 33 answers i'm writting webapp , i'm using angularjs. in app have created file called script.js , report code: var modulo = angular.module('progetto', ['ngroute']); // configure our routes modulo.config(function ($routeprovider, $httpprovider) { $routeprovider // route home page .when('/', { templateurl: 'listafilm.html', controller: 'listacontroller' }) // route description page .when('/:phonename', { templateurl: 'description.html', controller: 'descriptioncontroller' }); $httppr

html - div with same margin top and bottom (no %) -

all want have small black line on left of screen borders top , bottom 30px. it's pretty if use % won't have 30 px on top , bottom. #border-right { right:0; width: 71px; height: 94%; top: 3%; bottom: 3%; position:fixed; background:rgba(255,255,255,.9); border-left:2px solid black; z-index:1; } here's i'm stuck — https://jsfiddle.net/9o3t5u2d/ thanks! f. you can set top , bottom offsets 30px, no math required. i not sure why need width , background color, can add needed. #border-right { position: fixed; z-index: 1; right: 0; top: 30px; bottom: 30px; box-sizing: border-box; border-right: 2px solid black; width: 30px; /* not sure if need this... */ background: rgba(125, 125, 125, .5); /* not sure if need this... */ } <div id="border-right"></div>

hadoop - How can I read from one HBase instance but write to another? -

currently have 2 hbase tables (lets call them tablea , tableb ). using single stage mapreduce job data in tablea read processed , saved tableb . both tables reside on same hbase cluster. however, need relocate tableb on cluster. is possible configure single stage map reduce job in hadoop read , write separate instances of hbase? it possible, hbase's copytable mapreduce job using tablemapreduceutil.inittablereducerjob() allows set alternative quorumaddress in case need write remote clusters: public static void inittablereducerjob(string table, class<? extends tablereducer> reducer, org.apache.hadoop.mapreduce.job job, class partitioner, string quorumaddress, string serverclass, string serverimpl) quorumaddress - distant cluster write to; default null output cluster designated in hbase-site.xml. set string zookeeper ensemble of alternate remote cluster when have reduce write cluster other default; e.g. copying tables between clusters, source

c# - DataContext to DataGrid in user control -

i have main window tabcontrol. adding new tabitem user control content. in xaml: <grid><datagrid datacontext="{binding path=patients, mode=twoway}"> <datagrid.columns> <datagridtextcolumn header="id" width="auto" binding="{binding id}"/> in code behind: opening context, var query = pp in context.patients select pp; var patients = query.tolist(); tabitem patientsview = new tabitem(); // adding new tabitem stackpanel header = new stackpanel header.children.add(new textblock {text="patients"}); patientsview.header = header; patientsview.content = new viewdatapatients{datacontext = patients}; it refuses populate bind data grid. idea doing wrong? can't understand why need such approach, still. you've set datacontext of usercontrol patiense, datagrid alreay have data context, enought

Getting Super Confused with User associations in Rails -

i teaching myself rails , project working on auction site. user can either seller or bidder. when tried associations, can seller's information show not bidder's. have , still can't figure out. appreciated. https://github.com/sgrzona/ebay auction.rb class auction < activerecord::base belongs_to :seller, class_name: 'user', foreign_key: :user_id has_many :auction_bids belongs_to :bidder, class_name: 'user' auction_bid.rb class auctionbid < activerecord::base belongs_to :bidder, :class_name => 'user', :foreign_key => 'bidder_id' has_one :seller, :class_name => 'user' belongs_to :auction user.rb class user < activerecord::base devise :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable has_many :auctions has_many :auction_bids auction_bids_controller.rb class auctionbidscontroller < applicationcontroller before_filter :authent

android - Provide method dependendies -

in documentation says @provides methods may have dependencies on own, like: @provides pump providepump(thermosiphon pump) { return pump; } what change if write that: @provides pump providepump() { return new thermosiphon(); } and in first snipped: method pump from? the documentation shows thermosiphon class: class thermosiphon implements pump { private final heater heater; @inject thermosiphon(heater heater) { this.heater = heater; } ... } the constructor of class annotated @inject . lets dagger know use constructor whenever thermosiphon necessary, , automatically supplies heater instance it, don't have to. it fine create new thermospihon instance yourself, dagger saves trouble doing this. example, need heater reference somewhere if manually. dagger about, don't have tedious repetitive work.

hibernate - database not updated using JPA and spring when new entries are made -

i configuring simple jpa application using spring framework. goal populate db data during junit test runs. understand not ideal. want different purposes. here persistence.xml <persistence xmlns="http://java.sun.com/xml/ns/persistence" version="1.0"> <persistence-unit name="tothought-tutorial-test" transaction-type="resource_local"> <provider>org.hibernate.ejb.hibernatepersistence</provider> <properties> <!-- <property name="hibernate.dialect" value="org.hibernate.dialect.h2dialect" /> <property name="hibernate.hbm2ddl.auto" value="create-drop" /> --> <property name="hibernate.dialect" value="org.hibernate.dialect.mysql5dialect" /> <property name="hibernate.hbm2ddl.auto" value="update" /> <property name="hibernate.sh

python - Matplotlib Pyplot logo/image in Plot -

Image
i'm struggling achieve simple goal in matplotlib... want put small logo or indicator in bottom right of graph, without altering axis or real data being displayed. here code now: fig = plt.figure() plt.rcparams.update({'font.size': 15}) img = plt.imread('./path/to/image.png') ax1 = fig.add_subplot(111) ax1.yaxis.tick_left() ax1.tick_params(axis='y', colors='black', labelsize=15) ax1.tick_params(axis='x', colors='black', labelsize=15) plt.grid(b=true, which='major', color='#d3d3d3', linestyle='-') plt.scatter([1,2,3,4,5],[5,4,3,2,1], alpha=1.0) plt.autoscale(enable=true, axis=u'both') fig.savefig('figure.png') my output below. this laying photo on whole graph -- i'd scaled 20% of width & height (if possible) , anchored bottom right. ruins axis, because in output should in 0-100 range on both x & y. ideas solve this, scaling big issue. edit1: i've tried solution bel

webrtc - can access webcam but cannot display it into div -

this simple script use: <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <style> #myvideo { background-color:#ccc; position:absolute; width:320px; height:240px; border:1px solid #000; } </style> <script src="//code.jquery.com/jquery-1.10.2.js"></script> </head> <body> <div id="myvideo" autoplay></div> <script> navigator.getusermedia = navigator.getusermedia || navigator.webkitgetusermedia || navigator.mozgetusermedia; navigator.getusermedia({audio: true, video: true}, function(stream){ $('#myvideo').prop('src', url.createobjecturl(stream)); }, function(){ alert("error"); }); </script> </body> </html> i have no error @ all. asks me authorize webcam access, accept, webcam switches on, #myvideo div remains blank. what doing wrong?

Program freeze when calling Server method in Java -

i have basic gui in java there jbutton ,i have given functionality start server button. when click button program freezes. because of while loop ? if how can overcome this? server code void connect_clients() { try { serversocket listener = new serversocket(7700); try { while (true) { socket socket = listener.accept(); try { printwriter out = new printwriter(socket.getoutputstream(), true); out.println(new date().tostring()); } { socket.close(); } } } { listener.close(); } } catch (ioexception ex) { logger.getlogger(test_frame.class.getname()).log(level.severe, null, ex); } } your program freezing because blocking ui thread. need post on separate thread: public void postlisten() { new thread(n

Web API JSON string result contains double quotes around value for dynamic object -

my controller follows... public ihttpactionresult getdata() { ienumerable<dynamic> result = api.getdata(); string json = jsonconvert.serializeobject(result); return ok(json); } returns raw text fiddler {"@odata.context":" https://localhost:44305/api/ $metadata#edm.string","value":"[\r\n {\r\n \"username\": \"test@gmail.com\"\r\n }\r\n]" you notice json object value has double quotes around , special characters \r\n. how return pure json format??? i not getting more details code have tried way. there specific reason use serialized object? [system.web.http.httpget] public ienumerable<xyz> getdata() { return api.getdata(); } hope helps!!!

windows - Execute a Program and send key commands while the computer is locked/not sign in via VB Script -

Image
im looking workaround/solution problem below. i have program launching , sending key commands via vbscript so: set wshshell = wscript.createobject ("wscript.shell") wshshell.run "c:\images\employee-copyblob2file.exe", 1 wscript.sleep 500 wshshell.sendkeys "%c" wscript.sleep 30000 wshshell.sendkeys "%x" it works great, problem need run, or this, while computer locked or not signed in (it on) normally use command line pass program parameters/arguments, program in question not have options built in. the way can figure out automate doing script above, need work while computer locked. would appreciate help, stuck. (i open method can think of @ point) this on windows computer, linux/bash stuff out. to more specific, need open program in screen shot, select copy blob file (hence %c) , when finished (the time delay) exit (%x)

java - How to print a line based on user input and randomly selected choices -

i'm working on code first ever java class. rock paper scissors (lizard spock). program runs allowing input , outputting random choice computer. however, i'd program "its @ tie" or "you win" when situation right. far, haven't been able this. had "its tie" wrong situation once, , once without being able replicate it. code is: import java.util.*; class rock { public static void main( string args[ ] ) { system.out.println( "rock, paper, scissors, lizard, or spock?" ); scanner user_input = new scanner ( system.in ); string guess; guess = user_input.next( ); string [ ] comp; comp = new string [ 5 ]; comp[ 0 ] = "rock"; comp[ 1 ] = "paper"; comp[ 2 ] = "scissors"; comp[ 3 ] = "lizard"; comp[ 4 ] = "spock"; random hi; hi = new random( ); system.out.println( "::" + guess +

.net - user.identity.getuserid = null but username works -

i days solve problem. user.identity.name or user.identity.username got right value after login. but when want know userid null. everything works fine can login can see username user.identity.name when want see userid null knows whats problem ? my user class gebruiker == user { [datacontract] public partial class gebruiker { [datamember] [key] [databasegenerated(databasegeneratedoption.identity)] // public short gebruikerid { get; set; } public int gebruikerid { get; set; } // [foreignkey("role")] // public long roleid { get; set; } // [foreignkey("klanten")] // public long klantid { get; set; } [datamember] [required(errormessage = "gebruikersnaam vereist")] [remote("doesusernameexist", "gebruiker", httpmethod = "post", errormessage = "gebruiker bestaat alreeds")] public strin

hibernate - Fetching global values from database on application startup in Spring boot -

i'm writing spring boot / jpa application. have values needs visible entire application , these values located in database. should fetch these values? should fetch them in class containing @springbootapplication ? and how make visible application? read spring, can use @bean class hold global variables. have map @entity class bean class , autowire bean class ever want? i'm new spring / jpa, apologize if question basic. thanks. make bean instantiated applicationcontext, , use init-method run code after it's instantiated. a off top of head solution: in applicationcontext.xml: <bean class="com.example.dbconfigloader" init-method="init"> a class load config entity @ startup: public class dbconfigloader { @autowired private dbconfigrepository repository; private dbconfig dbconfig; public void init(){ dbconfig = repository.findone(1l); } public dbconfig getdbconfig() { return dbconfi

how to connect android application and openstack cloud? -

i have setup openstack cloud , able upload/download files through browser (logging through "horizon" dashboard) of android device, want build android app directly connect , transact cloud. there apis? method can take? please revert back. solution helpful. thank in advance. there multiple ways connect api. every openstack instance has accessible rest api allows make http requests. openstack rest api there numerous sdk's connect api programmatically: see here

osx - Adding the WebView to NSPopover doesn't show the WebView, just the NSView -

Image
in appdelegate init() have popover = nspopover() popover.behavior = .transient popover.contentviewcontroller = contentviewcontroller() now in contentviewcontroller : nsviewcontroller override func loadview() { view = nsview() view.translatesautoresizingmaskintoconstraints = false view.addconstraint(nslayoutconstraint( item: view, attribute: .width, relatedby: .equal, toitem: nil, attribute: .notanattribute, multiplier: 1.0, constant: 580)) view.addconstraint(nslayoutconstraint( item: view, attribute: .height, relatedby: .equal, toitem: nil, attribute: .notanattribute, multiplier: 1.0, constant: 425)) nsuserdefaults.standarduserdefaults().registerdefaults(["useragent": "tick mac app"]) let url = nsurl(string: tickextensionurl )! var request = nsurlrequest(url: url) var webview = webview(frame: view.bounds) webview.mainframe.loadreq

Neo4j: Find set of nodes that all nodes point to -

to more precise, suppose have people , animal nodes, , :likes relationship person animal . question is: how can find animal s all people like? example: (person {name: "jake"})-[:likes]->(animal {name: "dog"}) (person {name: "maya"})-[:likes]->(animal {name: "dog"}) (person {name: "maya"})-[:likes]->(animal {name: "snake"}) (person {name: "jake"})-[:likes]->(animal {name: "cat"}) if jake , maya universe of people, set of animals both jake , maya contains dogs. with example dataset: create (jake:person {name:'jake'}), (maya:person {name:'maya'}), (dog:animal {name:'dog'}), (snake:animal {name:'snake'}), (cat:animal {name:'cat'}), (jake)-[:likes]->(dog), (jake)-[:likes]->(cat), (maya)-[:likes]->(dog), (maya)-[:likes]->(snake) i think following reads nicely: match (

c# - Linq not populating the other list -

for reason 2nd list list2 isn't being populated, when should. var list1 = new list<object1>(); //populated list1 here var list2 = new list<object1>(); list1.orderbydescending(o => o.cnt).take(10).select(s => { list2.add(s); return s; }); list2 should have 10 entries now, doesn't? how possible? it's not working because linq expressions lazily evaluated. select function not executed until iterate on it, never do. if add .tolist(); end, should see working. however , not idiomatic way you're trying do. commenter suggested, better: var list2 = list1.orderbydescending(o => o.cnt).take(10).tolist(); or add values populated list, list2.addrange(list1.orderbydescending(o => o.cnt).take(10));

ember.js - My data shows on one page and not the other on Ember -

i'm using ember data build web app, , somehow data shows on 1 template , not other. ember console shows model correctly hooked route, don't know why data won't show. the data i'm trying show {{stacktitle}} in model 'stack'. i'm using local storage adapter provided via ember's tutorial... maybe that's problem? here's template (the 1 that's not displaying data): <script type="text/x-handlebars" data-template-name="stack"> <div class="container-fluid"> <div class="row"> <a href="#"><button class="btn btn-default" type="button">back</button></a> <button class="btn btn-default" type="submit">save</button> </div> <h1> <label {{action "editstack" on="doubleclick"}}>{{stacktitle}}</label> {

Pagination with arrows in javascript -

here javascript code: function setpage(currentpage){ currentpage = parseint(currentpage) + 1; var last = json.parse(localstorage.getitem("attempt")); var lastpage = last.length - 1; var prevcurpage = currentpage - 1; var prevcurpage2 = currentpage - 2; var nextcurpage = currentpage + 1; var nextcurpage2 = currentpage + 2; var content = ""; if(lastpage == 1){ }else{ if(currentpage == 1){ if(lastpage > 2){ content+=" [<a href=''>"+currentpage+"</a>] | "; content+=" <a href=''>"+nextcurpage+"</a> | "; content+=" <a href=''>"+nextcurpage2+"</a> | "; }else{ content+=" [<a href=''>"+currentpage+"</a>] | "; content+=" <a href=''>"+nextcurpage+"</a> | &qu

uinavigationcontroller - iOS WatchKit - How to detect when back button is pressed on Watch? -

i need cleanup on 2nd view controller when button (arrow) pressed on apple watch. there sort of method detecting/handling when button pressed / view popped? note - can't use 'willdeactivate()' function gets me stuck in loop trying do. there no method detect button touched. correct/only place in diddeactivate , though sounds won't work you.

c# - Is right to have a XAML button send one message for the View and one for the VM (MVVM)? -

i'm developing simple contact manager wp 8.1. mv list of added contacts , has button create new contact (new contact view - ncv). nvc view has save button, , use button 2 proposes: add new contact list of contacts, happen vm send event code-behind file off view goback main view. it works! , this, avoid vm have send event message view. but wrong? if wrong, there simple way avoid this? there magic line: <button content="save" command="{binding addnewcontactcommand}" click="button_click" /> your question opinion based , may wildly varying answers. comments "no, don't because you'll break mvvm pattern", depends on size , longevity , professionalism of project , programming style in general. in fact, using code behind view related logic fine in mvvm, although i'm sure die hard mvvm developers disagree statement. however, if you'd prefer not use code behind, there other ways load views view model

openssl - 'dgst verify and sign' equivalent with 'RSA_Verify()' -

i using rsa_verify() function validate sha signed using openssl program (via console). rsa_verify() returning non successful validation, think sending incorrect parameters it. the following console commands run in linux ubuntu openssl 0.9.8k. the c functions compiled android, using openssl 1.0.1...c far remember. it's 1.0.1 (we updating avoid heartbleed issue). this do... please forgive mistake learning myself. generate private key openssl genrsa -out private.key 2048 extract public key private key openssl rsa -in private.key -out public.key -outform pem -pubout calculate sha file called permissions , sign private.key, output sha rsa encryption (permissions.sign) openssl dgst -sha256 -sign private.key -out permissions.sign permissions validate received sha signature against permissions file (it's successful in ubuntu console) openssl dgst -sha256 -verify public.key -signature permissions.sign permissions i copy permissions file, permissions.sign file ,

python - sympy.sympify() does not perform substitutions -

this works expected: >>> sympy import * >>> (x, y, z) = symbols("x y z") >>> y = x >>> z = y >>> z x however sympify() not perform substitution: >>> sympy import * >>> y = sympify('x') >>> z = sympify('y') >>> z y z should set x . are there flags can pass sympify() substitute? i'm using sympy version 0.7.1.rc1 , python 2.7.3 you're misunderstanding difference between sympy symbols , python names. >>> y = sympify('x') here you've created symbol x referred name y . >>> z = sympify('y') now create symbol y referred name z . note symbol y , local name y have nothing each other. sympy not care have variable named y when sympify('y') -- it's not inspecting local namespace. what want is: >>> z = sympify(y) i.e. assigning z symbol pointed by y ; gets expect: >>> z

ruby on rails - Date object turns into String when using Sidekiq -

i have problem when pass date objects arguments different methods, turn string . in rails app, there service calls sidekiq worker execute method in model. when service object initialized, has date instance methods. have confirmed types using debugger. it passes instance methods sidekiq worker using perform_async . perform method sidekiq 1 line method invokes method in model, passing arguments received service model. in model side, argument passed in sidekiq worker no longer date type. string (e.g. "2015-01-20"). have confirmed using degugger. any thoughts on why happening? when call perform_async method on sidekiq worker, provided arguments translated json can stored in redis queue sidekiq background workers pull from, , translated primitive types json passed perform in background worker process. because of this, it's best pass simple arguments sidekiq workers; in fact, it's best practice . for specific problem, take date passed perfor

java - Why isn't my code calculating the correct total? -

i'm having trouble trying find out running total. each time calculate running total miscalculates , gives me incorrect answer. i'm not sure is. cant tell if has method calling did in main, if statement in takeorder or neither. import java.text.decimalformat; import javax.swing.joptionpane; public class mycoffeehouse { public static void main(string[] args) { string name = joptionpane.showinputdialog(null, "what name?"); greetcustomer(name); double totalprice = takeorder(name); calculatefinalprice(totalprice); } public static void greetcustomer(string name) { // greet customer joptionpane.showmessagedialog(null, "hello " + name + ", welcome cup of java!"); } public static double takeorder(string name) { // method returns string[] food = {"coffee", "bagel", "tea", "muffin"}; double[] price = {3.99, 1.99, 2.99, 4.99};

javascript - Using prototype with scrollTop to make instances of a Class(js class) active (css class) -

i think title pretty confused, dont know how named i'm trying do. i have paragraph: <p data-initial="100" data-final="1000">test</p> note data-* and paragraph have simple css: p { color: black; margin-top: 500px; } p.active { color: red; } and paragraph instance of animation class: + function($) { var animation = function(element) { this.element = $(element); this.initial = this.element.data('initial'); this.final = this.element.data('final'); if (this.initial > $(this).scrolltop()) { this.applyanimation(); } } animation.prototype.applyanimation = function() { alert('worked!!'); this.element.addclass('active'); } animation.prototype.disableanimation = function() { this.element.removeclass('active'); } $(window).on('load', function() { $('[data-initial]').each(function() { var animation = $(this); a

Python 2.x or 3.x on a Chromebook -

i'm trying programming. i've worked extent in javascript, html, etc. started python, , want able use acer c720 chromebook python. i've installed few things python shell chrome webstore, these lack modules need use, such tkinter. wandering if install full version of python (2.x or 3.x) via terminal (i'm in dev mode). you need install crouton on chromebook , , then, after dual booting (with sudo startxfce4 ), can open terminal , proceed tkinter program.

excel - Result from formula is incorrect due to more than 255 characters -

hope can explain properly. below formula return data last (not latest) entered in column: =index(a:a,match(rept("z",255),a:a)) instead of returning last value, returns second last value. assume has cell containing more 255 characters. is there way around it? thought changing "255" "350" fix issue (clearly returned error). cheers mal if want value in last occupied cell not use: =index(a:a, counta(a:a), 1)

java - Retrieving data from the hashMap in a multipartFormData -

i'm having trouble method, can print map if there's 1 item in if put more 1, out of bounds exception, have implemented incorrectly? public static result update(){ //get body of request requestbody body = request().body(); //assign type multipartformdata http.multipartformdata multippartbody = body.asmultipartformdata(); // pull video multipartformdata http.multipartformdata.filepart videofile = multippartbody.getfile("filekey"); // pull hashmap multipartformdata map<string, string[]> mymap = multippartbody.asformurlencoded(); system.out.println(mymap.size()); // loop print contents of hashmap for(int =0; < mymap.size(); i++){ string param = "param" + (i + 1); system.out.println(mymap.get(param)[i]); } }

opengl es - Max Varying Vectors and Floats for GLES 2.0 -

i trying figure out maximum number of varying vectors , uniforms can use on device opengl es 2.0 compatible. trying understand how max_varying_vectors works. if max_varying_vectors 8, mean can store 8 * 4 bytes of data varyings or mean can define 8 varyings irrespective of data type? max_varying_vectors measured in units of 4-member float vectors ( vec4 ). minimum guaranteed value of 8, can have 8 varyings of type vec4 . the rules on how other types fit available space complex. example max_varying_vectors 8, whole thing treated 2d array of 8 rows , 4 columns. space in array allocated varyings in order (which goes largest smallest), , rules depend on size of variable , size/location of empty space still available in array. the exact rules fill 2.5 pages in glsl es 1.00 spec document. on pages 111-113. copying whole thing not make lot of sense, , i'm afraid can't turn simpler while still remaining accurate.

REGEX issue, selecting an sql query with multiple new lines -

i trying select every query select in start , limit in end, example: $selquery = "select disticnt c.firstname,c.lastname,c.id clientid,qc.category_name,qr.cid,qr.catid,qr.rhid cms_question_report qr, cms_clients c,cms_questioncategory qc ,cms_reporthistory rh c.id=qr.cid , qr.rhid=rh.id , qr.catid='".$objarray['catid']."' , qr.catid=qc.id , c.id in($selclids) limit $page_no,$this->limit"; and not select other query doesn't contain limit. regex thought work this: select .*\n* limit where i'm stating has start "select" other characters , ends limit, issue don't know how handle \n*, have multiple unknown number of new lines , in each line there unknown characters, i'm assuming should go \n*. \n .* , on, there way can select character including new line. i have tried using s

angularjs - Using Responsive-nav.js with Angular -

utilizing responsive-nav.js attempting create responsive navigation. i've used responsive-nav.js on non-angular projects in past without issue. having difficult figuring out how include required code. example, attempted place line of code in index.html file before closing body tag instructed on in documentation . <!-- put right before </body> closing tag --> <script> var nav = responsivenav(".nav-collapse"); </script> the script above console gives me error "responsivena not defined". i created directive responsive-nav.js did not resolve problem. .directive('responsivenav', function(){ return{ restrict: 'e', link:function(scope, element, attrs){ $(element).responsivenav("foo",{ customtoggle : "nav-toggle", navclass : "nav-collapse" }); scope.$apply(); } } });

angularjs - Pass data to an Angular 2.0 component -

i know it's pre-release, know if it's possible pass argument angular 2.0 component <div *foreach="#city in myobj.cities"> <city-view current="city"></city-view> </div> class cityview{ ... } i have code above, not sure how pass city city-view component. know proposed syntax? above code loop, not allow me pass data component. i have tried in newer alpha version of angular 2.0 , syntax now: <div *for="#city of myobj.cities" > <city-view [current]="city"></city-view> </div> here full working example of angular 2.0 template: http://www.syntaxsuccess.com/viewarticle/recursive-treeview-in-angular-2.0

java - Talend Open Studio exporting job as a webservice and calling it without URL parameters -

i working talend first time. have created talend job , exported axis webservice war file. have deployed on tomcat container. now in order call webservice, passing values context parameters, need build url values set on it. for example url might similar this: http://localhost:10080/standardparcellor_0.1/services/standardparcellor?method=runjob&arg1=--context_param%20deliveryparcelmetadatafilelocation=c:\dev\temp\dms\b2345678-2234-1234-1234-123456789123\a2345678-2234-1234-1234-123456789123\metadata.xml&arg2=--context_param%20workingpath=c:\dev\temp&arg3=--context_param%20deliveryparcelid=db604807-8606-4107-8d3e-aff08c95db1c&arg4=--context_param%20packageworkingfolder=c:\dev\temp\dms\b2345678-2234-1234-1234-123456789123\a2345678-2234-1234-1234-123456789123 if notice url awfully long , there characters in url need encoded properly. causing me lot of grief. if works now, break later on either on basis of length of url or encoding doing right. i wondering , hopi

java - What is different about the Jenkins Build environment than regular? -

i have mac pro set up, , whenever run gradle command google app engine java project: ./gradlew run -dmainclassname=myscript it runs fine. however, whenever run exact same command on jenkins, fails, saying missing symbols on google api: com.google.appengine.tools.mapreduce.mapspecification.builder.build(); what happening? (the gradle command trying run remote script) jenkins runs jenkins user. have in user path don't have in jenkins 's path

c# - Has the Roslyn compiler been integrated into the Mono project? -

i've been rather interested in c# , mono since microsoft announced open sourcing .net. wondering how influence decision has had on mono project? i'm assuming means there isn't potential danger of microsoft trying shut down project anymore (if had wanted)? yes roslyn has been integrated. from article mono , roslyn , written 1 of mono maintainers: at build, we showed roslyn running on mono . if want run own copy of roslyn today, need use both fresh version of mono, , apply handful of patches roslyn. ... our goal keep track of roslyn being developed, , when officially released, bundle roslyn's compilers mono.