Posts

Showing posts from September, 2014

java - Jsoup, Reddit, OAuth2, and 429 HTTP Errors -

so i'm trying write executable jar small subreddit run. i have post jsoup connects , reads urls on page. in method, connects urls (that comments on post) , gets html comments , saves them hashmap. this great getting 429 http error. resolve this, added short 5 second wait. i'm getting sockettimeoutexception "read timed out". once lowered time down 3 seconds, bouncing between two. now run few reddit bots python , i'm able make lot more requests i'm doing here. have single bot makes thousands of requests every minute. know it's possible make these requests. my question is, how able make multiple requests reddit , avoid 429 http error? i'm using jsoup connect , read html. while i'm sure connecting reddit via. oauth2 api fix issues, have no idea how use oauth2 in java (i use wrapper in python it's fair don't know @ all) , don't know how use jsoup. my question is, how able make multiple requests reddit , avoid 429 h

c - function undefined even though it is in a different .h file -

i getting compile error saying functions undefined. of these functions defined in file called auxilarity.h , implemented in auxilarity.c i can't seem find i'm missing. here makefile: assembly: main.o assembler.o hashtable.o auxilarity.o gcc -g -ansi -wall -pedantic main.o assembler.o hashtable.o -o assembly auxilarity.o: auxilarity.c auxilarity.h gcc -c -ansi -wall -pedantic auxilarity.c -o auxilarity.o main.o: main.c assembly.h hash.h gcc -c -ansi -wall -pedantic main.c -o main.o assembler.o: assembler.c assembly.h auxilarity.h gcc -c -ansi -wall -pedantic assembler.c -o assembler.o hashtable.o: hashtable.c auxilarity.h hash.h gcc -c -ansi -wall -pedantic hashtable.c -o hashtable.o and relevant parts of: assembler.c: #include "assembly.h" #include "hash.h" #include "auxilarity.h" ... code ... int isargvalid(char *s) { char *ns; ns = cleanstr(s); /* <-- compiler yells on cleanstr undefined*/

sql server - Generate insert statement with the data from another table dynamically -

i create stored procedure , generate insert statement table dynamically. input parameters stored procedure supposed schema, table name, @col1, @col2, ..., @coln . stored procedure supposed take 1 random record server , based on record supposed generate insert statement. @col1, @col2, ..., @coln parameters optional in case overwrite original value 1 need. the insert record supposed that: insert schema_name.table_name values ( col1, col2, ..., coln) values ( coalesce(@col1, 'col1_value'), coalesce(@col2, 'col2_value'), ..., coalesce(@coln, 'coln_value') ); currently can not realize how take real data , put statement. did is: create procedure dbo.generatesampledatainsertsp @schemaname varchar(255), @tablename varchar(255) set nocount on; declare @sql varchar(max) = '', @columns varchar(max) = '', @columnswithcoalesce varchar(max) = ''; select c.name #column sys.tables t join sys.schemas s on s.sch

java - Solr error when attempting to use a field set to a fieldtype of solr.StrField -

i'm trying setup faceting through solr. have specific field use called "category". faceting works, appears lowercase , contains single word. i'm sure due field analyzer i've change field's type "string". produces error! see below. fyi - i'm using solr 4.3. you can see fieldtype , field below. can see field set fieldtype "string". field type uses "solr.strfield". why using fieldtype cause error below? schema.xml <types> <fieldtype name="string" class="solr.strfield" sortmissinglast="true" /> </types> <fields> <field name="category" type="string" indexed="true" stored="true" required="false" multivalued="false"/> </fields> i'm getting error message in log , when attempting run query this attributesource not have attribute 'org.apache.lucene.analysis.tokenattr

Excel VBA - Check cells in a column do not contain the string 8254 and display MsgBox -

