Posts

Showing posts from May, 2011

database - PostgreSQL 9.4 suddenly invalid memory alloc request size -

i'm building website used handle excel files stores , manipulate them (merging, view, etc.). i'm using postgresql 9.4 database, running on centos 6.6 vm 4gb ram. has 3 databases follow: postgres database db_raw, used placeholder data. excel uploaded website parsed, , data stored here. database consists of few tables used keep data required process excel, , huge table storing excel data >140 column , 1 million row db_processed, main database website. has few small tables operational of website (user table, access list, logging, etc), , 8 tables store processed excel data db_raw. each of 8 tables have around 40 column , million row. the databases running fine until morning. tried connecting db_processed through pgadmin , putty, , postgresql gave me message fatal: invalid memory alloc request size 144115188075856068 db_raw works fine, , nothing has been changed since 3 days ago far know. should can connect database again? update : did @craigringer said , rest...

Add bash aliases to python package commands -

i have written small python module provides commands such: cheesy (ls|list) i alias cheesy ls ch-ls . don't want add manually bash_rc, create alias environment automatically when package setup.py installs. i wondering if can add bash function package , add shell using python.

ios - Bouncing animation while changing view frame -

add bouncing animation while changing uiview frame. know how change frame don't know how set bouncing effect while changing view frame. below code.... [uiview animatewithduration:0.3 delay:0.0 options:uiviewanimationoptionbeginfromcurrentstate animations:^{ cgrect frame = viewcontent.frame; frame.size.height = cgrectgetheight(viewcontentfulldetail); viewcontent.frame = frame; } completion:^(bool finished) { }]; you can check animated gif image on below link. want add animation not same near this. main animation unfolding , bouncing effect. https://drive.google.com/open?id=0b9k_shyb5v62efdxwxhyexv3a0e please help. don't know how this. you need try this int duration, damping, velocity; [uiview animatewithduration:duration delay:0 usingspringwithdamping:damping initialspringvelocity:velocity options:0 animations:^{ // animation code here } completion:nil]; play damping , velocity values know more feature in animation code. here lin...

javascript - Check my site in different browser version for mobile friendliness -

actually have no idea actually, need need check site mobile friendliness on different mobile browsers on different versions. like android browser version 1 ok version 2 ok version 3 not ok ext.... similarly on different mobile browsers have till now. tested on browser stack can find limited no. of browsers , versions. if happens knows particular site or url relates concern please comment or answer. links know are: browser stack.com , http://webtrends.about.com/od/mobileweb20/tp/list_of_mobile_web_browsers.htm , test mobile etc. but need detailed analysis.. https://www.google.com/webmasters/tools/mobile-friendly/ you can use test mobile friendliness. here few more websites help: https://validator.w3.org/mobile/ https://validator.w3.org/mobile/ http://mobiletest.me/ - 1 lets choose device emulate browser

amazon web services - Increase ROOT_SIZE of minion in aws kubernetes cluster -

i making kubernetes cluster in aws. using kubernetes version 1.0.6. things necessary running cluster works fine in version. need increae root disk size of minions. created default 8gb. want them 40gb instead. using t2.micro cluster. the problem there env variable minion_root_disk_size in version : master, 1.1.0-alpha.1. in 1.0.6 there no env variable in name. , setting variable in 1.0.6 did not work work 1.1.0-alpha.1. can't use pre release or can't jump 1.0.6 1.1.0-alpha.1. need increase minions , masters root disk size. how can achive that? the config file both version here: v1.1.0-alpha1 v1.0.6 using for still have problem here solution. if have kubernetes file u can achive editing " cluster/aws/util.sh " file. find block_device_mappings , add this {"devicename":"/dev/sda1","ebs":{"volumesize":40, "volumetype": "gp2"} this feild string u need add \ before every " {\...

C# Windows Phone 8.1 GetOutputStreamAsync(...) blocking after first use -

i'm trying create basic test app should: 1) broadcast "sometext" on port "1234" 2) wait second answers 3) return answers while solution posted below works fine first time, every subsequent call blocks forever at: stream = await socket.getoutputstreamasync(...) till tried every possible way of cleaning (since thats suppose failure), wrapping in using(...) statements. the problem occurs emulator hardware device using windows phone 8.1 thanks in advance! the code start "discovery": private void button_click(object sender, routedeventargs e) { pluginudp pudp = new pluginudp(); var task = pudp.scan("asf"); task.wait(); foreach (string s in task.result) output.text += s + "\r\n"; } the code "discovery" itself: using system; using windows.networking; using windows.networking.sockets; using windows.storage.streams; using system.text; using system.io; using system...

hadoop - Dealing with irregular timed data with Oozie coordinator -

i have multiple sources of data needs considered in oozie coordinated workflow. data sets irregularly generated, means data may not generated days. instance: data_set1: ds1-1 - sept-1-2015 - data available ds1-2 - sept-2-2015 - no data ds1-3 - sept-3-2015 - no data ds1-4 - sept-4-2015 - data available ds1-5 - sept-5-2015 - data available ds1-6 - sept-6-2015 - no data ds1-7 - sept-7-2015 - data available. data_set2 ds2-1 - sept-1-2015 - data available ds2-2 - sept-2-2015 - data available ds2-3 - sept-3-2015 - data available ds2-4 - sept-4-2015 - no data ds2-5 - sept-5-2015 - data available ds2-6 - sept-6-2015 - data available. ds2-7 - sept-7-2015 - no data my oozie coordinator job scheduled run daily. however, since data set may not available, must pick dataset whichever available , latest. above given data sets, expect following datasets considered each run: sept-1-2015 - ds1-1, ds2-1 sept-2-2015 - ds1-1, ds2-2 #since no ds1 available day2. ...

How do I extract rows from a PDF file into a csv file? -

i want list of colleges in usa pdf file , put csv file. import csv file sql server (so can run queries easily). i tried several online pdf csv converters , java based pdf csv tutorials. nothing worked. have spent 6-8 hours today , failed. csv files messed , had lot of nulls in db when imported csv. tried searching dhs api give me info found none. can please me extract colleges shown in pdf file ? ps: can see colleges using this url also. but, have scroll manually extract results. take long , data not in format given in pdf file. as claimed in comment question, considering straight forward page content stream style, data should extractable using not complicated custom text extractor. in detail: the page content stream style regular table entry content drawn entry entry, each entry field field in reading order. thus, while going through content stream not have try , re-arrange content establish order. makes task easy. so main work ignore non-entries, i...

ruby on rails - How to use Spree's Authentication in form -

i learning rails , creating web app got ecommerce in there form user can fill if logged in, using devise, e-commerce installed spree spree got own login authentication, , there no authenticate_user! in controllers too, removed devise , having tough time finding how use spree's authentication form here updated form's controller: complaints_controller.rb module spree class complaintscontroller < spree::storecontroller before_action :require_login before_action :set_complaint, only: [:show, :edit, :update, :destroy] # /complaints # /complaints.json def require_login redirect_to spree_login_path unless current_spree_user end def index @complaints = complaint.all end # /complaints/1 # /complaints/1.json def show end # /complaints/new def new @complaint = complaint.new end # /complaints/1/edit def edit end # post /complaints # post /complaints.json def create @complaint = complaint.ne...

python - list filter by custom list display field in django admin -

i have following model admin. i'm displaying custom field in list view. class customeradmin(admin.modeladmin): list_display = ('first_name', 'last_name', 'email', 'state') search_fields = ('first_name', 'last_name', 'email') list_filter = ('state',) def state(self, obj): address = address.objects.filter(owner=obj.id) if address: return address.state return none i tried above gives error "list_filter[0]' refers 'state' not refer field." want filter records state. how can in django 1.5? class customeradmin(admin.modeladmin): list_display = ('first_name', 'last_name', 'email', 'state') list_filter = ('state',) search_fields = ('first_name', 'last_name', 'email') def state(self, obj): address = address.objects.filter(owner=obj.id) if address: return address....

Groovy Servlet met java.lang.ClassNotFoundException: groovy.lang.GroovyObject -

i'm trying build simple servlet using groovy. since it's single servlet plus couple of gsp pages don't want integrate grails project because i'm new it. when want servlet run on tomcat server(v7.0) met such exception: java.lang.classnotfoundexception: groovy.lang.groovyobject org.apache.catalina.loader.webappclassloader.loadclass(webappclassloader.java:1714) org.apache.catalina.loader.webappclassloader.loadclass(webappclassloader.java:1559) java.lang.classloader.defineclass1(native method) java.lang.classloader.defineclass(classloader.java:800) java.security.secureclassloader.defineclass(secureclassloader.java:142) org.apache.catalina.loader.webappclassloader.findclassinternal(webappclassloader.java:2904) org.apache.catalina.loader.webappclassloader.findclass(webappclassloader.java:1173) org.apache.catalina.loader.webappclassloader.loadclass(webappclassloader.java:1681) org.apache.catalina.loader.webappclassloader.loadclass(webappclassloader.java:1559)... look @...

javascript - How to convert Unix Timestamp to date with GMT (IST) format using moment in AngularJs -

test:{"a":"\/date(1442773800000+0530)\/","b":"423"} hi getting big trouble,above data (json format), here using momentjs convert unix time stamp date , time without using + 530 code, sometime date not showing correct format, automatically convert different utc/gmt (time zone), moment(test.a).format('dd-mm-yyyy hh:mm') how use including gmt(+530) in moment script utcoffset() preferred method of moment 2.9.0. function uses real offset utc, not reverse offset. moment(1369266934311).utcoffset(+530).format('yyyy-mm-dd hh:mm') and if using moment version less 2.9. can go : moment(1369266934311).zone(+530).format('yyyy-mm-dd hh:mm')

java - Exception with Spring ExceptionHandler and Rest response -

i'm using @exceptionhandler manage exception , return json response rest api throws exception. @ moment manage 2 exception, first resourcenotfoundexception , works second, fileextensionexception, doesn't work. throws exception in eclipse console , nothing rest response. 2015-09-21 09:09:05.197 error 7500 --- [nio-8080-exec-2] .m.m.a.exceptionhandlerexceptionresolver : failed invoke @exceptionhandler method: public matlab.errorresponse matlab.errorcontroller.errorhandler(java.lang.exception) org.springframework.web.httpmediatypenotacceptableexception: not find acceptable representation @ org.springframework.web.servlet.mvc.method.annotation.abstractmessageconvertermethodprocessor.writewithmessageconverters(abstractmessageconvertermethodprocessor.java:173) @ org.springframework.web.servlet.mvc.method.annotation.abstractmessageconvertermethodprocessor.writewithmessageconverters(abstractmessageconvertermethodprocessor.java:101) @ org.springfr...

java - How to add ExpandableListView in android studio 1.2 under my CategoryFragment? -

Image
i use android studio 1.2 , want know how add submenu or call expandablelistview under category? hope can me.. here code.. mainactivity.java package com.example.administrator.mosbeau; import android.app.activity; import android.support.v7.app.actionbaractivity; import android.support.v7.app.actionbar; import android.app.fragment; import android.app.fragmentmanager; import android.os.bundle; import android.view.layoutinflater; import android.view.menu; import android.view.menuitem; import android.view.view; import android.view.viewgroup; import android.support.v4.widget.drawerlayout; public class mainactivity extends actionbaractivity implements navigationdrawerfragment.navigationdrawercallbacks { /** * fragment managing behaviors, interactions , presentation of navigation drawer. */ private navigationdrawerfragment mnavigationdrawerfragment; /** * used store last screen title. use in {@link #restoreactionbar()}. */ private cha...

ios - Linker command failed, cannot find library in existing project -

Image
i'm trying fix existing project. make bugfixes. when first opened project, libraries missing i've linked them again. because project on private git. when libraries linked again received error. tried delete direveddata, there no change. is there understands error , who's willing me it? thanks! i've changed folders of project warnings of "directory not found ok" received following error.

css - ion-nav-buttons full width -

i trying add search bar header on 1 of page. <ion-view view-title=""> <ion-nav-buttons side="left"> <label class=" item item-input-wrapper"> <i class="icon ion-ios-search placeholder-icon"></i> <input type="search" placeholder="search"> </label> </ion-nav-buttons> <ion-content> search content </ion-content> </ion-view> the search bar show in header expected. how can search field 100% width across header? did try apply: .buttons-left, .left-buttons{ width:100% !important; } it work. problem affect other pages well. tried add class , id ion-nav-buttons , doesn't shows up. how can apply custom width ion-nav-buttons on specific page? i not sure if best place put search field: <ion-nav-buttons> you can define custom header specific view: <ion-header-bar class=...

javascript - How to hide label in edge in visjs graph? -

i display label when edge selected, there library method this? eventually thought having store edge properties including label, idea? there no such method. what can listen selectedge events, , when edge selected, remove it's label. when edge deselected, add it's label again.

java - Intents issue in eclipse android -

i have issue intents. use in main activity , call activity on click call again main activity. here code main activity.java package com.umair.facebook; import android.app.activity; import android.content.intent; import android.os.bundle; import android.view.view; import android.widget.button; import android.widget.edittext; import android.widget.imageview; import android.widget.textview; public class mainactivity extends activity { imageview img1; textview txt, txt3; button like, share, update; edittext et1; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); img1 = (imageview) findviewbyid(r.id.img); txt = (textview) findviewbyid(r.id.name); txt3 = (textview) findviewbyid(r.id.status); = (button) findviewbyid(r.id.like); share = (button) findviewbyid(r.id.share); update = (butto...

r - How to do elementwise multiplication of big matrix with vector very fast? -

i want elementwise multiplication of vector every rows of big binary matrix. length of vector equal number of columns of matrix. have implemented using loop follow, it's slow. knows solution speed up? a<-c() m # binary matric w<-matrix(0, nrow=nrow(m), ncol=ncol(m)) w<-data.frame(w) for(i in 1:nrow(w)){ w[i,]<-m[i,] * } use vector recycling, since matrices filled columns, need transpose: t(t(m) * v)

javascript - How to access another views $scope in angular? -

good morning, i use angularjs build web application. make use of embed plugin of angularjs youtube. precise: https://github.com/brandly/angular-youtube-embed now pause video following event listener: player.pausevideo(); . have added 1 button. the youtube embed on same page above function called. markup of object is: <youtube-video video-id="video" id="youtube-video" player="player" style="height:450px; width: 100%"></youtube-video> the player attribute on object 1 should use link between object , function call. but want access player object on separate view html document. function on page doesn't pause video on view.html does know how access object on page using similar call player.pausevideo(); . if there questions, ask me! thank in advance. i'm assuming "player object" refering scope variable $scope.player , "another page" mean view, different scope, rendered same html docum...

algorithm - How to prove the optimality of this greedy algo? -

given n integers. each of these numbers can increased or decreased once no more given positive integer l. after each operation if numbers become equal consider them 1 number. problem calculate cardinality of minimal set of distinct integers. constraints: n <= 100, l <= 3200, integers in range [-32000, 32000] example: n = 3, l = 10 11 21 27 1) increase 11 10 => 21 21 27 2) decrease 27 6 => 21 21 21 the answer 1. algo in c++ language: sort(v.begin(), v.end()); // algo tries include elements in interval of length 2 * l int ans = 0; int first = 0; for(int = 1; < n; ++i) { if(v[i] - v[first] > 2 * l) { // if can't include i-th element ans++; // current interval first = i; // algo construct new } } ans++; printf("%d", ans); i try understand why greedy algo optimal. appreciated. reframed, we're trying cover set of numbers appear in input few intervals of cardinality ...

ios - Want to make rotating button which I can press while animating -

i've made rotating button. while button rotates can't press it. question how can make "pressable"? animation code is: var max: bool = true func startanimation() { max = !max let duration: double = 1 let fullcircle = 2 * m_pi let upordown = (max ? cgfloat(-1 / 16 * fullcircle) : cgfloat(1 / 16 * fullcircle)) let scale: (cgfloat, cgfloat) = (max ? (1.0, 1.0) : (1.3, 1.3)) uiview.animatewithduration(duration, animations: { () -> void in let rotationanimation = cgaffinetransformmakerotation(upordown) let scaleanimation = cgaffinetransformmakescale(scale) self.startbutton.transform = cgaffinetransformconcat(rotationanimation, scaleanimation) }) { (finished) -> void in self.startanimation() } so if press button there no effect has happened. no text inside button text animation - nothing! button keep rotating , don't perform segue other scene. if no animation can segue. use anim...

c# - Calling static delegate with reflection -

i need call delegate method using reflection, passing name of method string. for example, i'll pass my.controls.testdelegate.myconverteraction testdelegate class name , myconverteraction delegate: namespace my.controls { public static class testdelegate { public static customconversionhandler myconverteraction = new customconversionhandler(dosomething); private static ulong dosomething(object[] values) { return 2; } } } i thought use getmethod() method in way: int separator = actiondelegate.lastindexof('.'); string classname = actiondelegate.substring(0, separator); string methodname = actiondelegate.substring(separator + 1, actiondelegate.length - classname.length - 1); var t = type.gettype(classname); //this works methodinfo m = t.getmethod(methodname, bindingflags.public | bindingflags.static); //this returns null...even different bindingflags options but obtain null reference. how can solve prob...

java - JSP doesn't see CSS and JS files from resources folder -

Image
i have problem css , js import in web application. using servlets/jsp/css/js. i sorry question, saw many questions , answers theme , situation nothing helped me. i trying add css , js files this: <link rel="stylesheet" href="<c:url value='/resources/stylesheet/common.css' />"/> <link rel="stylesheet" href="<c:url value='/resources/stylesheet/index.css' />"/> <script type="text/javascript" src="resources/js/validators/loginvalidator.js"></script> but happends , of css , js files doesn't work. folders/files positions in project: i had tried many different ways terminate issue. tried this: https://stackoverflow.com/a/23687360/5331196 , https://stackoverflow.com/a/29012643/5331196 and nothing helped me. thing working dinamyc import: <%@include file="/resources/stylesheet/login.css" %> e.t.c. it helped, but, in case, there lot of code in ...

ios - Extract all the variables [NSNumber, NSDates, NSStrings, etc...] from entire XCode project -

is there way can variables declared [nsnumber, nsdates, nsstrings, etc...] entire xcode project. want use performing localization. i went through several tools extracts strings only. need types of variables result each controllers in xcode project. such xcode plugin help. thanks in advance.

javascript - Logo disappears in fullscreen mode -

i have added logo map when open map in full screen logo disappears. have tried change css full screen mode. using 1 leaflet. far couldn't find cause. $(document).ready( function init() { // initiate leaflet map var map = new l.map('map', { center: [51, 9], zoom: 4, minzoom: 3, maxzoom: 18 }); //load basemap var osm = new l.tilelayer('http://a{s}.acetate.geoiq.com/tiles/acetate-hillshading/{z}/{x}/{y}.png', { attribution: '&copy; <a href="http://www.openstreetmap.org/copyright">openstreetmap</a>' }).addto(map); //load data cartodb var layerurl = 'http://xyz.cartodb.com/api/v2/viz/0931f2164e4-76f8-1190d/viz.json'; cartodb.createlayer(map, layerurl) .addto(map) .on('done', function() {}).on('error', function() {}); }; // create fullscreen button , add map ...