Posts

Showing posts from February, 2013

google app engine - BigQuery - does not contain valid backup metadata -

i trying upload csv bigquery bigger 10mb. have through google datastore, getting problems process: errors: gs://edr-storage/exm.csv not contain valid backup metadata. i following steps don´t know how proceed with: "click storage > storage browser, click bucket name specified in creating cloud datastore backup. each cloud datastore backup includes 3 objects. copy name of object ends .backup_info" does can me ? thanks if trying create table in bigquery google cloud storage have mention source format csv , select google cloud storage uri "gs://mybucket/myobject.csv". bigquery data upload google cloud storage

c# - Refreshing PictureBox causes ArgumentException Parameter is not valid -

i can't life of me figure out. i'm modifying bitmap picturebox points to. someone drags image across picturebox, , image updated looks dragging across picturebox. happens on refreshing picturebox, argumentexception parameter not valid error on application.run line, took me while figure out causing because there no more information in exception. i've created class derives picturebox , overrode onpaint method. has method, refreshimage, invoke , refresh itself if not refresh picturebox, not error, picturebox image never updated i have main loop running in updates logic. logic when mouse dragged, image offset updated. after loop completes logic, attempts refresh picturebox. ive found when comment out refresh line, not have problem, picturebox never updated. i've added method custom picturebox class called updateimage invokes refreshes. the overridden onpaint method takes logic custom loop thread, , updates bitmap based on offset end loop thread updated the m

c++ - Converting a Virtual-Key code to ASCII -

hi need convert these virtual-key codes https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731%28v=vs.85%29.aspx ascii saw function https://msdn.microsoft.com/en-us/library/windows/desktop/ms646316%28v=vs.85%29.aspx don't know how can use since need call that cout << "you pressed key" << (char) i; . being int translated. toascii gives me lpword don't know how can use cout that. thank answers :) lpword pointer word. uses hungarian notation. (l - long, p - pointer). word unsigned 16-bit integer. it's matter of determining key links integer. see windows data types on lpword , word .

android - Expand button in TableRow -

Image
i have @ bottom of screen 2 buttons next , previous inside table rows in table layout below. <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="${relativepackage}.${activityclass}" > <scrollview android:layout_width="match_parent" android:layout_height="match_parent" android:background="#000000" > <tablelayout android:id="@+id/table1" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_alignparentleft="true" android:layout_alignparenttop="true" android:background="#000000" > <tablerow

html - Centering an absolute positioned div -

