Posts

Showing posts from June, 2011

org.apache.hadoop.hbase.DoNotRetryIOException: java.lang.IllegalAccessError: class com.google.protobuf.HBaseZeroCopyByteString cannot -

getting below exception while executing hbase client inside spark job:org.apache.hadoop.hbase.donotretryioexception: java.lang.illegalaccesserror: class com.google.protobuf.hbasezerocopybytestring cannot set spark configuration => spark.driver.extraclasspath", "hbase-protocol-0.96.2-hadoop2.jar. code: .setconf("spark.driver.extraclasspath", "hbase-protocol-0.96.2-hadoop2.jar")

javascript - Show different divs from different buttons with same class -

i have (currently) 3 buttons <p><button class="trigger-overlay" type="button">open overlay 1</button></p> <p><button class="trigger-overlay" type="button">open overlay 2</button></p> <p><button class="trigger-overlay" type="button">open overlay 3</button></p> with these buttons, want show different menus/overlays. overlays looks this: <!-- menu1 --> <div class="overlay overlay-hugeinc"> <button type="button" class="overlay-close">close</button> <nav> <ul> <li><a class="menuitem1">menu1</a></li> <li><a class="menuitem2">item2</a></li> </ul> </nav> </div> <!-- menu2 --> <div class="overlay overlay-hugeinc"> <but

java - JavaFX doesn't change the font of its components -

i specified font in style .css file: -fx-background-color: #1e1c1e; -fx-font-family: "segoe ui", helvetica, arial, sans-serif; but idea underlines second line: "mismatched property value null". tried set font in following way: inputfield.setfont(font.font("segoe ui")); all same. font won't change. i'd ask because i'm stucked issue.

c# - Attach VS debugger to executable file instead of running instance -

i'm trying attach vs debugger 1 of own applications running installation directory in release configuration. when app runs, shows messagebox saying app launched invalid command line arguments. these arguments have been passed app shell when associated file (*.myappfileextension) double clicked. the installer configures shell send these command lines. now has gone wrong , cannot seem set breakpoint after attaching vs debugger instance of app. allows setting breakpoint @ call messagebox.show time attach, call has been executed. no breakpoints settable after point. the error says breakpoint failed bind. the question is, possible debug release version without going trouble of compiling , installing debug version? also, possible vs debugger launch executable valid breakpoints may hit? edit: in case relevant, call messagebox.show last line of code. why breakpoints not settable @ closing braces follow? if can modify code, easiest way handle add debugger.lau

Django CSV file -database upload error -

