Posts

Showing posts from May, 2011

php - sharing user on 2 WordPress installs in 2 sub domains on same server -

i have 2 wordpress sites in 2 different sub-domains test1.abc.com , test2.abc.com . both sites have wp-require plugin activated , logged-in users can see site. want make system if user logged 1 site, should auto-login other one. what try : after searching know need use 1 database both sites. have done these steps: i have download whole database of test2.abc.com site , change prefix wp_ wpmo_, replaced in whole database , upload first site's database. added these 2 lines in wp-config.php of second site, define second site should use first site's user table not own. define('custom_usermeta_table', 'wp_usermeta'); define('custom_user_table', 'wp_users'); now, second site using first site's users , able login second site user details of first site. the next problem cookies, added these lines in wp-config of both sites. define('cookie_domain', '.abc.com'); define('cookiepath', '/'); define('c

python - Request handler not working in GoogleAppEngine WSGI application -

i new web development. have written following python code input in form , send '/testform' import webapp2 form=""" <form action="/testform"> <input name="q"> <input type="submit"> </form> """ class mainhandler(webapp2.requesthandler): def get(self): self.response.out.write(form) class testhandler(webapp2.requesthandler): def get(self): q=self.request.get("q") self.response.out.write(q) app = webapp2.wsgiapplication([ ('/', mainhandler),('/testform',testhandler) ], debug=true) but when opening file in browser, nothing being displayed. why so?

html - How to Run PHP coding dynamically -

i want type php coding in textarea, after submit should run php coding , produce result. possible ? to upload changes in live, need 2 level approve, if errors occur could't fix quickly, if above thing possible can enable error log, dynamically print array , on... yes, can post value of textarea , evaluate content php code using eval function , make sure restrict access feature, because it's dangerous if allow random people use it. can simulate online php compiler using ajax calls.

python - Reddit Praw Api usage to search submissions -

basic code: import praw r = praw.reddit(user_agent='getting data!!') r.login("username","password",disable_warning=true) results=r.search('whatever', subreddit=none, sort=none, syntax=none, period=none) x in results: print x i wish write code submissions , comments related. submissions should constrained search query , time period. the problems face that: a. can't understand how specify period in above, documentation tend poor b. don't know if result constrained limit. above code yields: 923 :: reddit, type whatever on mind no matter how insignificant... 5598 :: google maps should have "on way" feature find conve... 3961 :: lpt: if you're overheating whatever reason, run wrists under... 1556 :: lad, whenever mother wanted me , play... 5085 :: "the entire state offline in there fix whatever t... 1259 :: heyy, webcomic "subnormality," artwork cracke... 604 :: iama professional youtuber.

windows - WP8.1 c# Onedrive SDK : download badrequest -

i have project doesn't work when download binarie onedrive png. got bad request in query response. take backup , have same problem. working few days ago have not modify anything. there changne in api ? download xml no problem whith same query. try test apigee console , seems work. has same problem ? got solution ? lot i go response api : statuscode: 400, reasonphrase: 'bad request' for find way here, problem in question result of proxy servers rejecting urls when contain single path segments more 260 characters. unfortunately possible urls onedrive api generates, , we're investigating changes resolve kind of problem. the issue can tracked @ https://github.com/onedrive/onedrive-api-docs/issues/143

Java dir/files list -

Image
i trying list directories , files within directory, while "d:\data" works, "d:\" doesn't. "d" secondary disk. this exception: exception in thread "main" java.lang.nullpointerexception @ java.util.objects.requirenonnull(objects.java:203) @ java.util.arrays$arraylist.<init>(arrays.java:3813) @ java.util.arrays.aslist(arrays.java:3800) @ project.1.scavenger.listf(scavenger.java:19) @ project.1.scavenger.listf(scavenger.java:30) @ project.1.scavenger.listf(scavenger.java:30) @ project.1.main(project1.java:28) java result: 1 build successful (total time: 0 seconds) code: public static list<file> listf(string directoryname) throws ioexception { file directory = new file(directoryname); list<file> resultlist = new arraylist<file>(); // files directory file[] flist = directory.listfiles(); resultlist.addall(arrays.aslist(flist)); (file file : flist) { if

