Posts

Showing posts from July, 2015

Integration of Rapidminer with Java: Obtaining the output Example Set (Process Result) -

i want execute rapidminer process java use output exampleset (process result) subsequent operations (with java). i managed process execution code below, don't have clue how obtain process result example set. ideally, want example set independent of variables, if need generate metadata beforehand, have be. package com.companyname.rm; import com.rapidminer.process; import com.rapidminer.rapidminer; import com.rapidminer.operator.operatorexception; import com.rapidminer.tools.xmlexception; import java.io.file; import java.io.ioexception; public class runprocess { public static void main(string[] args) { try { rapidminer.setexecutionmode(rapidminer.executionmode.command_line); rapidminer.init(); process process = new process(new file("//my_path/..../test_java.rmp")); process.run(); } catch (ioexception | xmlexception | operatorexception ex) { ex.printstacktrace(); } } }

xcode - Cocoa Programming: Adding a Rectangle to a Custom View (NSView) -

is there simple way add simple rectangle custom view without using custom nsview subclass it? along lines of: assign iboutlet (let's call colorwheelview) of nsview type customview in nsviewcontroller's initwithnibname use change draw rectangle: // pseudocode self.colorwheelview.addrectangle(myrectangle); self.redraw() the way i've seen done (on site, , in book cocoa programming mac osx, pp. 241) making custom class custom view , modifying drawrect method... way accomplish this? edit: not sure why formatting not being rendered correctly. i'm trying fix it. it isn't hard roll own.. just add nsarray property nsview subclass, in drawrect method draw them either manually or using 1 of nsrectfilllist* methods provided appkit already. ( beware: take plain c array, not nsarray ). you wouldn't want manually trigger redraw outside view in sample code, though. keep things consistent addrectangle trigger redraw of view e.g. calling

perl - Use sed to replace word in 2-line pattern -

i try use sed replace word in 2-line pattern word. when in 1 line pattern 'macro "something"' found in next line replace 'block' 'core'. "something" put reference , printed out well. my input data: macro abcd class block ; symmetry x y ; desired outcome: macro abcd class core ; symmetry x y ; my attempt in sed far: sed 's/macro \([a-za-z0-9]*\)/,/ class block ;/macro \1\n class core ;/g' input.txt the above did not work giving message: sed: -e expression #1, char 30: unknown option `s' what missing? i'm open one-liner solutions in perl well. thanks, gert using perl one-liner in slurp mode: perl -0777 -pe 's/macro \w+\n class \kblock ;/core ;/g' input.txt or using streaming example: perl -pe ' s/^\s*\bclass \kblock ;/core ;/ if $prev; $prev = $_ =~ /^macro \w+$/ ' input.txt explanation: switches : -0777 : slurp files whole -p : creates while(&

c++ - Does "pointerVariable ==" mean something different from "pointerVariable="? -

for example: node * curr; if(curr = null) vs node * curr; if(curr == null) what each of these things mean? yes, different. the first example uses assignment operator ( = ) , assigns null to curr , , value used condition if . since it's null , , null considered false when comes conditions, execution never enter block. bug , @ least gcc , clang emit warning it. the second 1 uses comparison operator ( == ) compare curr null . if curr equal null , execution enter block. curr remains unchanged.

windows - XAMPP - Only allow access to a directory locally -

i have been stuck on days no luck. installed windows server 2008 , xampp. got 403 error , able edit config file allow al network access. uploaded billing system made htdocs directory. due security issues, want admin directory accessed through local network. please show me how if know. thanks! you can through apache configrations httpd.conf <locationmatch "^/domain.com/admin/*"> order deny,allow deny allow 192.168.* </locationmatch>

ios - How testflight is resigning with new mobile provisioning profile with out certificate? -

i amazed test flight, how resign new mobile provisioning profile out certificate. i tried resign commands , got this. resigning ios provisioning profile here need point certificate in command. but, sure did not upload certificate file test flight. how resigning .ipa file. any trick/tip please tell me. there absolutely no need resign application. application signed certificates. provisional profile having list of certificates can allow permissions selected devices. can check on portal creating new provisional profile. need check certificates. now when want add new udids, can update provisional profile(pp). because pp having reference of certificate used sign binary. there no need re-sign binary. in short, if have given binary client , tells add 1 more device udid, no need generate new binary. provide new pp , able install binary.

c# - PdfSmartCopy is copying the contents at the bottom (footer) of the new PDF file -

i have function cropping specific part of pdf file , adding new pdf file main problem getting is showing cropped part of page bottom (footer) of newly created pdf file. here code.. public static void croppdffile(string sourcefilepath, string outputfilepath) { // allows pdfreader read pdf document without owner's password pdfreader.unethicalreading = true; // reads pdf document using (pdfreader pdfreader = new pdfreader(sourcefilepath)) { // set part of source document copied. // pdfrectangel(bottom-left-x, bottom-left-y, upper-right-x, upper-right-y) pdfrectangle rect = new pdfrectangle(0f, 9049.172f, 594.0195f, 700.3f); using (var output = new filestream(outputfilepath, filemode.createnew, fileaccess.write)) { // create new document using (document doc = new document()) { // make copy of document pdfsmartcopy smartcopy = new pdfsmartcopy(doc, ou

ios - How create multi column editing in scene view on ipad -

i'm ios developing beginner. , i'm interested in creating 1 app having features in app kanbana - personal task manager , 1 scene view can display multi column sections editing. i'm curious ios technology can achieve that? use uicollectionview, or draw each section on scene?

cross validation - R: PDA on 2 manners but with different results? -

i'm working on project have classify data breast cancer. want use pda. i'm trying found optimal value lambda 10-fold cross validation. i've started with: breast[,1] <- as.numeric(breast[,1]) #because code works when classes numeric (so not factors were) i found done by: library(penalizedlda) penalizedlda.cv(breast[,-1], breast[,1], lambdas = seq(0,0.5,by=.01), nfold = 10) but can manually: lam <- seq(0,1,by=.01) length(lam) error.lam <- rep(0, length(lammie)) (la in 1:101){ error.pda <- rep(0,10) (fold in 1:k){ currentfold <- folds[fold][[1]] breast.pda = fda(diagnosis~., data=breast[-currentfold,], method=gen.ridge, lambda = lam[la]) pred.pda = predict(breast.pda, newdata= breast[currentfold,-1], type="class") cv.table=table(breast[currentfold,1],pred.pda) error.pda[fold] <- cv.table[1,2]+cv.table[2,1] } error.lam[la] <- sum(error.pda)/nrow } the strange thing become 2 different results. first i

How to publish web service on internet -

i have written web service , deployed in apache tomcat in localhost:8080. works on localhost:8080. i need know how make available others on internet (not localhost) webservice written temperature convert in w3schools website. can access anywhere if connected internet. you can use amazon's ec2 service hosting webservice..

c# - How do i get memory usage of specific application just like it show in the windows task manager? -

public static void getallmemoryusage(string processname) { process[] pprocessname = process.getprocessesbyname(processname);//.getcurrentprocess().processname; var counter = new performancecounter("process", "working set - private", processname); privatememeory = string.format("private memory: {0}k", counter.nextvalue() / 1024); } some problems here: i have variable process[] pprocessname never use it. the i'm getting value not same 1 in task manager. in task manager see 192.6mb in program see 197232. started playing game use application(process) in task manager show: 219.0mb in program 224304. why it's same values , should process[] pprocessname variable ? how show percentage/s application(process) show in task manager ? i want method return same value of memory usage , same percentage value in task manager. yes. can physical amount of memory occupied each through workingset64 property of th process class.

javascript - Is it possible to get PHPmailer to send the mail after the page loads? -

i have script sends @ least 1 email using phpmailer, potentially 5. action of sending mail delays page loading around 2-3 seconds. acceptable, doubles , triples each email sent. placing code after page html doesn't make difference. know php apparently "single thread" application, surely there's smarter way of doing this? there fancy javascript applet silently load page in background, or there neater way? tips welcomed. i write separate script accepts necessary data command line arguments , launch script background process main script can exit without waiting finish. so: exec("nohup /usr/bin/php mailerscript.php $param1 $param2 > /dev/null &"); inside mailerscript.php, can access $param1 , $param2 $argv[1] , $argv[2] . make sure mailerscript.php executable webserver process , specify full path in exec.

dns - WAMP server name not found for virtual host in apache -

system: windows7 64-bit wamp server 32-bit version: apache : 2.4.9 mysql : 5.6.17 php : 5.5.12 phpmyadmin : 4.1.14 sqlbuddy : 1.3.3 xdebug : 2.2.5 my issue when navigate project "local.blamo1.com" - via wamp "localhost" chrome returns: "oops! google chrome not find local.blamo1.com" i able access project folder "localhost/local.blamo1.com" - understand it, bad practice throw off server mapping 1 directory. able access project designated server alias. have implemented following... httpd-vhosts.conf location: "c:\wamp\bin\apache\apache2.4.9\conf\extra\httpd-vhosts.config" # virtual hosts # # required modules: mod_log_config # if want maintain multiple domains/hostnames on # machine can setup virtualhost containers them. configurations # use name-based virtual hosts server doesn't need worry # ip addresses. indicated asterisks in directives below. # # please see documentation @ # <url:http://httpd.apache.org/docs/2.4/v

node.js - change `dest` option on the fly -

i have grunt tasks compile files , "recycle" them inside different tasks. i trying modify destination directory without success... idea like: grunt.registertask('bower', ['compile:index', 'compile:core'], function(){ this.options({dest: 'dist/*.js'}); }); the compile:index task runs (i.e. when called alone) , has dest: 'index.js , other tasks have other filenames. change these inside bower task, adding new directory keeping filename defined in original task. is possible? you can create dynamic alias task configures , runs tasks such: grunt.registertask('bower', function(target) { target = target || 'index'; if (target === 'core') { grunt.config('compile.core.dest', 'dist/core.js'); } else { grunt.config('compile.index.dest', 'dist/index.js'); // call after compile:index has ran configure compile:core grunt.task.run(['compile:index&#

ruby - Why is "❨╯°□°❩╯︵┻━┻" with such an encoding used for a method name? -

Image
i came across following method in sidekiq gem . invoked test_sidekiq.rb . def self.❨╯°□°❩╯︵┻━┻ puts "calm down, bro" end this link able find on so. google can't understand ❨╯°□°❩╯︵┻━┻ . why doesn't ruby complain encoding? what purpose of method (not looking @ body)? why did author @mike-perham use name? fun, or testing boundaries? if not understand sense of method name, (japanese-style) facemark. whereas english facemarks rotated 90 degrees counter-clockwise , long in vertical direction of actual face, japanese facemarks read in direction is, , long in horizontal direction. author of either japanese, or influenced japanese culture anime. in particular case, each character expresses part. left right: ❨ right edge of face ╯ right arm raised ° right eye □ mouth ° left eye ❩ left edge of face ╯ left arm raised ︵ imaginary curve expressing trace of thrown table ┻━┻ thrown upside-down table (most chabudai used

javascript - basic import.io html search -

so if of have experience scraping or particularly import.io help, since import.io i'm using... although think question js really... i want connect basic html input import.io js code can have custom search http://jsfiddle.net/lsng3/1/ "input": { var search_name = document.getelementsbyname("search_name").value; "search_name": search_name } <input name="search_name" placeholder="doesnt work :("> heres go... basic working import.io js example. tried add variable input name , add variable search item alone isnt working... i contacted import.io team , said try make easier tutorial in future try @ particle example have include input search example big me deconstruct see how input works. heres particle example uploaded server can see working although bit slow-> http://www.originalengine.com/scrape/ please find here modified version of code seems produce correct result: http://jsfiddle.net/znsb

database design - What is the best data structure to store this data on mongoDB? -

i'm designing news publishing website. want allow users pick favorite news , store them in list. time user wants show favorites, news should sorted date , shown. the structure store this: favorite_table = { user_id, data } all news stored in data field this: [{date:news_id},{date:news_id},{date:news_id] since values sorted date, structure store news? have append data whenever arrives. structure suitable purpose or there better structure? your structure looks correct. storing news_id in data field , that's smarter implementation because storing complete document cause lot of moving , writing mongodb every time new news added favorites user. reason, know, new document created on every update. reference: http://docs.mongodb.org/manual/reference/method/db.collection.save/#upsert . also think business rule should restrict number of news items can set favorite user. allowing list grow indefinitely not idea embedded design. in case want unlimite

ios - ViewController infinite loop after modifying Storyboard -

i'm having navigation / viewcontroller hierarchy problem ever since implementing library side-shelf navigation ( https://github.com/socialobjects-software/amslidemenu ). implementation of library works fine demo viewcontrollers (as can seen on linked github page), when adjusted include actual viewcontrollers had been working (which had worked fine on own), navigation flow breaks down. my app's viewcontrollers structured follows: navigation controller login viewcontroller main viewcontroller (where drawer-nav library kicks off) slidemenulefttableview navigation controller itemstable viewcontroller addphoto viewcontroller additemdetails viewcontroller navigation controller demo viewcontroller before implementing shelf-navigation library, storyboard consisted of following viewcontrollers, , not encountering issues: navigation controller login viewcontroller itemstable viewcontroller addphoto viewcontroller additemdetails viewcontroller at itemsta

Install x-superobject (.pas file) on delphi xe6 -

i want use x-superobject, can't figure out how add , use on delphi xe6. found 1 answer on how install .pas files on delphi, delphi2010 , thing little bit different think (i've tried 1 didn't worked.) so, install xsuperobject downloaded this 2 files , saved them. don't know how proceed, , feel bit stupid don't understand here on wiki. thank you! x-superobject runtime library, not visual component library. installation quite easy. way 1: put 2 files project source folder , able use them without problems. way 2: if hate include files of projects, can open option dialog , goto environment options > delphi options > library . add path of x-superobject browsing path . now able include xsuperobject other delphi native units (i.e. winapi.windows , system.sysutils ).

HTML Form constrain by JavaScript--number issue -

i writing form ask input lower , upper limit of weight range , return objects within weight range. in order prevent user entering lower limit>upper limit(eg. lower limit=5 , upper limit=2), used javascript below. when testing, form generating expected result when both upper limit , lower limit less 10. however, returns "lower limit greater upper limit" error message when try on lower=2/upper=10 or lower=9/upper=10 in addition, when try lower=2 , upper=30, works again. (i using chrome testing) seems comparing first digit of lower , upper input. not sure if caused incorrect input type or javascript. can resolve problem? thanks html5 form: <label>please enter lower limit: <input type="number" name="weightl" step="0.00000000001" min="0" id="weightl" autofocus required placeholder="accepts decimal places"/></label> <label>please enter upper limit:<input type="number"

Audio not loaded using Libgdx Sound and Music class from app internal storage in android 4.0 -

in senario ,i have used audio file app internal storge. in android activity class copied phone internal storge app storage. atlas file,png file working audio file not loaded in android version 4.o althogh working in 4.1 , above. code ... android project have... public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); androidapplicationconfiguration cfg = new androidapplicationconfiguration(); cfg.usegl20 = true; sourcefile = new file(environment.getexternalstoragedirectory().tostring()+"/data/arv.ogg"); if(sourcefile.exists()) log.i("arv", "file exist"); destfile = new file(getapplicationcontext().getfilesdir().tostring()+"/arv.ogg"); log.i("arv", "file dest = "+destfile.tostring()); try { if(sourcefile.exists()) log.i("arv", "file status = "+copyfile(sourcefile,

java - "Entity name must be unique in a persistence unit" -

i'm new glassfish server , i'm experiencing problem. first imported template project (that uses jpa) netbeans, working fine. then, since wanted modify template, created copy of project, closed original 1 in netbeans, undeployed first project , imported new copied project netbeans. changed package name , name of persistence unit. when try run new project error entity name must unique in persistence unit. entity name [todoitem] used entity classes [package1.todoitem] , [package2.todoitem] how possible? original project no longer exists in netbeans, explicitly undeployed glassfish using asadmin undeploy command, , tried remove , reinstall glassfish, nothing changes. my persistence.xml looks this: <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2

gcc - ARM overflow flag -

i read here , overflow flag might set in cases. trying out following sample of code :- .global main .func main main: mov r0, #4026531839 mov r1, #-1 sub r0, r0, r1 os is_set mov r0, #17 bx lr is_set: mov r0, #71 bx lr i got error message said following :- carryflagsub.s: assembler messages: carryflagsub.s:8: error: bad instruction `os is_set' isn't os instruction used test if overflow flag set? there no os instruction in arm instruction set. however, test if overflow flag set can use conditional execution of instructions, that. bvs is_set you can learn conditional execution in arm reference manual .

python 2.7 - Using <form> to update BooleanField in Django -

using django 1.6 python 2.7. my model has booleanfield variable, , want user able change via post clicking button change false true, or vice versa. having issues rendering template. model currently: class pic(models.model): name = models.charfield(max_length=100) = models.booleanfield() image = models.filefield(upload_to="images/") def __unicode__(self): return self.name app urls is: url(r'^(?p<pic_id>\d+)/$', views.single_picture, name='single_picture'), in template have: <form action="{% url 'single_picture' pic.good %}" method="post"> {% csrf_token %} {% if pic.good %} <input type="checkbox" name="choice" id="{{ pic.good }}" value="false" /> <label for="{{ pic.good }}">false</label><br /> {% else %} <input type="checkbox" name="choice" id="{{ pic.good

BigQuery table performance loss with TABLE_QUERY -

having surprising performance hit when querying multiple tables, vs. 1 big one. scenario: we have simple web analytics tool based on bigquery. track basic events individual sites. month, pumped data 1 big table. now, breaking data partitions site , month. so big table [events.all] now have, say, [events.events_2014_06_siteid] querying individual tables group is faster, , processing less data. querying our entire dataset much, slower on simple queries. , our new dataset 1 day old, whereas big table 30 days old, it's slower despite querying far less data. for example: select count(et) [events.all] et='re' --> completed in 3.2s, processing 79mb of data. table has 21,048,979 rows. select count(et) ( table_query(events, 'table_id contains "events_2014_"') ) et='re' --> completed in 44.2s, processing 1.8mb of data. put together, these tables have 492,264 rows. how come occurs, , there way resolve big disparity?

VBA Access: Import CSV with additonal header data -

i new coding vba. wondering if me? have csv file structured following: - first 22 rows cover specfic header data(this loads in 1 column in excel) - column headers table in row 23 - data located row 24 onward. what code needs insert data in new table right column titles. while inserting needs input file name , header data in first few columns of table. so far have imported entire csv array believe: see have far: sub readcsv() dim fs object dim fso new filesystemobject dim tsin object dim sfilein, filename string dim aryfile, aryheader, arybody variant sfilein = "c:\doc\test.csv" set filename = fso.getfilename(sfilein) set fs = createobject("scripting.filesystemobject") set tsin = fs.opentextfile(sfilein, 1) stmp = tsin.readall aryfile = split(stmp, vbcrlf) = 1 22 aryheader(1, i) = aryfile(i) next = 23 ubound(aryfile) arybody(i) = split(aryfile(i), ",") docmd.runsql "insert mains values (filename,aryheader(1),arybody(i))&quo

multithreading - Can TOmniEventMonitor be used in a background thread? -

original question in our delphi xe4 application use tomnieventmonitor receive messages other tasks. long running in main thread, works fine, once put same code in task, tomnieventmonitor stops receiving messages. have included simple example of below -- clicking button_testinmainthread results in file being written expected, clicking button_testinbackgroundthread not. design, or there way working while still using tomnieventmonitor? unit mainform; interface uses winapi.windows, winapi.messages, system.sysutils, system.variants, system.classes, vcl.graphics,vcl.controls, vcl.forms, vcl.dialogs, vcl.stdctrls, otltask, otltaskcontrol, otlcomm, otleventmonitor; const my_omni_message = 134; type tomnieventmonitortester = class(tobject) fname : string; fomnieventmonitor : tomnieventmonitor; fomnitaskcontrol : iomnitaskcontrol; constructor create(aname : string); destructor destroy(); override; procedure handleomnitaskmessage(const task: iomnita

ruby - already installed gems not detected in gem list -

i ran railsinstaller on new computer bought , afterwards, in effort have computer run old rails projects, copied on gem dependencies. however, reason, "bundle install --local" not work, odd since particular way of copying rails projects , gems worked fine in past. ran "gem env" , got this: c:\users\owner\rails_projects\depot>gem env rubygems environment: - rubygems version: 1.8.28 - ruby version: 1.9.3 (2013-11-22 patchlevel 484) [i386-mingw32] - installation directory: c:/railsinstaller/ruby1.9.3/lib/ruby/gems/1.9.1 - ruby executable: c:/railsinstaller/ruby1.9.3/bin/ruby.exe - executable directory: c:/railsinstaller/ruby1.9.3/bin - rubygems platforms: - ruby - x86-mingw32 - gem paths: - c:/railsinstaller/ruby1.9.3/lib/ruby/gems/1.9.1 - c:/users/owner/.gem/ruby/1.9.1 - gem configuration: - :update_sources => true - :verbose => true - :benchmark => false - :backtrace => false - :bulk_threshold => 1000 - remote source

c# - Why when I download gridview in pdf file, it shows error -

i want download pdf file contain pid, , month january december. the month contain float number has 9 number after comma, makes gridview wider should be. , when download pdf file, shows error 'system.web.ui.htmltextwriter' what happening here? this code connection.open(); sqlcommand dm = new sqlcommand("select id,sum (case when [month] = 1 demand else 0.0 end) january, sum(case when [month] = 2 demand else 0.0 end) february,sum(case when [month] = 3 demand else 0.0 end) march ,sum(case when [month] = 4 demand else 0.0 end) april ,sum(case when [month] = 5 demand else 0.0 end) may ,sum(case when [month] = 6 demand else 0.0 end) june ,sum(case when [month] = 7 demand else 0.0 end) july ,sum(case when [month] = 8 demand else 0.0 end) august ,sum(case when [month] = 9 demand else 0.0 end) september ,sum(case when [month] = 10 demand else 0.0 end) october ,sum(case when [month] = 11 demand else 0.0 end) november ,sum(case when [month] = 12 demand else 0

How to get entire html code of a div in jquery -

i developing application in asp.net. in web page (.aspx) have multiple div. requirement getting entire html code of particular div including code of specified div. how can that? <div class="tab-pane" style="width: 348px; height: 204px; margin: 0 auto; background-color: #ffffff; border: none; display: block; position: relative; overflow: hidden; -webkit-box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);" id="back"> <div class="setlimit" style="width: 324px; height: 180px; margin: 12px; background-color: none; position: absolute; z-index: 51; overflow: visible;" id="safezoneback"> <div id="customizepanelback" style="position: absolute; width: 100%; height: 100%; display: block;"> <div id="lblback" style="position: absolute; background-color: none; text-align: center; font-family: arial; font-size: 12pt; color: #000000; te

php - Mails are coming under spam folder using wp_mail function in wordpress -

i using wp_mail function sending emails registration, have tried gmail, email goes spam folder, have tried similar questions answers not working me please help. $headers = 'mime-version: 1.0' . "\r\n"; $headers .= 'content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers .= "from: noreply@example.com"."\r\n"; $message = sprintf(__('dear: %s'), $user_login) . "\r\n\r\n"; $message .= sprintf(__('the email sent automatically ')); $message .= network_home_url('/'); $message .= __('please visit following link register email address') . "\r\n\r\n"; $message .= network_site_url("wp-login.php?action=rp&key=$key&login=" . rawurlencode($user_login), 'login')."\r\n"; if ( $message && !wp_mail( $user_email, wp_specialchars_decode( $title ), nl2br($message), $headers ) ) wp_die( __('the e-mail not sent.') . "<

javascript - HTML - Number Input Limit (Go Up/Go Down 10 to 10) -

i want when press arrow number change (increase) 0-to-10 /then/ 10-to-20 / 20-to-30 mean 10 10. , if press down arrow, number change (decrease) 10 10. <input type="number" value="0" min="0" max="99999999" /> i don't know javascript or jquery well. couldn't found in google/stackoverflow. haven't code on jsfiddle. you want step attribute . specifies how far increase or decrease number. example: <input type="number" value="0" min="0" max="99999999" step="10" />

r - Plot points with 3 different colors -

Image
i have following 2 columns part of dataframe , function below: x 705.7553 789.2789 689.7431 559.8025 629.9365 564.9095 y -0.0596123270783229 0.644158691971081 -0.433854284204926 -0.365746109442603 0.566685929975495 0.398462720589891 function: plotm<- function( all.res, m, u ) { plot(data$x, data$y, log="x", pch=20, cex=0.7, col = ifelse( data$y < m, "red", "black" ), xlab = "y", ylab = expression(log[2]~fold~change)) } function call: plotm(data, .05) # plots graph red points when data$y < m , black when data$y > m but i'm interested in following: plotm(data, 0.05, 0.1 ) # plot graph red points when data$y < m, green when data$y > u, , rest colored black can please? thanks we first generate toy data: set.seed(1) x <- rnorm(100) y <- rnorm(100) you can like: m <- c(-inf, -0.5, 0.5, inf) # specify cut points, here -0.5 , 0.5 cols <- cut(y, breaks =

cordova - Managing Phone Calls when in a PhoneGap Application -

i thought have been pretty standard, after hour of searching can't find it, might simple lack of correct vocabulary, feel free make fun of me if is. i have phonegap application built , have realized receiving phone call while using app gets in way of experience. now understand why phone call trumps app in priority, there way can manage phone call can see calling , put accept / decline can continue use app while managing incoming phone calls? so far search has been through google, , through phonegap plugins. nothing seems stand out. again thinking common issue, initial feeling don't have right vocabulary search this.

qemu - Is simulated PowerPC faster than actual PowerPC? -

i have used powerpc chip emulated qemu , using xilinx virtex ii pro execute powerpc instructions. on both run custom rtos , measure time taken task. contents of task not differ between implementations, time taken has considerable gap. the time taken on qemu around 200 microseconds, whereas time taken on xilinx chip 2000 microseconds. why happen ? shouldn't running rtos on hardware directly faster emulating ? edit: speed of both 300 mhz

excel - Passing worksheets to a procedure -

i'm trying pass 3 worksheets procedure call as call pivot_table(sheets("sheet2"), sheets("sheet3"), sheets("sheet4")) but error subscript out of range also if try as dim ws, ws1, ws2 worksheet set ws = sheets("sheet2") set ws1 = sheets("sheet3") set ws2 = sheets("sheet4") call pivot_table(ws, ws1, ws2) i error byref arguement type mismatch my procedure is sub pivot_table(ws1 worksheet, ws2 worksheet, ws3 worksheet) not able find appropriate solution. help. do have sheets named "sheet2", "sheet3", , "sheet4" in workbook? if not, reason subscript out of range error. the reason byref argument type mismatch declaration of ws, ws1 , ws2 not declaring 3 worksheets. vba not support kind of multi-variable assignment on 1 line. if want declare on 1 line, still have explicitly declare type of each variable, i.e. dim ws worksheet, ws1 worksheet, ws2 worksheet declar

multithreading - Akka: how to config Router, dispatcher to make a better performance? -

i have played around akka 2 weeks , still confused basic concept. i have simple pattern contains 3 kinds of actors: master worker reporter i config these actors following: master master use following dispatcher roundrobinrouter(10): mailbox-capacity = 10000 executor = "fork-join-executor" fork-join-executor { parallelism-min = 0 parallelism-max = 600 parallelism-factor = 3.0 } worker i have several workers(ref) in system, receive messages master, , each of them use router of roundrobinrouter(10). type = dispatcher executor = "fork-join-executor" fork-join-executor { parallelism-min = 0 parallelism-max = 600 parallelism-factor = 3.0 } mailbox-capacity = 100000 notifier is actor used receive result worker, , counting up. uses same dispatcher workers. i have made adjustment on parallelism parameters , router, performance seems no change. takes 80 seconds consume 10 million tasks, of each takes @ least 500 ms finish. so go

javascript - jQuery widget Inside jQuery ajax tabs -

i'm having problems adding datepicker ajax loaded site on tab widget. i'll try explain have done far. i have first made forms , stuff, added datepicker , made sure worked. wanted create tab widget wich load page form it. while work , $_post stuff works too, jquery doesn't seem work. are there know causes or specific problem related me? if code needed figure out i'll edit later, want know if it's possible. please keep in mind relatively new jquery , ajax stuff. in advance! --edit-- note: include scripts in headers of each page. page tabs: view <div id="tabs"> <ul> <li><a href="../tabs/bericht">bericht</a></li> <li><a href="../main/initiative">initiatief</a></li> <li><a href="../main/profile">interesse</a></li> </ul> java $(document).ready(function(){ $( "#tabs" ).tabs({collapsible:true, activ

fortran - SELECT TYPE with unlimited polymorphic pointer to CHARACTER(*) variable -

following example uses fortran 2003 features defining unlimited polymorphic pointers , performing actions based on variable type following select type construct. subroutine handlep prints value of argument in dependence of it's type. program example implicit none type name character(22) :: n end type character(len=7) :: mystring mystring = 'initial' call handlep(mystring) call handlep('initial') call handlep(name('initial')) contains subroutine handlep(p) class(*), intent(in) :: p select type(p) type (character(len=*)) write(*,*) len(p), ': ', p class (name) write(*,*) len(p%n), ': ', p%n class default write(*,*) 'unknown type' end select end subroutine end program example compiling gfortran version 4.8 gives following output: 7 :

javascript - Knockout click data binding -

i have issue in below example html code : <table id="items"> <thead> <tr> <td>todo list</td> </tr> </thead> <tbody data-bind="foreach: todoitems"> <tr> <td><label data-bind="text: todoitem"></label></td> <td><a href="#" data-bind="click: $root.removetodoitem">remove</a></td> </tr> </tbody> </table> add item: <input type="text" id="newitem" /> <button data-bind="click: addnewitem">add</button> this js code : $(function () { var metalviewmodel = function() { var self = this; self.todoitems = ko.observablearray(); self.update = function() { self.todoitems.removeall(); self.todoitems.push( new metals({"task":"this urgent

php - replacing new line characters with coma from given text -

here have tried replace newline char comma. checked previous threads , acted accordingly still no solution. $letters = '#\s+#'; $rep = ','; $output = str_replace($letters, $rep, trim($text)); echo $output; link demo : http://ideone.com/dofosc str_replace() string replace , not regex replace. preg_replace() should used if want regex-based replace. however, replace each new line comma using: $output = str_replace(array("\n", "\r\n"), ",", $text);

r - Replace value using previous row depending on condition (using a function such as sapply) -

i've got large dataset i'm trying find way efficiently. going through rows in given column want take particular condition , if triggers want replace current element value in element above for code condition dependent on element being == 2 [,1] [,2] [1,] 1 1 [2,] 1 32 [3,] 2 4351 [4,] 2 1 [5,] 3 4 [6,] 4 5 [7,] 5 6546 [8,] 67 456 should become [,1] [,2] [1,] 1 1 [2,] 1 32 [3,] 1 4351 [4,] 1 1 [5,] 3 4 [6,] 4 5 [7,] 5 6546 [8,] 67 456 but @ moment becomes (note changes values simultaneously using sapply, having 2 consecutive 2s make copy 2 above) [,1] [,2] [1,] 1 1 [2,] 1 32 [3,] 1 4351 [4,] 2 1 [5,] 3 4 [6,] 4 5 [7,] 5 6546 [8,] 67 456 this current code same made example: rowid = 1 letable = cbind(c(1,3,4,5,67,2,2,1),c(1,4,5,6546,456,4351,1,32)) sortedtable =letable[order(letable[,1]),] print(sortedtable) abovefunction <-

php - in specific condition set and store a variable until another specific condition -

hello i'm pretty new in programming. need solve problem in php solution in different language great. tryied solve if statement if condition changed variable gone. easy example better understanding. // possible conditions ( 'cond1', 'cond2', 'cond3', 'cond4','cond5' ) // conditions can called randomly i have somethng this: $variable = 'off'; since ( $condition == 'cond2' ) $variable = 'on'; until ( $condition == 'cond4' ) the goal switch variable 'on' in 'cond2' condition , hold on when others conditions changing independently on order until condition changed 'cond4' , variable switched 'off'. thanks suggestions. i don't think current concept realizable in php cannot listen variables, need actively notified. 1 scenario same solution different concept be class condition { private $value; private $variable = false; public function setc

Hiding Rows that do not Have Values VBA -

i'm trying write macro goes through list , hides row if there no values in of columns of row. however, data has hidden columns macro. here's attempt below, doesn't seem of yet. appreciated. sub hiderowsmenu() beginrow = 5 'start after master menu item endrow = 731 'filter rows in sheet (about 730) columnswithvalues = 0 'counter number of columns in row have value. if 0, hide row. columnstart = 2 'start have group values columnend = 50 'maximum number of groups rownumber = 0 columnnumber = 0 'outer loop cycles through rows of range, inner cycles through columns check values rownumber = beginrow endrow columnswithvalues = 0 'reset counter 0 avoid counting last row's values columnnumber = columnstart columnend 'if given cell index empty (0) , cell not hidden, add 1 counter if cells(rownumber, columnnumber).value = 0 , cells(rownumber, columnnumber).columns.

excel - Mass deleting white spaces with very large data arrays -

so dled csv hthat large use mass delete found on internet. how can rid of white spaces located between each data point. can use python , had suggested like: for line in open('filename'): line = line.strip() if line.empty(): continue print line yet when try "empty" function doesn't seem work. either through python or other way, got rid of these white spaces. thanks! some pointers: line.strip() removes whitespace @ beginning , end of line - want? if want whitespace removed, line = ''.join(line.split()) . your continue lacks indentation. string objects don't have empty method. to check if string mystr empty can issue if mystr == '' or if not mystr because empty strings evaluate false in boolean context. example code: for line in open('filename'): line = line.strip() if line: print(line)

salesforce - How to edit/replace single file in SFDC static resources? -

i have static resource zip file in sfdc contains images , css files used visualforce pages. how replace single image new 1 resource zip file? need upload entire zip file again new image? you should update files need in zip archive (which contain files current static resource) , upload again sf.

java - ConcurrentModificationException in a runnable -

i developing timer manager allow multiple countdown timers , cant seem figure out how avoid concurrentmodificationexception. have @ other peoples responses similar problems still cant figure out. mhandler = new handler(); mupdateui = new runnable() { public void run() { iterator<hashmap.entry<string, timerholder>> = mtimers.entryset().iterator(); while (it.hasnext()) { -----------> map.entry<string, timerholder> pairs = it.next(); pairs.getvalue().post(); } iterator<hashmap.entry<string, timerholder>> iterator = mtimers.entryset().iterator(); while (iterator.hasnext()) { hashmap.entry<string, timerholder> entry = iterator.next(); if (!entry.getvalue().isvalid()) { iterator.remove(); } } mhandler.postdelayed(mupdateui, 1000); // 1 s

vb.net - Main form freezing due to backgroundwork -

scenario: making login form connects mysql database account , password confirmation. trying: trying show animated loading gif , loading text while form connecting , getting result database. did far: used background worker: login button: private sub loginbtn_click(byval sender system.object, byval e system.eventargs) handles loginbtn.click picturebox2.visible = true label6.visible = true backgroundworker1.runworkerasync() end sub background worker dowork: private sub backgroundworker1_dowork(sender object, e doworkeventargs) handles backgroundworker1.dowork accesscontrol() end sub private sub accesscontrol() if me.invokerequired me.invoke(new methodinvoker(addressof accesscontrol)) else con.open() dim user, pass string user = usernamebox.text pass = crypt(passwordbox.text) cmd = new mysqlcommand("select * users name ='" + user + "' , password ='" + pass + "'&