i need center div wrapped inside div: div centered: .post-username { padding: 10px; background: #000; border-radius: 4px; position: absolute; top: 0; } it should centered inside of this: .post { background: #3e4758; overflow: hidden; border-radius: 4px; width: 270px; height: 330px; position: relative; } .post-username { padding: 50px; background: #000; border-radius: 4px; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); -webkit-transform: translate(-50%, -50%); -moz-transform: translate(-50%, -50%); } .post { background: #3e4758; overflow: hidden; border-radius: 4px; width: 270px; height: 330px; position: relative; }

algorithm - Find a pair of intergers that can be reached to another pair using 4 operations -

given pair of integers (eg. (x,y)). want find whether possible convert them pair of integers using 4 operations, mentioned below, @ time number of times. operations follows: (x,x+y) or (x+y,y) or (x-y,y) or (x,x-y) for eg. (4,2) can converted (2,6) doing following operations: (x-y,y) --- (2,2) (x,x+y) --- (2,4) (x,x+y) --- (2,6) where (2,2) cannot converted (4,4). answer should yes or no. claim: (x, y) can reach (z, w) if , if gcd(x, y) = gcd(z, w) . proof: (necessary) gcd(x, y) = gcd(x, x + y) = gcd(x + y, y) = gcd(x - y, y) = gcd(x, x - y) . (sufficient) reachability symmetric. run euclidean algorithm reach (gcd(x, y), 0) (x, y) .

hadoop - Twitter Json data not getting queried in Hive -

i trying twitter sentiment analysis using flume, hadoop , hive. following article . able tweets hdfs using flume. twitter-agent configuration. #setting properties of agent twitter-agent.sources=source1 twitter-agent.channels=channel1 twitter-agent.sinks=sink1 #configuring sources twitter-agent.sources.source1.type=com.cloudera.flume.source.twittersource twitter-agent.sources.source1.channels=channel1 twitter-agent.sources.source1.consumerkey=<consumer-key> twitter-agent.sources.source1.consumersecret=<consumer-secret> twitter-agent.sources.source1.accesstoken=<access-token> twitter-agent.sources.source1.accesstokensecret=<access-token-secret> twitter-agent.sources.source1.keywords= morning, night, hadoop, bigdata #configuring channels twitter-agent.channels.channel1.type=memory twitter-agent.channels.channel1.capacity=10000 twitter-agent.channels.channel1.transactioncapacity=100 #configuring sinks twitter-agent.sinks.sink1.cha

php - How do i show value all fields?Wordpress -

i use plugin custom fields. i created 5 fields , call ( cat_content,imagine2,imagine3,imagine4,imagine5 ) all these values stored in vector ( fields ) i browse vector instruction foreach , tried show in list. unfortunately, list empty ... @ picture below. http://i59.tinypic.com/2qx58d4.jpg this site: link <div class="container"> <?php $queried_object = get_queried_object(); $cat_content = get_field('category_content', $queried_object); $imagine2= get_field('imagine2',$queried_object); $imagine3= get_field('imagine3',$queried_object); $imagine4= get_field('imagine4',$queried_object); $imagine5= get_field('imagine5',$queried_object); $fields = array("cat_content",

java - Android Data Validation -

i wondering effective form of data validation android. so, when getting value edittext how should value given validated before used? check make sure string returned gettext().tostring() not null or empty using guava library: strings.isnullorempty(edittext.gettext().tostring()) then, depending on type of data expecting, create method see if data can parsed. if expecting double create method this: private boolean isdouble(string string) { try { double stringdouble = double.parsedouble(string); return true; } catch (exception e) { return false; } } is there simpler way without need create separate method each type of data expecting receive? i've used edittext-validator last time needed quick validation. works charm :) https://github.com/vekexasia/android-edittext-validator

Ansible local mode does not pick up variables from all -

i'm unable access value of variable defined in group_vars/all in simple `local.yml' playbook. directory structure have: /group_vars /all local.yml content of group_vars/all : key_name: bar content of local.yml : - name: local example connection: local gather_facts: no tasks: - debug: msg="key {{ key_name }}" here's how run playbook: ansible-playbook -i localhost, local.yml the error message: play: local example ************************************************************* task [debug msg=key {{ key_name }}] ****************************************** fatal: [localhost]: failed! => {"msg": "error! field 'args' has invalid value, appears include variable undefined. error was: 'key_name' undefined", "failed": true} no more hosts left ************************************************************** play recap ********************************************************************** loc

r data.table ( <= 1.9.4) join behaviour -

i using r , data.table after time , still have issue join. asked this question resulting in satisfactory explanation still not logic. let's consider few examples: library("data.table") x <- data.table(chiave=c("a", "a", "a", "b", "b"),valore1=1:5) y <- data.table(chiave=c("a", "b", "c", "d"),valore2=1:4) x chiave valore1 1: 1 2: 2 3: 3 4: b 4 5: b 5 y chiave valore2 1: 1 2: b 2 3: c 3 4: d 4 when join error: setkey(x,chiave) x[y] # error in vecseq(f__, len__, if (allow.cartesian || notjoin) null else as.integer(max(nrow(x), : join results in 7 rows; more 5 = max(nrow(x),nrow(i)). check duplicate key values in i, each of join same group in x on , on again. if that's ok, try including `j` , dropping `by` (by-without-by) j runs each group avoid large alloc

excel - Naive Bayes Ticket Classification Python -

i have csv export our ticketing system 2 columns. short description , class. both created agent when logging ticket. eg data backup not working,backup email change in groups,notes backup directory not found,backup email > global - lotus notes,notes i have been asked write naive bayes program using python read short description in csv file , decide how should classified. i have 329 tickets have been classified 6 different classes. the following count of each: class1 60 class2 77 class3 65 class4 16 class5 18 class6 93 i thinking have create 6 different dictionaries (one each class) containing words used in short description, excluding usual !"£$%^&*()<>,./?:;@'#~][{} then when run program tokenize short description using nltk , compare dictionaries , whatever 1 has highest matches determine class. am going right way? how many tickets should using sample? the following have @ moment. runs through csv file named after class , o

fullpage.js can't move to next section on touch device -

i've set website using fullpage.js. have problems on touch-devices: when autoscrolling enabled can't swipe other section. it's on bottom of page. have issue on touch-devices i've tried (ipad & iphone chrome , safari, android chrome). on desktop computer don't have problem. visit www.airport-signage.com see issue. my settings fullpage.js: $(document).ready(function() { $('#fullpage').fullpage({ anchors: ['home', 'approach', 'work', 'services', 'company', 'team', 'contact'], menu: '#menu', 'autoscrolling': true, 'controlarrows': true, 'slidesnavigation': false, 'verticalcentered': false, 'touchsensitivity': 5, 'css3': true, 'fixedelements': '#fixedheader', 'scrolloverflow': true,

php - Laravel 5.1 Update message but it touch both created_at and updated_at -

as title, after update message using code below: $id = 1; $message ="updated"; post::where(['id' => $id])->update(['message' => $message]); both created_at , updated_at change current timestamp. how make update timestamp updated_at , dont update timestamp @ created_at when using update? thanks your created_at column set auto-updated .

c++ - visual studio configuration type dll: how to turn off lib overwrite? -

is possible turn off .lib overwrite when building dll in vs2010? i need both .lib , .dll, when turn configuration type dll, .lib in outpufolder gets overwritten 1-2kb .lib useless linking in main project. edited after comment if want dynamic library (creates dll , lib file) , static library (lib file), need separate configurations in visual studio building dynamic library , static library. usually vs provides per default "debug" , "release" configuration. add additionally "debugstatic" , "releasestatic" configuration static library. per default vs uses configuration names output directories, have following dirs: -project --debug ---libraryd.dll ---libraryd.lib --release ---library.dll ---library.lib --debugstatic ---libraryd.lib --releasestatic ---library.lib

javascript - How to detect to much memory being used in browser -

this question has answer here: jquery or javascript find memory usage of page 10 answers i writing client side applications, regularly run issue whereby using memory on lower end device , stops processing javascript compensate this. appears common 'solution' problem on lower end devices. is there reasonable way detect memory usage and/or limits or when limit has been reached , scripts failing, etc. if can detect this, can implement solutions handle (like limit caching, more lazy loading, etc.) please not mark question duplicate question answers how detect memory usage , not estimating memory limitations! this might you: http://www.monitis.com/blog/2011/05/15/30-tips-to-improve-javascript-performance/ as page performance: use 'profiles' tab in chrome developer window(press f12 fire up) firebug profiler in firefox

linux - GIT push fails with message "error: failed to push some refs to" and "error: git-remote-https died of signal 13" -

i have been using cvs2git tool migrate several projects cvs github repository. of projects succeeded 3 of them failed below message when running: [root@nj09mhe5384 tdc-misc]# git push --all origin counting objects: 8586, done. delta compression using 2 threads. compressing objects: 100% (3015/3015), done. fatal: remote end hung unexpectedly error: failed push refs ' https://github.com/kingshuk-chakraborty/tdc-misc2.git ' error: git-remote-https died of signal 13 i tried run git_transport_helper_debug=1 git push --all origin clue it. i got below message debug: remote helper: waiting... counting objects: 8586, done. delta compression using 2 threads. compressing objects: 100% (3015/3015), done. debug: remote helper quit.8/8586) fatal: remote end hung unexpectedly error: failed push refs ' https://github.com/kingshuk-chakraborty/tdc-misc2.git ' debug: disconnecting. error: git-remote-https died of signal 13 then ran strace -f ,

c++ - My program gives segmentation fault in openSUSE -

i have laptop in i've installed opensuse 13.2 month ago. when try run c++ program print shortest path, segmentation fault. on other hand, code works on computer on ubuntu installed. here output in ubuntu... rohan@symantha:~/dropbox/cprog/arrayss/2d$ uname -a linux symantha 3.13.0-53-generic #89-ubuntu smp wed may 20 10:34:28 utc 2015 i686 i686 i686 gnu/linux rohan@symantha:~/dropbox/cprog/arrayss/2d$ g++ 16.cpp rohan@symantha:~/dropbox/cprog/arrayss/2d$ ./a.out enter total rows : 4 enter total cols : 4 enter array -> 1 0 0 0 1 1 1 0 0 1 1 0 1 1 1 1 input ok .. enter source row: 0 enter source col: 0 enter destination row: 3 enter destination col: 3 shortest path -->> path : (0, 0) -> (1, 0) -> (1, 1) -> (1, 2) -> (2, 2) -> (3, 2) -> (3, 3) but in opensuse, this... rohan@linux-zdor:~/dropbox/cprog/arrayss/2d> uname -a linux linux-zdor.site 3.16.7-21-desktop #1 smp preempt tue apr 14 07:11:37 utc 2015 (93c1539) x86_64 x86_64 x86_64

html - nested microdata properties with 3 levels -

i'm trying use micro data (using http://schema.org ), have difficulties nested properties. in short, i'm trying have product, contains review, in turn contains author. 2 first levels ok, when try add other review (of type "person"), google tells me 2 things : other missing review , product doesn't accept author properties. it seems fail have author within review. my code has first level : <div itemscope itemtype="http://schema.org/product"> then later : <span itemtype="http://schema.org/review" itemprop="review"> <p itemprop="reviewbody">myreview...</p> (author :<span itemprop="author" itemscope itemtype="http://schema.org/person"> <span itemprop="name">name of auhor</span> </span>) </span> can of spot mistake here ? thanks lot ! you missed name product , didn't declare item scope review.

c# - Endpointnotfoundexception : active endpoint raising error sometimes -

we working on ecommerce project data fetched restfull webservices. using async-await programming model. some services being requested using channelfactory class , since cannot have async approach using channelfactory nor webservice provides us, using different approach shown below. var customerlocationtask = task.run(() => new orderservice().getcustomerlocation(customerid)); var customercountrytask = this.cmscustomercountrycode(customerid); await task.whenall(customerlocationtask, customercountrytask); here, requesting 2 webservices in unnatural async approach , our webservice being called in synchronous fashion using channelfactory . , code cmscustomercountrycode is: public async task<string> cmscustomercountrycode(string customerid) { orderservice orderservice = new orderservice(); customer customer = await task.run(() => orderservice.getcustomer(customerid, responseformat.json)); return customer.billtoaddress.country; } t

javascript - changing the text of a button in ajax -

i have list confirmation buttons generated dynamically using php.when click button want change "approved".but not doing so?nothing changes though query submitted successfully.any please.here js code snippet: function appr ($ref) { var job_id= $ref; var resp; var buttons=$('.confirm'); buttons.click(function(){ var $this=$(this); $this.text=('approved'); }); if (window.xmlhttprequest) { resp = new xmlhttprequest(); } else if (window.activexobject) { resp = new activexobject("microsoft.xmlhttp"); } var data = "job_id="+job_id resp.open("post", "approve.php", true); resp.setrequestheader("content-type", "application/x-www-form-urlencoded"); resp.send(data); resp.onreadystatechange = display_data; function display_data() { if (resp.readystate == 4) { if (resp.status == 200) { document.getelementbyid

RemovedInDjango19Warning when using django-polymorphic -

i started use django-polymorphic in project, based on django 1.8.1. it works fine, following warning: env/lib/python2.7/site-packages/django/contrib/contenttypes/models.py:159: removedindjango19warning: model class django.contrib.contenttypes.models.contenttype doesn't declare explicit app_label , either isn't in application in installed_apps or else imported before application loaded. no longer supported in django 1.9. class contenttype(models.model): i've plugged polymorphic this: installed_apps = ( 'polymorphic', 'django.contrib.contenttypes', ... 'myapp1', 'myapp2', ) in myapp1/models.py have base model: class mybasemodel(polymorphicmodel): id = models.uuidfield(primary_key=true, default=uuid.uuid4) # other fields and in myapp2/models.py have derived models: from myapp1.models import mybasemodel class myderivedmodel1(mybasemodel): # fields class myderivedmodel2(mybasemodel): #

c++ - How to show different Frame per second of video in two window in opencv -

i using opencv show frames camera. want show frames in 2 separation windows. want show real frame camera first window (show frames after every 30 mili-seconds) , show frames in second window delay (that means show frames after every 1 seconds). possible task. tried code not work well. please give me 1 solution task using opencv , visual studio 2012. in advance this code videocapture cap(0); if (!cap.isopened()) { cout << "exit" << endl; return -1; } namedwindow("window 1", 1); namedwindow("window 2", 2); long count = 0; mat face_algin; while (true) { mat frame; mat original; cap >> frame; if (!frame.empty()){ original = frame.clone(); cv::imshow("window 1", original); } if (waitkey(30) >= 0) break;// delay 30ms first window } you write loop display frames in single function video file name argument , call them simultaneously multi-threading. the

kerberos - Using Java 8 S4U2Proxy - A good example needed -

i trying use s4u2proxy introduced in java 8. unfortunately not successfull in finding many examples. requirement client send certificate. should delegate (using kerberos) request, connect kdc, tgt, service ticket contact server on user's behalf , contact actual service providing service ticket. if java 8 not provide clean approach, can pls point me other utilities might solve requirement. subject.doas(subject, new privilegedaction<object>() { @override public object run() { gssmanager manager = gssmanager.getinstance(); gsscredential self = null; try { gssname selfuser = manager.createname("servicewhowantstoimpersonate", gssname.nt_user_name); oid krb5oid = new oid( "1.2.840.113554.1.2.2"); self = manager.createcredential(selfuser.canonicalize(krb5oid), gsscredential.default_lifetime, krb5oid, gsscredential.initiate_only); gssname user

Proper way to declare custom exceptions in modern Python? -

what's proper way declare custom exception classes in modern python? primary goal follow whatever standard other exception classes have, (for instance) string include in exception printed out whatever tool caught exception. by "modern python" mean run in python 2.5 'correct' python 2.6 , python 3.* way of doing things. , "custom" mean exception object can include data cause of error: string, maybe other arbitrary object relevant exception. i tripped following deprecation warning in python 2.6.2: >>> class myerror(exception): ... def __init__(self, message): ... self.message = message ... >>> myerror("foo") _sandbox.py:3: deprecationwarning: baseexception.message has been deprecated of python 2.6 it seems crazy baseexception has special meaning attributes named message . gather pep-352 attribute did have special meaning in 2.5 they're trying deprecate away, guess name (and 1 alone) forbidden? ugh.

excel - Why does Workbooks.Open close default workbook? -

we developing excel plugin. have found issue visualbasic code fails when user runs after opening excel. the code obtains workbook webservice , attempts insert sheet new workbook original workbook. fail when user has not interacted "default" workbook. what mean "default" workbook created when excel starts, or press 'ctrl+n'. the reason failure code: workbooks.open (url) shuts default workbook. why should be? only default workbook shut. if had workbook open, above code not shut it. we have tried work around issue storing reference active workbook. set wkbmyworkbook = activeworkbook workbooks.open (url) but after workbooks.open closes "default" workbook, reference variable still exists , has content. what doing wrong? can help? i don't have answer why happens, workaround idea, still happen if first write worksheet? example: cells(1,1)="x" cells(1,1).clearcontents

How can I make OxyPlot adjust zoom when calling PlotView.Invalidate? -

i have problem oxyplot follows: i create new plotview , attach plotmodel axes when program starts. in program, user can open file, interpreted , plotted in plotview control. to display new series, do myplotview.invalidate(true); this display data on in plot, oxyplot not perform zooming. how can pan , zoom automatically, such plot covers whole plotview? i tried set myplotview.model.axes[0].dataminimum = somevalue1 myplotview.model.axes[1].dataminimum = somevalue2 myplotview.model.axes[0].datamaximum = somevalue3 myplotview.model.axes[1].datamaximum = somevalue4 but nothing happens. axes calculates viewminimum , viewmaxium (the real thing watching) if minimum , maximum not specified, can set them double.nan before resetting, viewminimum , viewmaximum calculated based on dataminimum , datamaximum foreach (var ax in _plotmodel.axes) ax.maximum = ax.minimum = double.nan; plotview.resetallaxes(); also if changed data points, must call pl

android - How To open Application from the Link in the message which is sent by the branch.io? -

Image
i create deep link application register on branch.io . sent url using message. when clicked on link redirecting me google playstore though have application installed on phone. my intent filter : <data android:scheme="finaldeeplinking" android:host="open" /> <action android:name="android.intent.action.view" /> <category android:name="android.intent.category.default" /> <category android:name="android.intent.category.browsable" /> uri scheme on branch.io : finaldeeplinking:// thanx in advance the branch default before few days ago try open app if service knew 100% app installed, defined whether had seen browser cookie matched branch-tracked app session. otherwise, link 307 redirect play store url. however, changed default 'always open app' based on needs of developers. need update setting. can toggle switch on link settings dashboard .

android - Song being played in background and user again clicks app icon -

my app music player app , using bound service in app, working fine except if open app play song list of searched result , press home button or button, song being played in background(through bound service) , again launch app clicking app icon, seekbar moving pause button changed play button , there not list of searched result(every thing on initial stage except seekbar). how can open app on clicking app icon situation left app? time , help i added android:cleartaskonlaunch="true" in manifest file in launcher activity <activity android:name="" android:label="@string/app_name" android:launchmode="singletop" android:screenorientation="portrait" android:windowsoftinputmode="adjustpan" android:cleartaskonlaunch="true"> and started behaving want

oracle - How to create a select statement that satisifies multiple condition from a single column? -

here have 3 columns : id(number),part_name(varchar) , part_value(clob)(all 3 forms primary key). i'm having scenerio in such way should check multiple conditions same column. eg : particular id, should check different part_name , corresponding part_value. below wrong know. reference i'm including select count(0) my_table id = 'xyz' , ( ( ( part_type='sw nut prod' , dbms_lob.compare(part_value,'nut , non-standard key')=0 ) or ( part_type='sw nut prod' , dbms_lob.compare(part_value,'limes key , document')=0 ) or ( part_type='sw nut prod' , dbms_lob.compare(part_value,'limes physical key , document')=0 ) ) , ( part_type='trim' , dbms_lob.compare(part_value,'false')=0 )

qt - Python script crashes when closing after running matplotlib with qt4agg because of import -

i have written script using matplotlib, runs fine standard matplotlib. script written plot class, , calling plot() enough running. now want add buttons toolbar, , using qt4agg because have installed matplotlib via anaconda. when writing code main window used this example, , runs fine. in order use plot script have written want pass figure created in qt-script plot()-class. this solution works fine, until try close window. window closes, , python crashes. crashes though not call plot()-class, , way not crash remove line importing file. there special need think when importing script window? from __future__ import print_function import sys matplotlib.figure import figure matplotlib.backend_bases import key_press_handler ### line causing trouble plotting import plot ### test import * matplotlib.backends.backend_qt4agg import figurecanvasqtagg figurecanvas matplotlib.backends.backend_qt4agg import navigationtoolbar2qt navigationtoolbar matplotlib.backends import qt_compat use_pys

java - can't split json string as parameter in jsonarray -

i have code , tried getting items string but it's failed i have used eclipse ide i have parsing json string remote host package selectdb; import java.io.*; import java.net.url; import java.net.urlconnection; import java.sql.*; import java.text.dateformat; import java.text.simpledateformat; import java.util.date; import java.util.timer; import java.util.timertask; import org.json.simple.jsonarray; import org.json.simple.jsonobject; import org.json.simple.parser.jsonparser; import org.json.simple.parser.parseexception; public class selectdb { public static void main(string[] args) throws ioexception, parseexception { string line; string s = ""; url u = new url("http://192.168.3.1/android/select.php"); urlconnection c = u.openconnection(); inputstream r = c.getinputstream(); bufferedreader reader = new bufferedreader(new inputstreamreader(r)); for(; (line = reader.readline()) != null;) {

python - Generate large file and send it -

i have rather large .csv file (up 1 million lines) want generate , send when browser requests it. the current code have (except don't generate same data): class csvhandler(tornado.web.requesthandler): def get(self): self.set_header('content-type','text/csv') self.set_header('content-disposition','attachement; filename=dump.csv') self.write('linenumber,measure\r\n') # file header line in range(0,1000000): self.write(','.join([str(line),random.random()])+'\r\n') # mock data app = tornado.web.application([(r"/csv",csvhandler)]) app.listen(8080) the problems have method above are: the web browser doesn't directly start downloading chunks sent. hangs while webserver seems prepare whole content. the web server blocked while processes request , makes other clients hang. by default, data buffered in memory until end of request can replaced error page if exception occu

R extracting non-missing data -

this question has answer here: remove rows nas (missing values) in data.frame 12 answers i have dataframe: a<-c(1,2,3) b<-c("cara","carb",na) data<-data.frame(a,b) data b 1 1 cara 2 2 carb 3 3 na now want remove row missing data (na). but not work: data<-data[data[,2]!=na,] my thinking here @ second column [,2] , don't have na. extract remaining data. able tell me went wrong here? wouldn't na.omit(data) do? seems cleanest , fastest way me. by way, code not work because cannot !=na use is.na() instead (but na.omit() better): data[!is.na(data[,2]),]

vb.net - Binding a custom property to a datatable field ,the source table is changing when navigating through items -

i've got custom control inherited textbox added custom property follows dim _myval object public property myval object return _myval end set(value object) _myval = value if isnothing(value) orelse isdbnull(value) me.text = "null" else select case _myval case 1 me.text = "newyork" case 2 me.text = "london" case 3 me.text = "zwara" case else me.text = "unknown" end select end if end set end property so bound property datatable field in simple winform datagridview , custom textbox follows public class form10 dim dtmain new datatable dim bsmain new bindingsource private sub form10_load(sender system.object, e system.eventargs) handles mybase.load dtmain.columns.add("name", getty

php - get $_SERVER["DOCUMENT_ROOT"] without using superglobals -

i'm running php script command line, superglobals not defined. how can $_server["document_root"] without using superglobal $_server? superglobals such $_server haven't been set yet (because apache/nginx/etc) sets these values. you're running command line, there no apache/nginx/etc set them, resulting in them becoming null . there 2 alternatives can use. using __dir__ you can use magic constant __dir__ output directory of current file. php -r "echo __dir__;" /var/www/html this give different results depending on run from. i.e: /var/www/html/lib/foo return differently if ran /var/www/html/views/index . - not you're looking for. setting own constant within bootstrap file ( as mentioned in comment ), can set own constant used throughout application. define('__document_root__', __dir__); now within page run (as long uses bootstrap file), can call __document_root__ constant value would mirror $_server["docu

multithreading - How to disperse single core process to multi core -

i use dual-core, delphi xe6 , api doesn't support multi-core. application coded these makes full load of 1 core. can disperse load other core? what looking more multithreading. (or maybe multiprocessing.) you should rewrite application process data , perform tasks in parallel manner. while not difficult task, wording of question suggests, not familiar concept of parallel programing. if wish learn how utilize threads this question , this embarcadero article , , this delphigeek article might find general direction.

excel - VBA copy paste range into corresponding range for rows with content -

i have spreadsheet called "sicknessrecordgraded" has varying number of rows. columns - f (1 - 6), have raw content calculate. columns - ag (9 - 33) there range of formulas calculate information in - f. preparing vba macro auto copy range of formulas - ag each row there content in - f. have been attempting write macro follows. have range copy correct using .resize function, have not figured out how paste correct range. public sub experiment2() dim rw long rw = 3 ' select initial sheet copy sheets("sicknessrecordgraded").select ' find last row of data - xlup check bottom of spreadsheet up. finalrow = cells(rows.count, 1).end(xlup).row ' loop through each row x = 1 finalrow cells(rw, 9).resize(1, 33).copy ' resize intial range. columns - ag. nextrow = cells(rows.count, 1).end(xlup).row + 1 'continue incrementing through rows. cells(nextrow, 1).select ' find next ro

android - getting STATE_DISCONNECTED while connecting using bluetooth smart -

i trying create advertiser on android l , other android device scanning device , trying make connection it. but every time call connectgatt getting bluetoothprofile.state_disconnected in gatt callback. this how have created advertisement // advertisement settings advertisesettings.builder buildersetting= new advertisesettings.builder(); buildersetting.setadvertisemode(advertisesettings.advertise_mode_balanced); buildersetting.setconnectable(true); buildersetting.settimeout(0); buildersetting.settxpowerlevel(advertisesettings.advertise_tx_power_high); //advertisement data advertisedata.builder builderdata = new advertisedata.builder(); builderdata.addserviceuuid(new parceluuid(uuid.fromstring("00002a29-0000-1000-8000-00805f9b34fb"))); byte mservicedata[] = { (byte)0xff, (byte)0xfe, (byte)0x00, (byte)0x01, (byte)0x02, (byte)0x03, (byte)0x04 }; // tried addding service data builderdata.addservicedata(new

apk - Why does the Android App that sends data to azure SQL Database not running on phone but on AVD on Android Studio? -

i trying make android app sends data phone sql database @ azure cloud. i have followed, close possible,the tutorials given on https://azure.microsoft.com/en-us/documentation/articles/mobile-services-dotnet-backend-android-get-started/ first off all, have little bit confusion regarding creating .apk file in android studio. here, have assumed .apk in \app\build\outputs. now, trying run app-debug.apk on redmi 1s android version 4.3 jls36c, app opens , vanishes away. tried run on samsung galaxy note-3 neo (sm-n750) android version:android 4.4.2 when try run app on emulator itself, running. not on phones. do? here build.gradle file apply plugin: 'com.android.application' android { compilesdkversion 20 buildtoolsversion "19.1.0" defaultconfig { applicationid "com.example.zumoappname" minsdkversion 8 targetsdkversion 20 versioncode 1 versionname "1.0" } buildtypes { release { minifyenabled false prog

ColdFusion : URLDecode("%ara%") is giving me as %ar% -

in coldfusion, urldecode() decodes url-encoded string (url encoding formats characters percent sign , two-character hexadecimal representation of character). example: %3a hex equivalent ":(colon)" when urldecode() applied on different strings below, urldecode("%3a%") = :% -- valid urldecode("%ee") = � -- because ee has no equivalent character. but trying decode string "%ara%" invalid, result getting "%ar%". don't find 2nd occurrence of character "a".can explain me why happening??

fiware - Filter queryContext with attribute value in orion context broker -

i'm doing querycontext against instance of orion context broker , filter query obtain entities according value of 1 of attributes. i not filtered results using attributeexpression, through curl request, or javascript wirecloud ngsi api. i browsed context broker orion code , seems attributeexpression not implemented. using json querycontext curl. could please give me example? current orion version (0.22.0 @ time of writting this) implements set of filters described in this section of orion user manual . note current filters implemented in standard operations using scope instead of attributeexpression, but, @ end, common way in oma ngsi of defining restrictions. unfortunatelly, attribute value filters not supported. news functionality part of ngsiv2 being worked out. have q url parameters "list entities" convenience operation @ ngsiv2 specification webpage . q filters parameter have correspondence in restriction element standard operations (to defin

exec - execute PHP script and get an update of process -

i need write script in php read list of xml , convert them in text file i add button in page triggers exec("xml2csv.php"); since can have lot of them give user feedback on process update, can text feedback kind of javascript image upload % update i'm not sure possible , how proceed provided know number of lines or bytes of xml must parse, have php script write file on server number of bytes (or lines) has completed writing periodically throughout scripts execution using file_put_contents() . on client side, using ajax, poll server contents of file , display result user every x seconds. using jquery's $.post this.

regex - Matching floating point range using regular expression -

i need regular expression, matches within range of floats. for range 12.33 - 13.41 tried following regex: (12.[3-9][3-9]|13.?[0-4][0-1]?)\d{0,2} but doesn't match i.e. 12.41 or 13.39. is possible regular expressions? kind regards, bernie70 i don't know worth it, possible. try with: (12.(3[3-9]|[4-9]\d))|(13(.([0-3]\d|4[01]))?) it means: 12. -- starts '12.', 3[3-9] -- 3 followed digit range 3 9 (33-39), | -- or [4-9]\d -- digit range 4 9 followed digit (40-99), | -- or 13 -- starts '13' . -- dot [0-3]\d -- digit range 0 3 followed digit, | -- or 4[01] -- 4 followed 0 or 1, ? -- 0 or 1 time and (.([0-3]\d|4[01]))? treated 1 group, allow '13', not '13.' it match numbers like: 12.33, 12.99, 13.41 ,13 ,12.41 ,13.39 ,etc. , ignore: 12.32, 13.42, etc. your code didn't work because: (12.[3-9][3-9]|13.?[0-4][0-1]?)\d{0,2} [3-9][3-9] - allows numbers ranges (33-39,43-49,53-59,...), [0-

unity3d - One unity instance, two unity windows? -

when run application want unity open 2 windows. windows have different cameras both view same world. is such thing possible? (i haven't been able find evidence suggest so) i know achieve 2 unity instances need one. actually, recent update unity added support multiple displays, you're describing. can read them here .

java - Can't start jBoss AS 7.1 -

i trying start jboss. when start server,i getting following lines on console. 14:41:25,969 info [org.jboss.modules] jboss modules version 1.1.1.ga 14:41:26,743 info [org.jboss.msc] jboss msc version 1.0.2.ga 14:41:27,015 info [org.jboss.as] jbas015899: jboss 7.1.2.final-snapshot "brontes" starting and shows log saying "starting server jboss 1.7 has encountered problem".i increased timeouts. doesn't works.i don't understand wrong. jboss 7.1 not start java 1.8. here forum thread of issue. if need use java 1.8 consider using wildfly