java - How to extends ArrayAdapter to print Parsed JSON? -

Image
i have tried , read many answers can't able figure out how code... newsadapter.java public class newsadapter extends arrayadapter{ private static final string debug_tag = "newsadapter"; private layoutinflater inflater; public newsadapter(activity activity, arraylist<string> items){ super(activity, r.layout.news_feed, items); log.d(debug_tag, "this came world know of" + items); inflater = activity.getwindow().getlayoutinflater(); } @override public view getview(int position, view convertview, viewgroup parent){ return inflater.inflate(r.layout.news_feed, parent, false); } } news_feed.xml <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"> <textview android:id="@+id/title"

css - How to display red borders on required or invalid value input element in Chrome just like Firefox behaviour for HTML5 validation? -

Image
i have bring red borders around input element in chrome on html5 validation of firefox. i have search lot unable find precise answer. of how using css appreciated. thank you. you use :valid pseudo class. to shamelessly copy code https://developer.mozilla.org/en-us/docs/web/css/:valid : input:invalid { background-color: #ffdddd; } form:invalid { border: 5px solid #ffdddd; } input:valid { background-color: #ddffdd; } form:valid { border: 5px solid #ddffdd; } input:required { border-color: #800000; border-width: 3px; } <form> <label>enter url:</label> <input type="url" /> <br /> <br /> <label>enter email address:</label> <input type="email" required/> </form>

java - generate excel sheet using Apache poi with Email Validation -

i generating excel sheet using apache poi email --that means after generating excel if user enter email in cell need validate email below code dvconstraint emailconstraint=null; datavalidation emaildatavalidation =null; emailconstraint=dvconstraint.createcustomformulaconstraint("and(find("+'@'+",$a$2),find(.,$a$2),iserror(find( ,$a$2)))");---->getting error here emaildatavalidation =datavalidationhelper.createvalidation(emailconstraint, addresslist1); emaildatavalidation.setsuppressdropdownarrow(false); sheet.addvalidationdata(emaildatavalidation); when execute method getting following error stacktrace:] root cause org.apache.poi.ss.formula.formulaparseexception: parse error near char 9 '@' in specified formula 'and(find(@,$a$2),find(.,$a$2),iserror(find( ,$a$2)))'. expected cell ref or constant literal @ org.apache.poi.ss.formula.formulaparser.expected(formulaparser.java:188) @ org.apache.poi.ss.formul

Batch files to a different location on a daily basis -

trying write batch file ( windows environment ) take same txt file , copy location on daily basis, can manage, i'm struggling with, how copy different location each day ie:- mon/tue/wed/thur/fri/sat/sun possible ? next code snippet help: @echo off setlocal enableextensions set "filename=the same txt file.txt" set "daynames=sunmontuewedthufrisat" rem current matching day of current week (0-6, sunday being 0): multiplied 3 /f %%g in (' wmic path win32_localtime dayofweek /value^|findstr "=" ') /f %%g in ("%%g") set /a "%%g*3" rem day name (three-chars abbreviation) setlocal enabledelayedexpansion set "dayofweekstr=!daynames:~%dayofweek%,3!" endlocal&set "dayofweekstr=%dayofweekstr%" rem day name (three-chars abbreviation) - approach call set "dayofweektrs=%%daynames:~%dayofweek%,3%%" rem next 2 commands merely echoed debugging purposes echo mkdir %dayofweekstr% 2>n

java - Why is the method in one class of a project not recognizing another class's method? -