i have csv file , trying populate them sqlite database. have no error message , works fine loads last line of file. md= md() database = options.get('database') filename = options.get('filename') datareader = csv.reader(open(filename)) row in datareader: if row[0] != 'id': bb= 1 if row[3] == 'yes' else 0 pro = 'yes' if row[4] == 'pro' else 'no' md.id = row[0] md.mol = row[1] md.phase = row[2] md.warning = black_box md.pro = pro md.status = type.objects.get(description=row[5]) md.name = row[6] md.stem = row[7] md.year = row[8] md.iname = row[9] md.iyear = row[10] print row[1], row[2],row[3],row[4],row[5],row[6

javascript - How to bind an array of objects in Polymer 1.0? -

i have menu calls iron-ajax content of page, content html file has polymer element requested, works fine. problem have change icons in paper-toolbar depending of content requested. works fine in polymer 0.5, in polymer 1.0 doesn't work. here dom-repeat put icons in dom <template is="dom-repeat" items="{{content.contextualbuttons}}" as="button" id="repitebotones"> <paper-icon-button contextual-action="{{button.action}}" icon="{{button.icon}}" on-tap="{{oncontextualbuttontap}}"></paper-icon-button> </template> this function observer mutations, didn't function, can't understand function does. attached: function () { var self = this; this.mo = new mutationobserver(function (mutations) { mutations.foreach(function (m) { (i = 0; < m.removednodes.length; i++) {

python - socket.gethostbyaddr giving different returns -

i'm using python 2.7.9 , while trying use socket.gethostbyaddr , found perplexing behavior. my local computer has public ip, let's 111.111.111.111. if use on remote computer: import socket socket.gethostbyaddr('111.111.111.111')[0] i 'mycomputer.com' . however, using same command on local computer (or using 127.0.0.1 instead of public ip), instead 'mycomputer.com' . why there difference in capitalization? gethostbyaddr query hosts file - /etc/hosts on linux; windows has equivalent @ %systemroot%\system32\drivers\etc\hosts (location may vary older versions of windows) from remote computer, gethostbyaddr doing dns lookup , getting mycomputer.com. on local computer getting answer hosts file, contains upper case version of hostname.

java - Read multiple csv file with CsvJdbc -

i need bind group of csv file in format "yyyy-mm-dd hh:mm:ss.csv" present in same folder unique table contains data present in files. i need read data java ee application create connection pool inside application server. found csvjdbc driver allows reading of multiple files single entity. starting point this page in section paragraph: to read several files (for example, daily log files) single table, set database connection property indexedfiles. following example demonstrates how this. the example fine me problem not have header word in filename string. corresponding table becames empty string makes impossible query table. how can tell driver map pattern table hasn't header part? p.s. tried use hsqldb frontend csv files not support multiple files. setup csvjdbc read several files described in http://csvjdbc.sourceforge.net/doc.html , use empty table name in sql query because csv filenames not have header before filetailpattern regular express

Linux How to check process scheduling policy & Priority? -

i want check scheduling policy & priorities of threads without programming it. is there way top or other command ? in top, can see pr column (which priority) how can scheduling policy ? thanks you can find looking on /proc/<your_pocess_id>/sched. for example: awk '/policy/ {print $nf}' /proc/8888/sched that should return policy process id 8888 you try chrt -p 8888

objective c - iOS Storyboards - How to re-use a View Controller -

Image
i have application takes through multiple steps (5-6 steps) @ end of have newly registered account. using storyboard , lot of these steps have similar (or identical) layouts , objects , elements within them. right doing creating new view controller each of these steps , altering data within them pertain specific step. when @ storyboard, feel has way optimize don't have many identical view controllers beside 1 another. as can see there 5 view controllers identical , looking way condense these single view controller or perhaps 5 view controllers access single view contains variety of elements see in image. appreciated. in advance! if view controllers' same no need create multiple view controllers. you can create 1 view controller , change view or content of view per requirement. hope helps

parse.com - In cloud code seems impossible to use Parse.Config.get() with express is it correct? -

is there way use parse.config.get() inside expressjs app hosted in cloud code? looks easy use parse.object , parse.user parse.config.get() code not deployed using "parse deploy" we manage use adding jssdk in html , using "frontend js" haven't find way use in directly in express controllers. thanks it seem related kind of permissions issues... var parse = require('parse-cloud-express').parse; var util = require('util') parse.cloud.define("currentconfig", function(request, response) { console.log('ran currentconfig cloud function.'); // why have this? parse.initialize(xxx, yyy); parse.config.get().then(function(config) { // never called // ... console.log(config.get('xxx')) }, function(error) { console.log(util.inspect(error)) }); }); output ran currentconfig cloud function. { code: undefined, message: 'unauthorized' } edited code work me: var parse = requi

numpy - Meijer G-function in Python and scipy -

Image
i'm in need of meijer g function in scipy. read somewhere on internet due generality, meier g function not supported special function in scipy, should write according personal use case. my problem have no experience whatsoever complex integration. latex forbidden here, here's i'm trying solve numerically: (the first line being general case, second line case i'm trying compute), p(a), k, k2 given as wikipedia states , there 3 ways l : l runs −i∞ +i∞ such poles of Γ(bj − s), j = 1, 2, ..., m, on right of path, while poles of Γ(1 − ak + s), k = 1, 2, ..., n, on left. l loop beginning , ending @ +∞, encircling poles of Γ(bj − s), j = 1, 2, ..., m, once in negative direction, not encircling pole of Γ(1 − ak + s), k = 1, 2, ..., n. l loop beginning , ending @ −∞ , encircling poles of Γ(1 − ak + s), k = 1, 2, ..., n, once in positive direction, not encircling pole of Γ(bj − s), j = 1, 2, ..., m. how l , solve integral? way i'm used compute integrals on

javascript - How to scrollToElement using angular-scroll? -