i trying put vba code check if contents in every cell l2 down last row of data (until blank cell found) not contain string '8254' number codes in column l 27 characters long , contain '8254' last 4 digits. if can verify '8254' in every cell format/code correct (some number codes incorrect , need investigated). if string '8254' not present in 1 or more of cells, display msgbox warning there error(s) in column. i have been trying make below code work, new vba , need help does know how can this? thanks sub checkcodes() 'check column 'l' non standard number codes dim code range each code in range("l2", range("l" & rows.count).end(xlup)) if vba.right$(vba.trim$(code), 4) <> "8254" msgbox "non standard number codes found! " & vbnewline & "check number codes ", , "advisory!" exit sub end if next code end sub i found issue c

javascript - How to generate multiple response.write:s with json in node.js/express? -

having trouble generating multiple response.write:s api call in node.js. here code. // articles app.get('/api/articles', function(req, res) { res.writehead(200, { "content-type": "application/json" }); // use mongoose feeds in database feed.find(function(err, feeds) { // if there error retrieving, send error. nothing after res.send(err) execute if (err) res.send(err); feeds.foreach(function(feedmodel) { //for each feed in db articles via feed-read module feed(feedmodel.url, function(err, articles) { articles.foreach(function(articlemodel) { console.log(json.stringify(articlemodel));//works!! res.write(json.stringify(articlemodel));//doesnt produce output. }); }); }); }); //end find function res.end(); }); //end api call you need end() inside callback no @ end. res.end(json.stringify(articlemodel));

c# - Can't update a record that has a null date value in Telerik Open Access -

i have solution telerik data access project. encountered problem when trying update record. think problem has fact date field null value in database before trying update it, i'm not sure. can tell me how work around it? in mvc project, have model called tblcolocation. linked our sql database. mode defined in data access project as namespace project.openaccess { public class tblcolocation { public int locid { get; set; } ... public datetime modon { get; set; } public int modby { get; set; } } } to update data, in file called repository.cs, have method: public void updatecolocation(tblcolocation obj) { var upd = dat.tblcolocations.firstordefault(itm => itm.locid == obj.locid); if (upd != null) { upd.modon = obj.modon; upd.modby = obj.modby; } dat.savechanges(); } i have similar code updating other models, tblcolocation throws error. field modon null in database (this design

swift - In IOS is it possible for users of the app to be able to select in a table view which tab bar items they want -

i creating app people able view ad notifications quotes like. quotes separated categories , user can pick categories of quotes want see. changes make affect bar button items. in swift please after reading question, idea have, can tell possible. it's not hard long take time , think it. won't give of code , don't seem know doing well. don't worry though 100% sure if research (hint hint) 2 parts want come i'm sure find answer. yes able! also don't ask code no 1 give you! try breaking down , figuring out yourself good luck have day!

swift - iOS - Interface Builder - Autolayout two labels -

Image
not sure how use autolayout on 2 highest labels in second prototype cell here: we'll call labels labelx , labely. basically labelx (selected) left-aligned 10 pts uiimageview left, , labely (floating right) 0 pts right superview. need labelx end before overlaps labely, in case former super long. i tried adding constraint labelx of trailing space labely, , altered hugging priority of 1 or other 250 produces weird results. thanks dan's comment arrived @ solution setting both horizontal content compression resistance of labelx , horizontal content hugging priority lower of labely.

ios - How do I make shape rotate on its axis? -