i'm trying create java program eclipse simulates small town several people or characters , interactions. i added class - character - has method - meet(character) . however, when try call meet(character) character object in class - location - in same package , project in eclipse results in error: method meet(character) undefined type character. the first chunk of code i'm including location class. includes add method. the second chunk of code character class, including meet(character) , getid() methods import java.util.arraylist; import java.util.collection; import java.util.iterator; import java.util.list; import java.util.listiterator; public class location<character> implements list<character> { private string name; private arraylist<character> occupants; private boolean professional; private int cost; private character owner; private int hours; public location(character o, boolean prof, string n, int c, int h) { name = n; pro

c - Unclear about stdin input issue -

i write piece of code myself understand how things work when stdin , stdout involved. here code: #include<stdio.h> #include<stdlib.h> void prompt(){ int i=0; printf("please select:\n"); //string1 printf("1.input\n2.print\n3.exit\n"); //string2 scanf("%d",&i); switch(i){ case 1: printf("data input!\n"); break; case 2: printf("data printed!\n"); break; case 3: exit(0); case 10: printf("newline detected!"); //string3 default: printf("please input valid number!(1-3)"); //string4 } } int main() { while(1) prompt(); return 0; } what expect code is: prompt me input; then enter number 4,which out of cases; so default case matched , string 'please input valid...'(string 4

Android setadapter Null pointer -

i have following fragment public class tab2 extends fragment { // progress dialog private progressdialog pdialog; // creating json parser object jsonparser jparser = new jsonparser(); arraylist<hashmap<string, string>> contactslist; // url contacts list //private static string url_all_contacts = "http://192.168.100.28/andriod_product_demo/get_all_contacts.php"; // json node names private static final string tag_success = "success"; private static final string tag_contacts = "contacts"; private static final string tag_pid = "pid"; private static final string tag_name = "name"; private static final string tag_type = "type"; listview lv; //..get user id tinydb tinydb objtdb; // contacts jsonarray jsonarray contacts = null; @override public view oncreateview(layoutinflater inflater, @nullable viewgroup container, @nullable bundle savedinstancestate) { view v = inflater.inflate(r.layout.tab2,container,

ggplot2 - Creating stacked barplots in R using different variables -

Image
i novice r user, hence question. refer solution on creating stacked barplots r programming: creating stacked bar graph, variable colors each stacked bar . my issue different. have 4 column data. last column summed total of first 3 column. want plot bar charts following information 1) summed total value (ie 4th column), 2) each bar split relative contributions of each of 3 column. i hoping help. regards, bernard if understood rightly, may trick the following code works example df dataframe df <- b c sum 1 9 8 18 3 6 2 11 1 5 4 10 23 4 5 32 5 12 3 20 2 24 1 27 1 2 4 7 as don't want plot counter of variables, actual value in dataframe, need use goem_bar(stat="identity") method on ggplot2. data manipulation necessary too. , don't need sum column, ggplot sum you. df <- df[,-ncol(df)] #drop last column (assumed sum one) df$event

ios - How to back to previous view controller with parameters in swift -

tableviewcontroller b shows when button in viewcontroller tapped. user selects item in b , led a. used following code go b. how can pass selected item ([int: string]) a? navigationcontroller?.popviewcontrolleranimated(true) below code navigate b a let storyboard : uistoryboard = uistoryboard(name: "main", bundle:nil) let nextviewcontroller = storyboard.instantiateviewcontrollerwithidentifier("categories") as! categorylistviewcontroller self.presentviewcontroller(nextviewcontroller, animated:true, completion:nil) in viewcontroller a class create empty dictionary var dict = [int: string]() now when move tableviewcontroller b viewcontroller a set value dict let storyboard : uistoryboard = uistoryboard(name: "main", bundle:nil) let nextviewcontroller = storyboard.instantiateviewcontrollerwithidentifier("categories") as! categorylistviewcontroller // here pass parameter viewcontroller nextviewcontroller

sorting - Can you sort a mutable Scala collection in place? -

is possible sort arraybuffer, or other mutable scala collection, in place? see arraybuffer.sorted (and sortby) returns new collection, , sorting.quicksort sort array in place doesn't work on arraybuffers. the reason ask i'm using combinebykey in spark build collections of scored objects limited in size (like "top ten" list key). if merge in new object , collection @ capacity, need drop lowest-scored object. use sorted collection priorityqueue or sortedset, don't need keep collections sorted time, in case when collection fills up. so there way sort arraybuffer or listbuffer in place? or there other collection supports appending , sorting in place? i'm sure there's better way this, i'm new scala. there presently no facilities sorting collections in place. said, if expect have sorting extremely rarely, investigate supporting both separately e.g. either[priorityqueue[a], arraybuffer[a]] ; or if expect sorting common should use data struct

c# - EF6, Composite Key, is annotation enough? Or Do I have to also use Fluent API? -

i have 3 entities: public class aspnetuser { public string id {get; set;} } public class event { public int id {get; set;} } public class userevent { [column(order=0), key, foreignkey("aspnetusers")] public string userid { get; set; } [column(order=1), key, foreignkey("events")] public int eventid { get; set; } public datetime enroltime { get; set; } public virtual aspnetuser user { get; set; } public virtual event event { get; set; } } as can see that, userevent relationship table has both userid , eventid 2 tables. my question is: is annotation enough tell ef create 2 foreign keys? or have use fluent api in onmodelcreating() method in dbcontext class? or have create configuration class so? saw in post(it makes me confused): entity framework multiple column primary key fluent api foreignkey("x") guess x should table name rather entity's name, right? e.g. x should aspnetusers(which in database),

swift - How do I fix the error "deviceInputWithDevice is unavailable"? -

i'm "upgrading" app swift swift 2 , came across follow error: 'deviceinputwithdevice' unavailable: use object construction 'avcapturedeviceinput(device:error:)' here code in question: let capturedevice = avcapturedevice.defaultdevicewithmediatype(avmediatypevideo) var input:avcapturedeviceinput let error:nserror? { let input = try avcapturedeviceinput.deviceinputwithdevice(capturedevice) avcapturedeviceinput } catch let error nserror { print(error) } can me understand suggested solution: "use object construction 'avcapturedeviceinput(device:error:)'" , how can implement please? { let input = try avcapturedeviceinput(device: capturedevice) avcapturedeviceinput // moved rest of image capture do{} scope.

Web Deployment Visual Studio2013 IIS 2013 -

Image
i figured out how break mystery of iis publishing, have't been able yet. think time setting output in visual studio. no error code or , need run. here snapshot of local host output.

minimax - How this evaluation function work in a Connect 4 game? (Java) -

i exploring how minimax algorithm can used in connect 4 game alpha-beta pruning. so looking through source code connect4 player strategy , found evaluation function: /** * score of board */ public int score(){ int score = 0; (int r= 0; r < rows; r++) { if (r <= rows-4) { (int c = 0; c < cols; c++) { score += score(r, c); } } else { (int c = 0; c <= cols-4; c++) { score += score(r, c); } } } return score; } /** * helper method score of board */ public int score(int row, int col){ int score = 0; boolean unblocked = true; int tally = 0; //int r, c; if (row < rows-3) { //check unblocked = true; tally = 0; (int r=row; r<row+4; r++) { if (board[r][col] == checkers[1-playertomovenum]) { unblocked = false; } if (board[r][col] == checkers[playert

asp.net mvc - Kendo UI NumericTextBox percentage format -

my problem similar explained in question: kendonumerictextbox percentage formatting but i'm using asp.net mvc wrappers render numerictextbox . i have following editor template render widget: @model double? @(html.kendo().numerictextboxfor<double>(m => m) .format("{0:p2}") .min(0) .max(1) .step(0.01) ) but happening (examples): value show when widget focused: 0.01 -> value show when widget not focused: 10,00% value show when widget focused: 0.63 -> value show when widget not focused: 63,00% value show when widget focused: 0,6345 -> value show when widget not focused: 63,00% value show when widget focused: 5 -> value show when widget not focused: 100,00% what somethinh this: value show when widget focused: 10 -> value show when widget not focused: 10,00% value show when widget focused: 63 -> value show when widget not focused: 63,00% value show when widget focused: 63,45 -> value show when widget not fo

c# - Defining a taxRate and applying it to a user's inputted annual income -

taxrate not exist in current context. how can apply if/else if statements? <!doctype html> <head runat="server"> </head> <body> <form id="form1" name="form1" runat="server"> <div style="text-align: center"> annual income: <asp:textbox id="income" runat="server"></asp:textbox> <br /><br /> number of dependents: <asp:textbox id="dependents" runat="server"></asp:textbox> <br /><br /> <asp:button id="calculate" runat="server" text="calculate tax" onclick="calculate_click" /> <br /><br /> total tax: <asp:textbox id="total" runat="server"></asp:textbox> </div> </form> </body> </html> taxrate problem is, have double , initial value 1. going proble

How to delete an entire array in Ruby and test with RSpec -

i'm new ruby , taking full stack course. 1 of projects building addressbook. have set how add entry addressbook, however, can't seem figure out how delete entry (i make attempt remove_entry method in addressbook class below not having luck). supposed test first rspec, have test fail , write code pass. if didn't include info needed question let me know (rookie here). anyway, here have far: rspec context ".remove_entry" "removes 1 entry address book" book = addressbook.new entry = book.add_entry('ada lovelace', '010.012.1815', 'augusta.king@lovelace.com') book.remove_entry(entry) expect(entry).to eq nil end end addressbook class require_relative "entry.rb" class addressbook attr_accessor :entries def initialize @entries = [] end def add_entry(name, phone, email) index = 0 @entries.each |entry| if name < entry.name break end

javascript - Materialize's Parallax causing Boostrap's Modals/Collapse disappearance on Chrome -

i made website local business in area, found issue on chrome , after extensive googling haven't found else it. page works on firefox , ie, fails in chrome. the page: http://elsolsaleparatodos.mx/ the issue: modals (click white circle green drawings in parallax toggle) flicker above parallax, or disappear instantly. happens mobile collapse menu. when screen resized making collapse menu appear, open said menu , scroll down until parallax comes viewport, menu disappears. what have come far: commenting $('.parallax').parallax(); line on app.css fixes issue, breaks parallax of course. i have tried: - changing materialize.min.js newest materialize.js - checking loading plugin twice - reading materialize's parallax function any... anormalities. i haven't found remote lead, , issue non-existent in other browser i'm out of ideas. i not able find source of problem or why present in chrome, fixed adding following code css: .modal { o

javascript - jQuery draggable won't automatically scroll iframe down -

i have iframe several draggable divs inside. when dragging items want iframe automatically scroll , down when needs to, scrolls up. have tried scroll option set true doesn't work. iframe page following repeated enough allow page scroll ( https://jsfiddle.net/zhm6qjaz/ ): <div class="block-style"> header </div> the main page code ( https://jsfiddle.net/hulr2zkv/ ): <iframe id="editor-frame" src="https://jsfiddle.net/zhm6qjaz/show" style="height:500px; width:100%; border:none;"></iframe> <script>$(document).ready(function() { $('#editor-frame').load(function (event) { var iframe = $('#editor-frame').contents(); iframe.find('.block-style').draggable({ delay: 200, helper: "clone", iframefix: true, iframeoffset: $('#editor-frame').offset(), appendto: 'parent.body',

matplotlib - Regarding plotting a graph in python using matplolib from the input in text file -

i have written python code generates output in form of text file. numbers in result small(of order of 10^-120 ) , written in scientific notation in form 1e-120 in output file. wish plot graph using output in text file. how plot graph? the output in form 1 '\t' 2 stored in text file. wish plot simple x y plot between 2 variables. i asking here since not find related anywhere , new python. thanks. assuming values x -> y mapping (e.g. 1d function), plotting these values simple. if have x values in iterable (i.e. list or array or can iterate over) x , y values in iterable y , need import pyplot , do import matplotlib.pyplot plt plt.plot(x, y) plt.show() the fact values small not problem. however, sake of presentation might want rescale them multiplying values number, 1e120 . edit: see right need import data. easiest way numpy.loadtxt . assuming data written in file in matrix format (one column x, 1 y), data in same format. import numpy np import matplo

Cant install ruby-switch for ruby on rails -

i trying install ruby on rails on ubuntu via bright box. i've installed: sudo apt-get install software-properties-common sudo apt-add-repository ppa:brightbox/ruby-ng sudo apt-get update sudo apt-get install ruby ruby-dev but when try install this: sudo apt-get install ruby-switch i error: reading package lists... done building dependency tree reading state information... done package ruby-switch not available, referred package. may mean package missing, has been obsoleted, or available source e: package 'ruby-switch' has no installation candidate what problem, , how solve it? it doesn't ruby-switch available anymore. that's apt-get informing of. if you're looking way manage versions of ruby, there rbenv or rvm available instead. these 2 approaches more standard , accepted ways switch between ruby version - pick only one .

ios - Retrieving Object ID -

i looking way retrieve information on user in data table using parse ios. new not sure syntax doing so, i'm looking way search username username column in table , retrieve object id user. plan on using object id password column along other information need. here pretty i've been able figure out now: pfquery *query = [pfquery querywithclassname:@"logininformation"]; [query wherekey:@[@"username"] equalto:@"steve"]; however think doing horribly wrong. great! please read this: https://parse.com/docs/ios/guide#users in sections signing up , logging in find sample code need!

javascript - Why does my no-submit (HtmlButton) still submit? -

Image
i want dynamically make rows, exist along @ first hidden, visible. i've tried client-side (jquery) route, have had problems that. i prefer going down server-side (c#) road, , thought had found way accomplish based on this thread , code: htmlbutton btnaddfoapalrow = null; . . . btnaddfoapalrow = new htmlbutton(); btnaddfoapalrow.attributes["type"] = "button"; btnaddfoapalrow.innerhtml = "+"; btnaddfoapalrow.id = "btnaddfoapalrow"; btnaddfoapalrow.serverclick += new eventhandler(btnaddfoapalrow_click); this.controls.add(btnaddfoapalrow); private void btnaddfoapalrow_click(object sender, eventargs e) { try { shownextfoapalrow(); } catch (exception ex) { string s = string.format("exception occurred: {0}", ex.message); // todo: log somewhere } } //// works first time, because causes page reloaded, setting foapalrowsshowing 2 private void shownextfoapalrow() { switch (foapal

android - enable proguard only for remove unused code -

my app using jar libs many methods, in fact used 2-3 methods libs. total size of libs more 2mb. don't need of , want shrink apk proguard. i need enable proguard , configure remove unused code , shrink apk size. don't know how. don't want obfuscate app , etc. shrink final size. i try enable proguard minifyenabled true but got errors , nothing. to shrink application should following: release { proguardfile getdefaultproguardfile('proguard-android.txt') proguardfile 'proguard-shrink-only.txt' proguardfile 'proguard-project.txt' } the proguard-shrink-only.txt should contain following options: -dontobfuscate -dontoptimize the proguard-project.txt should contain project specific keep rules might needed classes used via reflection.

Is there a way to catch 500 errors in django python? -

i catch 500 exception , return http 4xx exception instead. using "except exception" catch exceptions not desired. wondering there way catch 500 errors try: <code> except <exception class>: return http 404 reponse i searched lot couldn't figure out how same. in advance i'm not sure returning 404 instead of 500 idea, can acheive defining custom error handler 500 errors. in urls.py: handler500 = 'mysite.views.my_custom_error_view' in views.py: from django.http import httpresponse def my_custom_error_view(request): """ return 404 response instead of 500. """ return httpresponse("error message", status_code=404)

go - Reading a YAML file in Golang -

i have issue reading yaml file. think it's in file structure can't figure out what. yaml file: conf: hits:5 time:5000000 code: type conf struct { hits int64 `yaml:"hits"` time int64 `yaml:"time"` } func (c *conf) getconf() *conf { yamlfile, err := ioutil.readfile("conf.yaml") if err != nil { log.printf("yamlfile.get err #%v ", err) } err = yaml.unmarshal(yamlfile, c) if err != nil { log.fatalf("unmarshal: %v", err) } return c } your yaml file must hits: 5 time: 5000000 your code should this: package main import ( "fmt" "gopkg.in/yaml.v2" "io/ioutil" "log" ) type conf struct { hits int64 `yaml:"hits"` time int64 `yaml:"time"` } func (c *conf) getconf() *conf { yamlfile, err := ioutil.readfile("conf.yaml") if err != nil { log.pr

php - highlighting all keywords in one string -

i have created code follows: $replace = preg_replace("/($a)/","<b>$a</b>",$search); $output .= '<div>'.$replace.'</div>'; print("$output") $a = keywords matching entries in database $search = phrase entered searching the result phrase highlighting matched keywords shown div boxes independently. here example (assuming "abcde" phrase search, , "ab" , "e" matched keywords): ab cde. abcd e . is possible highlight matched keywords in string within 1 div box? this: ab cd e . if want make replacement few elements, use preg_replace_callback : function makebold($match) { return "<b>" . $match[0] . "</b>"; } $pattern = "/[abe]/"; $str = "abcde"; $output = preg_replace_callback($pattern, "makebold", $str); echo $output;

File Processing with Spark and Cassandra -

right i'm working on loading table cassandra cluster spark cluster datastax cassandra spark connector. right spark program performs simple mapreduce job counts number of rows in cassandra table. set , run locally. the spark program works small cassandra table has string key column. when load in table has columns string id, , blob consists of file data, several errors (futures timeout error in spark workers, java out of memory exception on stdout of driver program). my question whether spark can load elements contain blobs of around 1mb cassandra , perform mapreduce jobs on them, or if elements supposed divided smaller pieces before being processed spark mapreduce job. originally using 'sbt run' start application. once able use spark-submit launch application, worked fine. yes, files under 10 mb can stored column of type blob. spark mapreduce ran 200 rows.

java - Find JMX MBeans using Nashorn javascript jjs -

i trying change value of proxyname in catalina/connector/8009/* connector. problem have following exception when trying find mbean name. exception in thread "main" java.lang.classcastexception: cannot cast java.lang.string javax.management.queryexp @ java.lang.invoke.methodhandleimpl.newclasscastexception(methodhandleimpl.java:361) @ java.lang.invoke.methodhandleimpl.castreference(methodhandleimpl.java:356) @ jdk.nashorn.internal.scripts.script$jmx_test_jjs.:program(jmx-test.jjs:32) @ jdk.nashorn.internal.runtime.scriptfunctiondata.invoke(scriptfunctiondata.java:636) @ jdk.nashorn.internal.runtime.scriptfunction.invoke(scriptfunction.java:229) @ jdk.nashorn.internal.runtime.scriptruntime.apply(scriptruntime.java:387) @ jdk.nashorn.tools.shell.apply(shell.java:394) @ jdk.nashorn.tools.shell.runscripts(shell.java:323) @ jdk.nashorn.tools.shell.run(shell.java:169) @ jdk.nashorn.tools.shell.main

Linear regression in R: invalid type (list) for variable? -

t_x <- rbind( c(0.89, 0.46, 0.45, 0.56, 0.41, 0.44, 0.34, 0.74, 0.75, 0.48), c(0.02, 0.09, 0.16, 0.09, 0.02, 0.17, 0.23, 0.11, 0.01, 0.15), c(0.01, 0.24, 0.23, 0.09, 0.28, 0.14, 0.20, 0.01, 0.15, 0.06), c(18.7, 31.3, 30.0, 20.0, 31.5, 22.0, 25.7, 18.7, 27.3, 18.3), c(26.8, 33.4, 35.1, 25.7, 34.8, 28.0, 31.4, 26.8, 34.6, 22.8), c(42.1, 45.7, 48.3, 39.3, 46.5, 38.5, 41.1, 37.8, 47.8, 32.8), c(56.6, 49.3, 53.5, 46.6, 46.7, 46.7, 50.6, 50.6, 55.9, 43.4), c(70.0, 53.8, 59.2, 56.5, 48.5, 54.1, 53.5, 65.0, 67.9, 49.6), c(83.2, 55.3, 57.7, 57.8, 51.1, 53.6, 49.3, 72.3, 75.2, 51.1)) x <- as.data.frame(t(t_x)) colnames(x) <- c("c1", "c2", "c3", "a1", "a2", "a3", "a4", "a5", "a6") x.labels <- x[,1:3] x.training <- x[,4:9] i trying build linear models of c1, c2, c3 form a1-a6.

android - Scroll more than one item in ViewPager -

i trying scroll more 1 item in viewpager per swipe. have implemented carousel viewpager setting pageradapter 's getpagewidth() return .33f . , trying scroll 3 items per swipe. have tried incrementing position in viewpager.onpagescrolled() . isn't working. viewpager not answer. need horizontalscrollview paging. enables when flinging swipe multiple pages doesnt stop in middle of page. in case u still want viewpager - read this

javascript - legend click in highcharts to disable other series -

i want disable or hide 1 series when other series hidden or disabled . example: have 3 columns cluster chart(ex: a,b & c) when click on legend 'a', should disable both series 'a' , 'c'. i've tried legenditemclick event in highcharts , failed hold on other series(c).

c# - CodeDOM compilation no errors but fails to launch console -

i have created project , want compile using codedom compiler. have folder full of .cs files should compiled exe. application supposed console application although fails launch console. there no building errors. following compile method: public static void build(string assemblyname, string outputdirectory, string[] sourcefiles) { codedomprovider codeprovider = codedomprovider.createprovider("csharp"); compilerparameters parameters = new compilerparameters(); parameters.generateexecutable = true; parameters.generateinmemory = false; parameters.referencedassemblies.add("system.dll"); parameters.referencedassemblies.add("system.data.dll"); parameters.referencedassemblies.add("system.xml.dll"); parameters.outputassembly = outputdirectory + @"\" + assemblyname + ".exe"; parameters.compileroptions = "/unsafe

r - How can I Plotting temporal data of 3 different areas? -

i plot temporal data reason i'm not getting plot clearly. use function: plot(temperature~month*area, data=mydata) but function don't separate areas. my example is: area month temperature d1 november 18,723 d1 november 16,963 d1 november 22,753 d1 november 30,495 d1 november 26,818 d1 november 22,944 i1 november 18,485 i1 november 17,368 i1 november 16,844 i1 november 24,171 i1 november 28,072 i1 november 28,766 i1 november 25,744 i1 november 22,920 c1 november 17,272 c1 november 16,225 c1 november 16,058 c1 november 22,920 c1 november 28,642 c1 november 26,

java - How to pass raw JSON as a response from Restful service? -

i have restservice in returning json response shown below. below code: import javax.ws.rs.get; import javax.ws.rs.path; import javax.ws.rs.produces; @get @path("/json/lime") @produces(mediatype.application_json) public dataresponse getdata(@context datainfo info) { // code here system.out.println(resp.getresponse()); return new dataresponse(resp.getresponse()); } below actual json response after hitting restful service: { "response": "{\"abc\":100,\"pqr\":\"40\"}\n", } and gets printed out system.out shown above: {"abc":100,"pqr":"40"} here dataresponse class: public class dataresponse { private string response; public dataresponse(string response) { this.response = response; } public string getresponse() { return this.response; } } as can see, response string getting escaped in above json. , not sure why? can me unde

meteor - createuser validation error on method with aldeed collection2 -

folks, i need help. i've been @ sometime , cant seem figure out. should simple. i'm using aldeed collection2 , cant seem past validation error being thrown create user account method. schema pretty standard, attached meteor.users collection: schema={} //simpleschema.debug = true; schema.userprofile = new simpleschema({ picture: { type: string, optional: true }, updatedat: { type: date, autovalue: function() { if (this.isupdate) { return new date(); } }, denyinsert: true, optional: true }, roles: { type: string, optional: true } }); schema.user = new simpleschema({ _id: { type: string, regex: simpleschema.regex.id, optional: true, denyupdate: true }, emails: { type: [object], optional: true }, "emails.$.address": { type: string, regex: simpleschema.regex.email, label: "" }, "emails.$.verified": { type: boolean,