i'm using angular scroll , once hit page fire function scroll id. i'm getting following error on code below: typeerror: $document.scrolltoelement not function inithelp(); function inithelp() { console.log('inithelp'); $document.scrolltoelement('#chart-help', 500).then(function() { console && console.log('you scrolled chart-help!'); }); } the docs angular-scroll .scrollto( element [, offset, [, duration [, easing ] ] ] ) alias of .scrolltoelement. .scrolltoelement( element [, offset, [, duration [, easing ] ] ] ) figured out: var charthelp = angular.element(document.getelementbyid('chart-help')); $document.scrolltoelement(charthelp, 30, 500).then(function() { console && console.log('you scrolled chart-help!'); }); also docs, missing offset number: $document.scrolltoelement(someelement, offset, duration);

Powershell script only converting last sAmAccountname to name -

just wrote quick script below convert samaccountname name. converts last samaccountname in list. why? doing wrong? $users = get-content .\tempuser.txt $results = @() foreach($user in $users) { $result = get-aduser -identity $user | select name, samaccountname } $result | out-file .\test12.txt change following line adding plus: $result += get-aduser -identity $user | select name,samaccountname

visual c++ - OPOS_E_NOSERVICE after return from DllGetClassObject() in simple ATL COM OPOS Service Object -

an example msr opos service object writing not initializing properly. adding question others run same problem since various searches resulted in no whatsoever. my question is: how can determine method in opos service object missing? there utility of kind can exercise opos service object , tell me missing? there way determine methods interface expected provide , missing? i following procedure in writing opos service object using atl in order learn how opos service object created. using visual studio 2005 under windows xp. test basic functionality using ncr retail services manager (rsm) utility create profile msr in order test basic functionality of mag stripe reader simulator service object. the visual studio project creates com object , registers properly. when attempt use diagnostics function of rsm on service object profile receive error of opos_e_noservice . have created log file logging function in com object shows service object loaded, dllmain() function of com obje

Regex - Not null parameter -

i use expression check if paramater is null or not null : ^$ but opposite want. how can check if not null ? how can check if not null? use regex make sure @ least 1 character there in input (non-empty): /./

How to solve OverflowError: Python int too large to convert to C long with opencv? -

__author__ = 'kyle' help_message = """script: frame_grabber.py usage: python frame_grabber.py path/to/video requires: opencv 2.4.8+ purpose: select , save frames given video. commands: key function previous frame d next frame q exit shift + skip 10 frames forward shift + d skip 10 frames backwards s saves current frame dbl click saves current frame controls: slider navigate through video """ # check if user has provided path file # otherwise display help_message import sys import time t # check if opencv module present # otherwise stop application try: import cv2 except importerror e: print "fatal error: not import opencv, ", e exit(-1) else: print "using opencv ", cv2.__version__ # these flags may depend on opencv version: # in opencv 3.0.0 these flags implemented # cv2.cap_prop_pos_

google analytics - How to build this GA report -

i using google analytics track downloads of documents site using code when link clicked: $('.nb_dl, .res_dl').on('click', function () { var url = $(this).attr('href'); var value = $(this).attr('rel'); ga('send', 'event', 'downloads', 'click', value); document.location = url; }); where value formulated rel attribute this: rel="document name | userid | eventid" (the eventid has nothing ga event being tracked) how can build report export show downloads of documents names? or think there better way track these , build reports types of documents (document names)? here's sample report using query explorer should show results: the query params use this: start-date: 30daysago end-date: today metrics: ga:totalevents dimensions: ga:eventcategory,ga:eventaction,ga:eventlabel sort: -ga:totalevents filters: ga:eventcategory==downloads;ga:eventaction==click the key thing noti

javascript - Prevent panel collapse on heading child element click -

i have prepared demo here . i want toggle panel body clicking on panel heading. if there buttons in heading, them not toggle panel body, how can this? source code: html <div class="panel panel-default"> <div class="panel-heading clearfix" data-toggle="collapse" data-target="#body"> <span>text</span> <button class="btn btn-default pull-left">button</button> </div> <div class="panel-body collapse" id="body"> asd </div> </div> p.s.: apologize if has been asked already, it's hard me form title find problem. $('.panel-heading .btn').click(function (e) { e.stoppropagation(); }); demo of course, affect intended function of button well. explain better answer.

c++ - Boost condition variable -