the hexagon rotates, wont stay in place , rotate. need change in order spin clockwise once every single time button clicked. shape6 = cashapelayer() view.layer.addsublayer(shape6) shape6.opacity = 0.5 shape6.linewidth = 2 shape6.linejoin = kcalinejoinmiter shape6.strokecolor = uicolor(hue: 0.786, saturation: 0.79, brightness: 0.53, alpha: 1.0).cgcolor shape6.fillcolor = uicolor(hue: 0, saturation: 0, brightness: 0, alpha: 0).cgcolor path6 = uibezierpath() path6.movetopoint(cgpointmake(35,430)) path6.addlinetopoint(cgpointmake(80, 300)) path6.closepath() shape6.path = path6.cgpath @ibaction func ispin(sender: anyobject) { uiview.animatewithduration(1.0, animations: ({ self.shape1.transform = catransform3dmakerotation(30, 150, 400, 20) self.shape2.transform = catransform3dmakerotation(30, 150, 400, 20) self.shape3.transform = catransform3dmakerotation(30, 150, 400, 20) self.shape4.transform = cat

php - do_settings_sections not working in WordPress admin -

i using wordpress settings api build options page theme. can't input elements display in admin. think i've narrowed problem do_settings_sections(); function thing not rendering on front end. function cbc_theme_init() { register_setting( 'cbcsettings-group', 'carousel_options' ); add_settings_section( 'cbc_carousel_section', 'carousel settings', 'cbc_carousel_section_callback', 'cbcsettings' ); add_settings_field( 'cbc_slide_one_title', 'title', 'cbc_slide_title_callback', 'cbcsettings', 'cbc_carousel_section' ); } // end cbc_theme_init function cbc_carousel_section_callback() { } // end cbc_carousel_section_callback function cbc_slide_title_callback() { $options = get_option( 'carousel_options' );

sql server - Displaying 2 different length columns from SQL query when pulling from 1 table -

i use following code pull data table. select case when vendorcontactlname '%[s]' vendorcontactfname + ' ' + vendorcontactlname + '''' end 'test', case when vendorcontactlname not '%[s]' vendorcontactfname + ' ' + vendorcontactlname + '''s' end 'test2' vendors; currently, returns 2 columns should, first condition isn't true, places "null" in test column , second condition isn't true, returns null in respective column. i'd not this, , instead incrementally add rows based on whether or not condition met , avoid rows null in them. edit: not sure how wasn't clear, visual representation happen current code. test test2 null francesco alberto's null ania irvin's null lukas liana's null kenzie quinn's michelle marks' null null anton mauro's null

What is returned by jQuery append? -

this partly honest question, partly rant. suppose have html <ol id="t"></ol> and jquery code var x = $('#t').append('test'); var y = x.append('<ol>hello</ol>'); x.append('hello2'); y.append('hello3'); what should expect see? tried here. http://jsfiddle.net/a7j5nw9z/ , appears me append function returns this . in other words x.append('foo') appears return x. checked jquery documentation both here , here . return value undocumented. can safely assume all jquery functions return this unless otherwise documented? documented somewhere? glancing through jquery docs, , lots of functions have undefined return values. directly docs : most frequently, use jquery() function create jquery object. jquery() can accessed familiar single-character alias of $(), unless have called jquery.noconflict() disable option. many jquery methods return jquery object itself, method calls can

Ruby on Rails update element in database via Migrate file -

i need update several tuple's name attributes in database. locally can update data via gui -- pgadmin. but i'm new rails , not sure how update developer database. a coworker briefly suggested editing db/migrate file accomplished. can method? or better done via command line? i'm using postgres. class updateactionableitemname < activerecord::migration class insightreportmenuitem < activerecord::base self.table_name = 'actionable_items' attr_accessible :name end def #find rows updated prescriber_activity_request = insightreportmenuitem.where(name: "prescriber activity patient") dispenser_activity_request = insightreportmenuitem.where(name: "dispenser activity") patient_history_request = insightreportmenuitem.where(name: "patient request activity") #update row attributes prescriber_activity_request.update_attribute(name: "prescriber activity request") if prescriber_activi

scikit learn - Pruning and Boosting in Decision Trees -

how can use pruning , boosting in decision trees based classification approach? i have 10 features , 3000 samples. here example demonstrate how use boosting. from sklearn.datasets import make_classification sklearn.ensemble import gradientboostingclassifier sklearn.tree import decisiontreeclassifier sklearn.cross_validation import stratifiedshufflesplit sklearn.metrics import classification_report # generate artificial data x, y = make_classification(n_samples=3000, n_features=10, n_informative=2, flip_y=0.1, weights=[0.15, 0.85], random_state=0) # train/test split split = stratifiedshufflesplit(y, n_iter=1, test_size=0.2, random_state=0) train_index, test_index = list(split)[0] x_train, y_train = x[train_index], y[train_index] x_test, y_test = x[test_index], y[test_index] # boosting: many many weak classifiers (max_depth=1) refine sequentially # tree default base classifier estimator = gradientboostingclassifier(n_estimators=200, learning_rate=0.1, max_depth=1, ran

android - Two overflow menus visible -

i have 2 below menu items: <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:yourapp="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" tools:context=".mainactivity"> <item android:id="@+id/action_search" android:title="@string/action_search" android:icon="@drawable/ic_search_white_24dp" yourapp:showasaction="always|collapseactionview" yourapp:actionviewclass="android.support.v7.widget.searchview" /> <item android:id="@+id/action_about" android:title="@string/action_about" android:orderincategory="100" yourapp:showasaction="never" /> </menu> overflow menu style: <style name="apptheme" parent="theme.appcompat.light.noactionbar"> <item name=&qu

Get security context from SessionDestroyedEvent in Spring Session -

i using spring session 1.0.1. need execute logic when user logs out, , need rely on http session being invalidated cover case user fails explicitly log out. the standard spring security sessiondestroyedevent includes applicable securitycontext, spring session version of sessiondestroyedevent contains session id. time event fires, session no longer held sessionrepository can't looked id. is there way retrieve securitycontext expired session using spring session? unfortunately there not. problem @ time redis fires event, session gone. furthermore, event received redis not contain original information. means there no way retrieve securitycontext. for updates on please track spring-projects/spring-session/issues/4

flash - ActionScript 3 Looping -

Image
i started using looping in as3 , have learn. here question. below loop puts 5 balls 1 on top of other on stage. far good. however, i'd create situation when clicking on button, bottom ball removed, , each ball take place of ball below 1 one, continue each click until balls gone. . have created situation add/remove child , thought more efficient looping. don't know how access balls since don't have instance name or class name can reference too. var ball: gball4m; var i: number; (i = 0; < 5; i++) { ball = new gball4m(); ball.x = 331.30; ball.y = 25 + * 17 addchild(ball); } function release2ball2(event: mouseevent): void { this effect want https://youtu.be/b4glolw8qva as mentioned in answer of @daniel-messer, can use array store balls, , second part of question, when removing last ball , moving other ones, can use array.pop() remove last element of array, , can use array.map() move other balls : function release2ball2(event:mouseevent): voi

St. Petersburg Lottery, probability python, -

the following question references project euler problem 499 , can found here. here problem in nutshell: gambler starts s dollars, , can gamble in costs m dollars play. once starts play, pays m dollars dealer, , gets 1$ pot. flips fair coin. if coin lands on heads, pot doubled, , plays again. if coin lands on tails, gambler takes entirety of pot, , has pay m dollar starting fee again dealer pot back. probability never runs out of money m = 2$ , s = 2$? my strategy create python script branching probability tree tell me possible outcomes on branch down line (for example, possibilities after 25 coin tosses). here script: def play_game(initial_funds, price_to_play, iterations): prob_tree = {} iteration in range(1, iterations + 1): prob_tree[iteration] = [] # first number represents money in hand, second represents money in pot. prob_tree[1].append([initial_funds - price_to_play, 1]) iteration in range(2, iterations + 1): # each possible outco

sql - Oracle in C#, bind variables, and queries like ID IN (1, 2, 3) -

i'm looking c# odac adaptation of following java technique, code able bind array of numbers (the array size can vary) non-pl/sql select statement , use resulting array in where id in (...) style check. http://rafudb.blogspot.com/2011/10/variable-inlist.html here's example of technique used in oci-based c programs: oracle oci, bind variables, , queries id in (1, 2, 3) specifically, want execute query like select * mytable id in (select * table(:1)) and pass in array of numbers :1 . code: oraparam.udttypename = "sys.odcinumberlist"; varray newarray = new varray(); newarray.array = new int32[] {12,24,42}; oraparam.oracledbtype = oracledbtype.array; oraparam.value = newarray; string query = @"select * table(:1) "; oraclecommand command = new oraclecommand(query, myconnection); command.parameters.add(oraparam); oracledatareader reader; var m_connection = new oracleconnection("the connection string"); m_connection.open(); v

c++ - What are aggregate classes for? -

i have read following definition in c++ primer (5th edition) on page 298: a class aggregate if: all of data members public it not define constructors it has no in-class initializers it has no base classes or virtual functions a definition provided in post: what aggregates , pods , how/why special? . after read in previous sections of book on value of encapsulation, wondering: why want use aggregate class? (btw, question seems applicable struct in general: why want have public: default?) an aggregate simple collection of data not have invariants class have guarantee. since there no invariant , combinations of possible values of member make sense, there no point in making them private since there nothing protect. a simple example such class like struct point3d { std::array<double, 3> coordinates; }; since every triple of double s point in r^3, there nothing gain hiding data. (if afraid of nan , infinity values, might not b

php - Doctrine cache relations -

i have entity 'category' has relation many 'projects' in term has many 'images'. i'm caching results inside 'category' repository fetch project linked category conditions. caching done redisbundle , doctrine: query->setresultcachedriver functions: try { $qb = $this->getentitymanager()->createquerybuilder(); $qb->select('category', 'projects') ->from('appbundle\entity\category', 'category') ->leftjoin( 'category.projects', 'projects', \doctrine\orm\query\expr\join::with, $qb->expr()->eq('projects.active', 1) ) ->where( $qb->expr()->eq('category.slug', ':slug') ) ->setparameter('slug', $slug); $query = $qb->getquery(); $query ->

Publish Lightswitch application freeze visual studio -

i want publish lightswitch html client application azure web app. problem after clicking "publish" visual studio 2013 freeze. the problem use multiple azure subscriptions in visual studio , lightswitch publish dialog not able handle multiple azure subscriptions. solution: go visual studio -> server explorer right-click azure -> manage subscriptions select required azure subscription publish

In a PowerShell function, how can I make a parameter mandatory only if another optional parameter is absent? -

i'm writing powershell function , need first parameter optional, third parameter optional only if first parameter present. here code right now: param( [parameter(position=0)][array]$from, [parameter(position=1,mandatory=$true)][string[]]$names, [parameter(position=2)][string[]]$values ) ideally this: [parameter(position=2,mandatory=(!$from))][string[]]$values but not allowed. i've been getting impression using set names in way way go, i'm not sure how go it. thing need change mandatory attribute value $values depending on existence of $from. what best way me this? i've looked on each of following past questions pretty thoroughly , nothing tried based on found in them work. create function optional call variabls: powershell requiring parameters in powershell when parameter present powershell mandatory parameter depend on other parameter having optional parameter requires paramter present multiple mandatory parameter sets cond

pointers - Java Enum Returns Null -

i creating plugin minecraft using spigotapi. reason i'm posting here because believe java error. creating duels plugin inside code it'll loop through enum, , see if it's specific type. first time using around works, no problems. when try second time without restarting plugin/program/code it'll return enum null. here code, there fix this? public duelarenas[] getarenaswithtype(dueltypes type) { string suffix = "_normal"; list<duelarenas> arenasaslist = new arraylist<>(); switch (type) { case normal: suffix = "_normal"; break; } (duelarenas arena : duelarenastatus.keyset()) { if (arena.tostring().endswith(suffix)) { arenasaslist.add(arena); } } duelarenas[] arenas = new duelarenas[arenasaslist.size()]; return arenasaslist.toarray(arenas); } stacktrace: caused by: java.lang.nullpointerexception @ me.nick.acore.duels.duelsapi.getarenaswith

MSBuild Exec fail when UseCommandProcessor set to True -

i define target call exec <target name="buildinstaller" > <exec command="attrib -r /s /d $(msbuildprojectdirectory)\environment\installer\serviceplatform\*.*" /> <exec command="dir *.* /s" /> </target> it works perfectly but if add usecommandprocessor set true <target name="buildinstaller" > <exec command="attrib -r /s /d $(msbuildprojectdirectory)\environment\installer\serviceplatform\*.*" /> <exec command="dir *.* /s" usecommandprocessor="true"/> </target> i got this: c:\dev>/q /c:\users\myuser\appdata\local\temp\tmp63250fcf10714224b92eeeb09e25b6f5.exec.cmd '/q' not recognized internal or external command, operable program or batch file. why happen? doing wrong?

java - How to catch HTTP 302 response via Selenium Webdriver? -

i want automate following scenario: click on image before destination page, server redirects me url (e.g abc.com). http response--> 302 found there redirection url (e.g def.com). http response--> 302 found destination url reached (e.g xyz.com) http response--> 301 moved permanently i interested in step2. need verify (abc.com) received 302 response before xyz.com reached. there way in selenium webdriver? if not, how can implement in java?

android - How do i convert to Color to Bitmap? -

i have color in form of integer, , want color in bitmap form. there way so? i tried drawable d = new colordrawable(color.parsecolor("#ffffff")); bitmap b = ((bitmapdrawable)d).getbitmap(); but above code give error cannot cast colordrawable bitmapdrawable is there other way? actual code is palette.generateasync(bitmapfactory.decodefile(songart), new palette.paletteasynclistener() { @override public void ongenerated(final palette palette) { if (build.version.sdk_int >= 16) { drawable colordrawable = new colordrawable(palette.getdarkvibrantcolor( getresources().getcolor(r.color.noti_background))); notificationcompat.bigcontentview.setimageviewresource(r.id.noti_color_bg, ((bitmapdrawable) colordrawable).getbitmap()); notificationmanager.notify(notification_id, n

java - Android: whenever a edittext field is left empty, program closes giving exception -

program sudenly close when edittext left empty when ever pressed button move next activity. here code. package cme.ws.com.ws.cme; import android.app.activity; import android.content.context; import android.content.intent; import android.os.bundle; import android.support.v7.app.actionbaractivity; import android.view.view; import android.widget.button; import android.widget.edittext; import android.widget.toast; /** * created waqas aamer on 5/27/2015. */ public class areaactivity extends activity { int plotarea, coveredarea; int brickprice, blockprice, cementprice, sandprice, crushprice, ironprice; int brickprice1, blockprice1, cementprice1, sandprice1, crushprice1, ironprice1; int plotarea1, coveredarea1; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_area); { final context context = getapplicationcontext(); final int duration = toast.length_short; button

android - Use FusedLocationServiceApi without internet connection -

i've created gps location service uses fusedlocationproviderapi googleplayserviceapi. working fine except receiving coordinates without enabled internet connection. i did lot of research why isn't working without internet connection , still don't know why. when connected wifi working fine , location being updated perfectly. when restart device , disable wifi , mobile internet isn't working anymore. when start location updates while connected internet , disable internet connection location update still working. somehow, changes internet provider gps provider. am doing wrong or bug not able coordinates without internet connection.

ruby on rails - Browserify can't find module -

i'm trying include react component rails app. react working browserify cant find component. error: cannot find module 'react-typeahead' '/users/xxx/code/xxx/app/assets/javascripts/react' i used bower add react-typeahead vendor/assets/components , i'm trying include with: config.browserify_rails.paths << /vendor\/assets\/\/components\/\/react-typeahead\// how can browserify load component?

google apps script - Searching current folder for spreadsheets and changing value in specific cell of each file found -

new google apps script here, have coding experience. want scan current folder spreadsheets. each spreadsheet found, want change value in specific cell (say cell f16 in "sheet1") "q1 fy16". here have far: function myfunction() { var folderid ="0bxfgszimm3d9flpvlwxd4bjq"; var topfolder = driveapp.getfolderbyid(folderid); logger.log(topfolder.getname()); var fileslist = topfolder.getfiles(); while (fileslist.hasnext()) { var file = fileslist.next(); logger.log(file.getname()); file.getsheetbyname("sheet1").getrange("f16").setvalue("q1 fy16"); } } there 2 main problems: i have specify folder id in , don't want to. want code run in current directory (and make recursive scan subfolders well). the file class doesn't have "getsheetbyname()" or "getrange()" methods, don't know how cast files spreadsheets. any appreciated. cheers where launching script from? no w

python - Does "Exception" capture all other "Concrete Exceptions" -

i'm having issues tweepy while running streaming api, question isn't directly related tweepy. i have been getting multiple exceptions , thought "catch/pass" time being, temporary solution, until find out problem is. as of now, tweepy has been throwing 5 different errors (incompleteread, protocolerror, unicodedecodeerror, attributeerror, typeerror) , , they're resulting filter api not me obtaining data. the line have in common traceback is: twitterstream.filter(locations=[-125.22, 31.61, -104.86, 49.0, -104.86, 26.11, -66.94, 49.03]) incompleteread , protocolerror related different packages tweepy uses. (unicodedecodeerror, attributeerror, typeerror) concrete exceptions . my question: am right assume exception base class can capture (the last 3)? or incorrect? the documentation exception states all built-in, non-system-exiting exceptions derived class so exception base class should able capture those, non-system-exiting (an ex

java - How to generate HTML report with Maven FindBugs? -

i know similar question has been asked here , setup within pom.xml bit different , answer isn't working case. i have findbugs set when run [mvn compile findbugs:findbugs], default findbugsxml.xml generated. html file generated it's more readable. below i've added pom.xml in order findbugs set up. i'm not sure why html file isn't being generated given i've included specification when making pom.xml edits. below added plugins section of build in pom.xml. <project xmlns="http://maven.apache.org/pom/4.0.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://maven.apache.org/pom/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelversion>4.0.0</modelversion> <artifactid>findbugs-cookbook</artifactid> <packaging>jar</packaging> <version>3.0.1</version> <name>findbugs maven plugin cookbook</name> <description>findbugs maven

bash - vagrant ssh responded with with a non-zero -

i using vagrant on windows 8.1 , when doing vagrant up getting this error the error message states failed trying execute command: chown `id -u vagrant`:`id -g vagrant` /vagrant so accessed host machine ssh: , tried execute same command , get error here some commands tried execute in /vagrant directory, don't know if help. here vagrantfile using. please idea doing wrong ? /vagrant doesn't exist check /home/projects this line in vagrantfile sets directory. ./projects on host, /home/projects on guest. config.vm.synced_folder "./projects", "/home/projects", nfs: true

database - Consumable Product data -

i building data base of consumable products ie..oral hygyne products, bath , body, food, beverages, cleaning products etc..basically need products consume/purchase sold in typical stores, ralph's, albertsons, walmart, cvs, right aid, target etc...so when users place these products in search bar can reconize , begin search ..i building e-commerce site while lot of product data. can point me in right direction how collect such large amounts of data? you may wanna try open data https://en.wikipedia.org/wiki/open_data \ there many government entities pursuing open data in canada. data.gov lists sites of total of 31 states, 13 cities, , > 150 agencies , subagencies providing open data; e.g. state of maryland, state of california, us.

php - FosRestBundele PUT Method doesn't work with Forms but POST or GET works perfectly -

i'm trying build simple restful-service symfony2 , fosrestbundle. if send request get or post method response comes expected. if use put or patch method result empty. formtype namespace mobileservice\userbundle\form; use symfony\component\form\abstracttype; use symfony\component\form\formbuilderinterface; use symfony\component\optionsresolver\optionsresolverinterface; class currentlocationtype extends abstracttype { /** * @param formbuilderinterface $builder * @param array $options */ public function buildform(formbuilderinterface $builder, array $options) { $builder ->add('latitude') ->add('longitude') ->add('city') ->add('zip') ; } /** * @param optionsresolverinterface $resolver */ public function setdefaultoptions(optionsresolverinterface $resolver) { $resolver->setdefaults(array( 'data_class' => 'mobileservice\userbundle\entity\currentlo

java - Server Client Communication -

i want know.. suppose there website or mobile app. whatsapp or hangout. when ever receive new message : if app in foreground see on list. else notification. now want know.. fetch messages app/ website have poll server. is way, server tells app/wesite have fetch data? and connection between these 2 points.?? can me understand how work.. , how achieve point 2. just give brief idea. i think after broadcastreceiver class. a simple intent-filter receiver in androidmanifest file can take care of notification part.

php - Facebook SDK v4 and Graph Api 2.x auto post in Fan Page Wall -

i'm using facebook sdk 4 , graph api 2.x auto post in facebook fan page. problem post published correctly , post's configuration appears in fan page wall public i'm person can see it. the scopes access token are: publish_pages, manage_pages, publish_actions. and used code is: require_once("facebook/autoload.php"); //facebook sdk v4 define('facebook_sdk_v4_src_dir', 'facebook/src/facebook/'); use facebook\facebooksession; use facebook\facebookrequest; use facebook\graphobject; use facebook\facebookrequestexception; $app_id = 'xxxxxxxxxxxxxxxx'; //app id $app_secret = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'; //app secret //token $token = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; //access token $id = "xxxxxxxxxxxxxxxxxxxxx"; // facebook page id facebooksession::setdefaultapplication($app_id, $app_secret); $session_

javascript - jQuery Mobile Slider with step -

here jsfiddle : html: <form> <label for="slider-10">slider:</label> <input type="range" name="slider-10" id="slider-10" min="0" max="999" step="1" value="0"> </form> <form> <label for="slider-10">slider:</label> <input type="range" name="slider-10" id="slider-10" min="0" max="99" step="1" value="0"> </form> i'm having issues step function. bottom slider steps expected, 1. when change max though in top slider step function starts behaving unexpectedly stepping 10's. any thoughts or ideas on why occurs? that behavior seems how jquery mobile handles wide interval on smaller screens. if increase width of result pane in fiddle, 0-999 slider doesn't irregular step anymore. same behavior shown when reducing pane small sizes (

localhost - MAMP server starts but website won't load -

today started mamp local server , wordpress installation not load. attempt load 15-20 seconds , give me err_connection_timed_out error. yesterday worked fine, , made absolutely no changes mamp or website's files cause issue, issue frustrating , mysterious me. i don't think actual mamp server issue because when start server can click 'open webstart page' , load fine, website won't load. i tried change ports default 8888 & 8889 80 & 3306 suggested in forum made no difference either. like said, using same ports yesterday , same ip using connect localhost, today reason won't load. know possibly causing this? i found problem involved corrupt wordpress database. problem ended having nothing mamp. ended fixing issue restoring wordpress installation backup luckily had updraft plus . if else having problem consider possibility database may corrupt.

lxc - Linux container can not access device node -

i used following configuration bind lirc0 container. lxc.mount.entry = /dev/lirc0 dev/lirc0 none bind,optional,create=file the attribute of /dev/lirc0 in host follows. crw------- 1 root root 251, 0 jul 16 20:00 /dev/lirc0 and use lxc-attach go container. attribute of /dev/lirc0 in container same host crw------- 1 root root 251, 0 jul 16 20:00 /dev/lirc0 but /dev/lirc0 can't open. error "operation not permitted" , i'm supervisor(root) in container. how can privilege access /dev/lirc0 in container? you need set linux capabilities on binary running.

php - email as username to login joomla 3.4 -

i can't set email perform login in site. create plugin authentication override existing 1 change sql query select id , password: $query = $db->getquery(true) ->select('id, password') ->from('#__users') ->where('**email**=' . $db->quote($credentials['username'])); i tried modify login.xml below: <field name="username" type="email" class="validate-email" filter="email" label="com_users_login_email_label" size="25" required="true" validate="email" /> when try login get: you can't access private section of site can me? i solved, , want share solution: don't need modify joomla.php of authentication plugin. you have modify controller user.php in /components/com_users/controllers below: $data['email'] = $input->$method->get('e

save a html webpage as pdf using php -

we know can save webpage pdf pressing ctrl+p , save pdf. how can done directly using php? please note webpage pre-designed , need save pdf you can use tcpdf , @ example gives this result ; <?php //============================================================+ // file name : example_006.php // begin : 2008-03-04 // last update : 2013-05-14 // // description : example 006 tcpdf class // writehtml , rtl support // // author: nicola asuni // // (c) copyright: // nicola asuni // tecnick.com ltd // www.tecnick.com // info@tecnick.com //============================================================+ /** * creates example pdf test document using tcpdf * @package com.tecnick.tcpdf * @abstract tcpdf - example: writehtml , rtl support * @author nicola asuni * @since 2008-03-04 */ // include main tcpdf library (search installation path). require_once('tcpdf_include.php'); // create new pdf