i use boost condition variable synchronization mechanizm, in case: boost::condition_variable cond; boost::mutex mutex; void worker_func() { cond.notify_all(); std::cout << "after notify" << std::endl; } void main() { boost::mutex::soped_lock lock(mutex); boost::thread work(worker_func); boost::this_thread::sleep_for(boost::chrono::milliseonds(500)); cond.wait(lock); // here deadlock } when 'fire' condition before wait condition there deadlock. if there solution write wrapper provide bool atomic 'remember' condition fired or there other better way ? example of wrapper: class cond_wrap { private: boost::condition_variable cond; boost::mutex mutex; bool work_to_do; public: cond_wrap() { boost::mutex::scoped_lock(mutex); work_to_do = false; } void notify_all() { boost::mutex::scoped_lock(mutex); work_to_do = true; con

android - How to get userinput in java language in eclipse? -

i new here , interested in making android app's. how expert's shall join me in making , resolving app , making concept clear hit problem ? is user input in java through import untility scanner file or there function available ? import java.util.scanner; i think java command line argument same work scanner utility ??? bufferedreader(new inputstreamreader(system.in)); or alternately u can go java.util.scanner

asp.net - subdomain does not work with default route -

i have created sub-domain route class in routeconfig.cs as: public class subdomainroute : routebase { public override routedata getroutedata(httpcontextbase httpcontext) { if (httpcontext.request == null || httpcontext.request.url == null) { return null; } var host = httpcontext.request.url.host; var index = host.indexof("."); string[] segments = httpcontext.request.url.pathandquery.trimstart('/').split('/'); if (index < 0) { return null; } var subdomain = host.substring(0, index); string[] blacklist = { "www", "yourdomain", "mail","localhost" }; if (blacklist.contains(subdomain)) { return null; } string controller = (segments.length > 0) ? segments[0] : "home

java - JavaFX Chart to Image to Base64 String use in PHP -

i'am using javafx , illustrate chart linechart concept in javafx. if draw chart, export screenshot of this code. writableimage image = lc.snapshot(new snapshotparameters(), null); file file = new file("chart.png"); try { imageio.write(swingfxutils.fromfximage(image, null), "png", file); } catch (ioexception e) { //bla } this works perfect! now: there simple way create "writableimage" image base64 string? furthermore want use reproduce base64-string png file in php. any ideas? thx your code need continue this: //file file = new file("chart.png"); -> there fileinputstream fis = new fileinputstream(file); bytearrayoutputstream baos = new bytearrayoutputstream(); byte[] buffer = new byte[1024]; int read= 0; while( (read = fis.read(buffer)) > -1){ baos.write(buffer, 0, read); } fis.close(); baos.clos

c# - Using multiple dynamically created databases in project -

after surfing on stackoverflow found out, there many projects uses multiple databases. in project create them dynamically. referring this answer given reason (construction erp, 1 database 1 client) important enough? can give pros , cons of project structure? the whole application architecture depends project sale model. if host database clients (eg. of them prefer host database in environment), recommend stay 1 database cover customers operate. i've worked on erp system dedicated 2 clients, database hosted on our environment data separated between customers. did adding 1 additional table "customer" , every entity differs customers has foreign key table. if asked me performance, said it's not problem @ - creating proper indexes on tables, delete old unnecessary data , deployment of kind of caching server between application , database deal it. had database approx. 120gb on disk, , tables had approx 84 mln. records. (i've worked database sized 2tb

android - Making simple UI change animations. Pop-ups sliding from the edge of the screen -

Image
the questions quite faq-type, can't find suitable tutorial , don't know search for 1) i've got list filled linearlayouts , need set animation elements added layouts shown on image. animation element slides under existing layout elements. if element removed, animation same reversed 2) there screen filled elements. tapping, example, button, call pop-up, comes edge of screen , above rest of elements. if tap anywhere, except pop-up, a) slide back b) interact objects pop-up not cover what makes such effects possible? how implement them , what read about ? for 1) setting animatelayoutchanges=true linearlayout should job for 2) can open dialog on button click , customise animations dialog calling dialog.getwindow().setwindowanimations('id of animation xml')

Python vlookup issue -

i'm trying use python-vlookup , following script: ### python_vlookup import python_vlookup faster_vlookup csv_rows = python_vlookup.get_csv_data('example.csv') column_dict = python_vlookup.create_column_dict(csv_rows,1) ### lookup_value = 'outdoor/accessories' lookup_list = ['bed-and-bath/accessories','bed-and-bath/storage-and-hampers/storage','decor-and-pillows/rugs/hide'] print python_vlookup.vlookup(lookup_value,'example.csv',2) print python_vlookup.vlookup(lookup_list,'example.csv',3) print python_vlookup.faster_vlookup(lookup_list,column_dict) but error: ioerror: [errno 2] no such file or directory: 'example.csv' how put file in directory resolve problem? either start using full paths (recommended), such as: csv_rows = python_vlookup.get_csv_data('c:\\users\\youruser\\desktop\\example.csv') or can move example.csv file main script directory. aka need reside in same folder,

java - Set JTable not editable -

i want make table uneditable. tried doesn't work : public mymodel model = new mymodel(); // here declaring model import javax.swing.table.abstracttablemodel; // other class model public class mymodel extends abstracttablemodel { public boolean iscelleditable(){ return false; } @override public int getcolumncount() { // todo auto-generated method stub return 0; } @override public int getrowcount() { // todo auto-generated method stub return 0; } @override public object getvalueat(int rowindex, int columnindex) { // todo auto-generated method stub return null; } } but gives me error when using line : says method undefined mymodel class model.addrow(row); i did . public defaulttablemodel model = new mymodel(); public class mymodel extends defaulttablemodel { /** * */ private static final long serialversionuid = 1l; public bo

javascript - Show and hide two icons by clicking an anchor -

this question has answer here: why jquery or dom method such getelementbyid not find element? 6 answers it possible show , hide 2 icons clicking anchor?? have foundation accordion , need when click on tabs (they anchors) icon displayed disappear , viceversa. don't know why browser console tells me 'addeventlistener' of null, because element exist an anchor. javascript if not possible i'll use jquery. i've tried without succes. <dd class="accordion-navigation"> <a href="#panel1a" class="tab-table" role="tab" id="panel1a-heading" aria-controls="panel1a" id="first-tab-accordion">subastas activas <i class="fa fa-chevron-down styled-tab-icon arrow-content-hidden" id="arrow-content-hidden-first"></i> <i class="fa fa-chevr

php - How to wrap selection in quotes using PhpStorm? -

Image
i have 2 different machines both using phpstorm. 1 has feature enabled, can select text , pressing ' become 'text' : yet other 1 erase text: i have forgotten how set up. can enable feature? the option hiding under: editor > general > smart keys: surround selection on typing quote or brace

string - Java Parsing outputted message -

i need parse strings in efficient way. have line d[date-string] t[time-string] n[name-string] m[message-string] needs parsed 4 strings respectively, private string time; //would equal time-string private string date; //would equal date-string private string name; //would equal name-string private string message; //would equal message-string is there easy way this? you can use regex , groups match , extract kind of data: example, like: pattern p = pattern.compile("d(\\w+) t(\\w+) n(\\w+) m(\\w+)"); matcher m = p.matcher(yourstring); if (m.matches()){ string d = m.group(1); string t = m.group(2); string n = m.group(3); string w = m.group(4); } the patterns within parentheses saved groups, can extract after match (it starts 1, since 0 whole match). have change characters , patterns want accept.

templates - wso2 - check if a sequence really exists -

i have scenario in esb wso2: a variable stored in registry called version s1 -> sequence of version1 s2 -> sequence of version2 serror -> sequence in case of error if version == 1 s1 called if version == 2 s2 called if version empy s3 called now issue is: if version == 3 got error: sequence named value {name ='null', expression =get-property('seqname')} cannot found beacuse s3 doesn't exist my question is: way check if sequence exists? thank you! regards claudio there no way check existence of sequence through existing mediators. if need that, can write class mediator , check synapseconfiguration object. case, can use switch mediator , add default case default sequence notify request has not supported version. <switch> <case 1> <seq1> <case 2> <seq2> <case default> <seqdefault> </switch>

oracleforms - Extract/Export configuration from oracle 6i forms -

i have oracle forms 6i app right on windows xp. using ms-access odbc. noob oracle forms. now want move app on pc. how can export configuration of current oracle forms. if have queries system , app please let me know . i have installed oracle 6i forms on new machine, , when running app showing ora03121 error. please follow steps: install 6i runtime on mentioned pc. configure tns file previous pc. create ms-access odbc previous pc. hope problem solved.

android - LRU caching of images in gridview is not working -

ive read , watched every possible tutorial caching of image couldnt find solution this. using async tesk load images gridview cells. 1-inside gridview of adapter checking if bitmap found in cache before calling loading task. 2-in asynctask im saving loaded bitmap cache. cache empty bitmaps not saved. im posting adapter , asynctask. note: used exact tutorial of android developers http://developer.android.com/training/displaying-bitmaps/cache-bitmap.html#config-changes in advance public class fragmentcelladapter extends baseadapter { public fragmentcelladapter(context context,string json,int test){ mcontext=context; this.json = json; //something use in code s = test; try { this.jsonarray = new jsonarray(json); } catch (jsonexception e) { e.printstacktrace(); } final int maxmemory = (int) (runtime.getruntime().maxmemory()/1024 ); // use 1/8th of available memory memory cache. final int cachesize = maxmemory / 8;

qt - QProcess failed to start: the file name or extension is too long -

i have problem, code qprocess *process = new qprocess(this); process->setenvironment(qprocess::systemenvironment()); process->setstandarderrorfile(getabsolutepath("logs")+"mylog.log",qiodevice::append); process->setprogram(program); process->setarguments(arguments); //loop qeventloop loop.connect(process, signal(finished(int, qprocess::exitstatus)), this, slot(finalprocess(int, qprocess::exitstatus))); process->start(); qdebug()<<process->program()<<process->arguments(); if(!process->waitforstarted(3600000)) { mylog.addmessage(process->program()+" "+process->errorstring()); } loop.exec(); process->close(); delete process; process = null; this code function called inside loop , works n times (for example need n = 100 code crash in n=17) until crash output (process->errorstring()) qprocess failed start: file name or extension long. then changed path other more short, saw how n more h

jquery - Checkbox Selected Values Get in Browser URL using Javascript -

i need check box selected values in browser url execute query per selection base. html code <div style="width:200px; float:left"> price <div> <input type="checkbox" name="price" value="0-1000" class="filters" />0-1000<br /> <input type="checkbox" name="price" value="1000-2000" class="filters" />1000-2000<br /> <input type="checkbox" name="price" value="3000-4000" class="filters" />2000-3000<br /> </div> colors <div> <input type="checkbox" name="colors" value="red" class="filters" />red<br /> <input type="checkbox" name="colors" value="green" class="filters" />green<br /> <input type="checkbox" name="colors" value="blu

r - Changing legend label in googleVis charts -

Image
how change default legend labels in googlevis chart? what have tried i see there labelinlegend setting, , can hardcode options see below: library(data.table) library(googlevis) test.dt <- data.table(day = c(1,2,3), value = c(0.8,1.2,1.2), price = c(1,1.1,1.2), name = c("a","a","a")) # set chart options in hamfisted hardcoded way testop <- list(series = "[{labelinlegend: 'a price'}, {labelinlegend: 'a value'}]", legend = chart.op$op.legend) testplotdatay <- c("price", "value") plot(gvislinechart(test.dt, xvar = "day", yvar = testplotdatay, options = testop)) to get: but how make work in parameterised way ? do still need send in json string googlevis as old answer suggests , or there easier way? example, googlevis support

ruby on rails - Marking Related Models Deleted -

i have following models note has_many replies when delete notes want automatically update replies following columns deleted_at: time.now status: 2 is there anyway automatically callbacks? if want mark notes deleted_at well, paranoia gem solves problem https://github.com/radar/paranoia , can recursively restore associated objects. if wanted change status - have use callbacks - whther own or through state machine transitions (aasm).

salt stack - SaltStack : Identify environment with DNS record -

i have multiple isolated environments setup saltstack. have created base states , custom states each environment. moment, way can identify environment requesting txt record on dns server. there way can select right environment in saltstack. how can put information in pillar or grain? salt's dig module might here. can use query information dns records. needs command line dig tool installed. use command line: salt-call dig.txt google.com to produce output this: local: - "v=spf1 include:_spf.google.com ~all" use salt state put grain: # setupgrain.sls mygrainname: grains.present: - value: {{ salt['dig.txt']('google.com') }} once have information in grain can select salt nodes on grain information using matchers .

How to run an EXE program from a Windows Service using C# -

i want run exe file windows service using c# , i'm using code in onstart() service's method. process myproc = new process(); myproc.startinfo.filename = "...\\myexe.exe"; myproc.start(); myexe.exe simple console application launch console text. when start windows service can see myexe.exe in background processes, there no console shown on desktop. what can wrong ? windows services won't display interface default, if launch separate program. when configure service, need check "allow service interact desktop" checkbox on log on tab. opening command line application not elegant of solutions, , avoid doing if could.

jsf - How to pass bean property from one view to another view -

i'm using jsf 2.1 , primefaces: i have view scoped managed bean managed property , method set on other view scoped managed bean , forward other page referencing managed bean: @managedbean @viewscoped public class hellomb { @managedproperty("othermb") private othermb other; public string changeothermb() { othermb.setanyobject(new object()); return "otherpage.xhtml"; } } @managedbean @viewscoped public class othermb { private object o; public void setanyobject(object o) { this.o = o; } } so, when otherpage rendered o null. you have idea how solve this? how can retain object in @viewscoped managed bean , keep live on other page without using @sessionscoped ? the view scope destroyed , recreated once navigate different jsf view. know, view scope lives long you're interacting same jsf view. in particular case end 2 instances of #{othermb} managed bean during 1 request. 1 instance used sourc

collections - Will Updating a document key values uses more space in Mongodb -

in mongodb if continuously update key values of document in collection, consume more space? if update value 100 thousand times, space wasted on hard disc. basically won't use more space writes happens in place, if new value doesn't require more space won't have allocate more. rapid updates - mongodb writes lazy can group multiple writes 1 physical write disk. you can find more info here please note if have logging enabled, use more disk space, depends on configuration. mongodb dbstats provide database storage usage, try use it.

performance - Efficient replacement for for-loop when splitting strings in R -

i have large dataframe (20 columns, >100k rows) , need split column of character strings multiple new columns. the first 3 observations of column in question this: scans <- data.frame(scan = c("ct cervical sp,ct head plain", "ii < 1 hour", "l-s spine,l-s spine")) which looks this: scan 1 ct cervical sp,ct head plain 2 ii < 1 hour 3 l-s spine,l-s spine i need split 5 columns (there maximum of 5 substrings in each observation), , observations fewer substrings want remaining columns filled nas. using code: scans <- data.frame(scan = c("ct cervical sp,ct head plain", "ii < 1 hour", "l-s spine,l-s spine")) for(i in 1:nrow(scans)){ scans$scan1[i] <- strsplit(scans$scan, ",")[[i]][1] scans$scan2[i] <- strsplit(scans$scan, ",")[[i]][2] scans$scan3[i] <- strsplit(scans$scan, ",")[[i]][3]

html - Disable hover for different screen size -

i have 7 images , 7 images zoomed when mouse on over it. style want apply desktop version. unfortunately, when use @media screen other platforms, still work make unresponsive page on other platforms. html: <div class="first container text-center" id="background"> </div> <div class="second container text-center" id="background"> </div> css: .first-body { background: url(../../images/mango_copy.jpg) no-repeat; background-size: cover; background-position: top center; top: 250px; z-index: 10016; width: 800px; height: 400px; position: relative; } first-body:hover { height: 400px; background-size: 800px; -webkit-transform: scale(1.1, 1.1); -moz-transform: scale(1.1, 1.1); opacity: .9; -webkit-opacity: .9; -moz-opacity: .9; transition: .3s ease-in-out; } you can apply hover css above 980px in media @media (min-width: 980px) { first-body:hover{ height:400px; b

android - RuntimeException: Unable to start activity when requesting action bar -

i getting following warning , exception: illegalstateexception activity has action bar supplied window decor. not request window.feature_action_bar , set windowactionbar false in theme use toolbar instead. runtimeexception: unable start activity componentinfo{com.mdinfosystem.mymobileapp/com.mdinfosystem.mymobileapp.bill_payment}: java.lang.illegalstateexception: activity has action bar supplied window decor. not request window.feature_action_bar , set windowactionbar false in theme use toolbar instead. if using toolbar, specify theme.appcompat.noactionbar as parent in activity's styles.xml. , in activity use this: toolbar toolbar = (toolbar) findviewbyid(r.id.toolbar); setsupportactionbar(toolbar); note: activity should extend appcompatactivity

java open file from classpath with a space character in it -

i have webapp hosted in tomcat, , jenkins build server. i've read best way read file bundled jar, use classpath rather hardcoded fullpath. i see variant of recommended way: this.getclass().getresourceasstream("/testfile.txt"); and seems work locally, on jenkins linux build server, setup build in directory containing space, getresourceasstream() fail because internally fails lookup file, since path contains contains space, gets translated %20. thus, see 2 possibilities, either: everyone suggesting use getresourceasstream() wrong, , robust use handles paths spaces in it, need more before calling getresourceasstream() the getresourceasstream contains bug i guess first option, question is, what's correct way handle this?

javascript - "Row given with size different than 3" Google Charts -

i'm using google charts inside of system called klipfolio. been tinkering days. curious if else has tried same. issues isn't particular kipfolio figured little bit of background may go long way. this code: var _component = this; var _datamodel = this.datamodel; var thearray = $.map(_datamodel, function(value, index) { return [value]; }); var thearrays = ('['+thearray.tostring()+']'); var datadone = (json.parse(thearrays)); console.table(datadone); google.setonloadcallback(drawchart); function drawchart() { var data = new google.visualization.datatable(); data.addcolumn('string', 'from'); data.addcolumn('string', 'to'); data.addcolumn('number', 'weight'); data.addrows([datadone]); // sets chart options. var options = { sankey: { iterations: 700, node: { label: { fontname: 'arial', fontsize: 12, color: 'rg

javascript - Wordpress: Change styling according to get_post_custom() field -

this post wordpress page/text styling: of posts in hebrew, in english. if use font arial english letters looks bit bigger hebrew letters, 1pt wondering if there way apply font-size lower 1pt english letters of font. i think of solution: use get_post_custom() custom field created english-language posts , if field language='english' echo '...addclass('english') to page class english` has font-size smaller 1pt. solution quite horrible in opinion, believe there simpler way done. any ideas? edit: current solution, better solutions of course welcome :) <?php $language_field = get_post_meta(get_the_id(), 'language', true); if(strcmp($language_field,'english') == 0) { echo '<script>'.php_eol; echo ' $(document).ready(function() {'.php_eol; echo ' $("#main h1").css("font-size",parseint($("#main h1").css("font-size"))-6);'.php_eol; echo '

How to write true type font information in AFP file? -

if use raster or outline fonts in afp printing writes font information in afp output file. can see through afp file viewer. if use true type font in afp don't font information correctly. have used ebcdic raster , outline fonts. , truetype / opentype fonts encoded utf16be. can please in this, how write true type font information in afp file format?

SQL Server : set variables with an if statement -

i 2 values passed variables: @f_start_date_dt varchar(50) @f_end_date_dt varchar(50) and have other parameter declarated: declare @ssql nvarchar(4000) i check if first 2 variables null , correctly: select case when @f_start_date_dt or @f_end_date_dt null set @ssql = 'select * test_sql1' else set @ssql = 'select * test_sql2' end something suffice. if @f_start_date_dt null or @f_end_date_dt null begin set @ssql = 'select * test_sql1' end else begin set @ssql = 'select * test_sql2' end

java - How we can use Servlet Filter for sessioncheck? -

this question has answer here: java.lang.illegalstateexception: cannot (forward | sendredirect | create session) after response has been committed 7 answers i new in java. try use servlet filters session check.my code given below. got error while run. please correct error. error code is http status 500 - cannot forward after response has been committed type exception report message cannot forward after response has been committed description server encountered internal error prevented fulfilling request. and code is my web.xml <servlet> <servlet-name>login</servlet-name> <servlet-class>com.sample.wordnik.servlet.loginservlet</servlet-class> </servlet> <welcome-file-list> <welcome-file>index.html</welcome-file> </welcome-file-list>

Why `scala.util.Try` is not mentioned in chapter "Handling errors without exceptions" of book "functional programming in Scala"? -

in chapter "handling errors without exceptions" of book "functional programming in scala", author gives: the problem of throwing exceptions body of function use option if don't care actual exception use either if care actual exception but scala.util.try not mentioned. point of view, think try suitable when care actual exception, why it's not mentioned? there reason have missed? i'm neither of authors of functional programming in scala, can make few guesses why don't mention try . some people don't standard library's try because claim it violates functor composition law . think position kind of silly, reasons josh suereth mentions in comments of si-6284, debate highlight important aspect of try 's design. try 's map , flatmap explicitly designed work functions may throw exceptions. people fpis school of thought (including me) tend suggest wrapping such functions (if absolutely have deal them @ all) in sa