Posts

Showing posts from September, 2015

php - mySQL problems with this code? -

i having problems code , hoping can help. basically have issue whereby mysql running out of connections when script run hundreds of times in sequence. https://gist.github.com/anthonyts/b6c46d54ee8bf2d714b8 here database class: https://gist.github.com/anthonyts/89f5a831e31d970fb5e1 here error get: e_error: call member function query() on non-object stack trace: in db::single called @ /var/www/html/scripts/stalk/db.php (68) in db::single called @ /var/www/html/scripts/stalk/beanstalk_check_monitoring_logs.php (88) in {closure} called @ /var/www/html/application/libraries/stalk.php (80) in stalk::background called @ /var/www/html/scripts/stalk/ beanstalk_check_monitoring_logs.php (188) you should put db initialization: $con = mysql_connect(db_host, db_user, db_pass); mysql_select_db(db_database); $db = new db(db_host, db_user, db_pass, db_database); above your: $stalk = new stalk(array(beanstalkd_server, beanstalkd_port)); on top of script, create

java - Checkbox item adds to spinner -

i have 2 checkbox , when checkbox item selected should added spinner. possible that? cant find on google, hoping can save me here :) spinner : public class checkbox extends appcompatactivity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_checkbox); spinner spinner; spinner = (spinner) findviewbyid(r.id.spinner2); arrayadapter adapter = arrayadapter.createfromresource(this, r.array.itinerary, android.r.layout.simple_spinner_item); spinner.setadapter(adapter); } the layout <checkbox android:id="@+id/cbsiargao" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="surigao" android:layout_alignparenttop="true" android:layout_alignparentleft="true" android:layout_alignparentstart="true" android:layout_margintop="104dp" />

google cloud platform - High memory consumption on idle Kubernetes cluster -

Image
i´ve created cluster on google cloud platform consisting of 3 g1-small instances , have not yet added pod / service / etc. still, when log on kubernetes ui, 3 instances show high memory consumption of ~ 1.3 gb. memory used for? or problem kubernetes ui? thanks, fabian kube-ui seems showing total memory usage, opposed memory working set. former includes inactive pages not in use, memory appear higher. see memory working set, can try reaching other monitoring services such monitoring-grafana (backed heapster) or reach cadvisor port on node. to reach cadvisor: run kubectl proxy , open http://localhost:8001/api/v1/proxy/nodes/nodename:4194/ alternatively, can deploy kubedash ui.

C# MVC AngularJS -

code: [responsetype(typeof(list<myclass>))] public async task<ihttpactionresult> get() { var userid = user.identity.name; var obj = await this.findallasync(userid); if (obj == null) { return this.notfound(); } return this.ok(obj); } it doesn't seem throw errors server side however, client side in angular controller 1 have ideas? i had code as: responsetype(typeof(bool)] , since changing not work, returning list object not allowed or need in either angular js file or c# controller class work, e.g. json-fy it?!?! refer http://www.asp.net/web-api/overview/getting-started-with-aspnet-web-api/build-a-single-page-application-(spa)-with-aspnet-web-api-and-angularjs code base. have done change 1 of calls return list cannot see why different. have not modified client side controller class significance other upgrade code new syntax. $http.get("/api/crosswordhelper").then( function (response) { //$sco

php - MySQL Fulltext search results in html content -

i have database oages of content. content in html format. want make content searchable figured fulltext search best. have query setup below: select * pages match(content) against ('search'); that gives me list of pages, however, there multiple matches on pages. want pull out matches of content surrounding show little snippets of results on search results page. i using php running query. you use clause simple string matching, along lines of: select content pages content '%keyword%';

How to debug "expected android.widget.TextView but found java.lang.string" in Android? -

can please take @ code? trying build app personal school project. new android studio. have put simple app display spaces available in parking lot. but trying open second activity screen when click on 1 of lots in listview screen. got error , have no way of solving it. **mainactivity.java** <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:tools="http://schemas.android.com/tools" android:layout_width="fill_parent" android:layout_height="fill_parent" > <textview android:id="@+id/lotname" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <textview android:id="@+id/lotspaces" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/lotname"/> </relativelayout> **singlelotview.java** package com.example.sahan.smart

r - how do you merge two data frames the best way? -

i need merge data.frame s: dput(data) structure(list(hostname = structure(c(8l, 8l, 9l, 5l, 6l, 7l, 1l, 2l, 3l, 4l), .label = c("db01", "db02", "farm01", "farm02", "tom01", "tom02", "tom03", "web01", "web03"), class = "factor"), date = structure(c(6l, 10l, 5l, 3l, 2l, 1l, 8l, 9l, 7l, 4l ), .label = c("10/5/2015 1:15", "10/5/2015 1:30", "10/5/2015 2:15", "10/5/2015 4:30", "10/5/2015 8:30", "10/5/2015 8:45", "10/6/2015 8:15", "10/6/2015 8:30", "9/11/2015 5:00", "9/11/2015 6:00"), class = "factor"), cpubusy = c(31l, 20l, 30l, 20l, 18l, 20l, 41l, 21l, 29l, 24l), usedpercentmemory = c(99l, 98l, 95l, 99l, 99l, 99l, 99l, 98l, 63l, 99l)), .names = c("hostname", "date", "cpubusy", "usedpercentmemory"),

java - RoboVM building error. Double checked everything -

Image
i spent 2 days trying figure problem out, , can't, i'm looking thoughts fixing this. so, trying launch ioslauncher robovm tool. did what's necessary ios configurations. double check everything. simplier understanding i'm adding photos. here problems : firstly had consider mounting disk. did it. and after unknown error appears update running stacktrace update 2 --info with --debug update 3 running --stacktrace, check causing problem. enter image description here update 4 (i'm willing last one) enter image description here caused by:

objective c - Bridging Header Deleted in Parse Project -

Image
i accidentally deleted bridging header file parse project in swift. , wasn't reference removal. since created new bridging header when go run application, error message says "bridging header @ < insert location here> doesn't exist". clear list , later drag , drop new bridging-header file here

css - How to prevent <input> from stretching table cell? -

<table border=1> <tr> <th>one</th> </tr> <tr> <td>1</td> </tr> </table> draws table bit wider word "one", , it's ok. <table border=1> <tr> <th>one</th> </tr> <tr> <td style='padding:0 0 0 0'> <input style='width:100%' value='1'> </td> </tr> </table> draws table 4 times wider needed. please advise how make width of input equal 100% of non-stretched td without assigning width of td itself? you can add size attribute input. example: <table border=1> <tr> <th>one</th> </tr> <tr> <td style='padding:0 0 0 0'> <input size='1' value='1'> </td> </tr> </table>

r - Keep Dates when aggregating xts object -

i have xts object want aggregate data--while keeping dates. wln = apply(dln, 2, to.weekly) > head(wln) aapl gspc vix [1,] -0.05602066 -0.0252409007 0.01903172 [2,] -0.03609222 -0.0111470571 0.13182832 i tried using index convert dates, no avail. as pascal commented , can use apply.weekly aggregate returns (i use period.apply below, since general solution). aggregation function use depend on how returns calculated. require(xts) set.seed(21) x <- xts(matrix(rnorm(60, 0, 0.01), ncol=2), sys.date()-30:1) # weekly endpoints wep <- endpoints(x, "weeks") # log returns period.apply(x, wep, colsums) # arithmetic returns period.apply(x, wep, function(x) apply(1+x,2,prod)-1)

c++ - Nonfree module is missing in OpenCV 3.0 -

i have built opencv 3.0 alpha version source support cuda , tbb. now, want feature detection , feature matching using surf algorithm. surffeaturedetector present in include file opencv2/nonfree/features2d.hpp & opencv2/nonfree/features2d.hpp but module nonfree missing in version of opencv. tried checking opencv forums @ answers.opencv.org site under construction. how use non free modules? with opencv3.0, surf/sift , other things have been moved seperate opencv_contrib repo . you have download that, add main opencv cmake settings (please @ readme there), , rerun cmake/make. then: #include "opencv2/xfeatures2d.hpp" ... ptr<sift> sift = cv::xfeatures2d::sift::create(...); sift->detect(...);

How to achieve a toggle button (more/less) using jquery html() method -

this current jquery code . changes button value less . not other way around. $("p").hide(); $(".btn").click(function() { $("p").toggle(); $(".btn").html("less"); $(".btn").html("more"); }); try code $("p").hide(); $(".btn").html("more"); $(".btn").click(function() { $("p").toggle(); if($('p').css('display') == 'none') { $(".btn").html("more"); } else { $(".btn").html("less"); } });

Why does opencv's recoverPose return a non origin position when identical point vectors are supplied? -

by accident tried estimating relative position of image (don't ask). expect result of 0 translation , 0 rotation. surprisingly, non-zero translation result. in fact rather significant result: .0825 -0.0825 . in essence code follows: cv::point2d pp(u0, v0); cv::mat r, t, mask; cv::mat e = cv::findessentialmat(points1, points2, focal, pp, cv::ransac, 0.999, 1.0, mask); cv::recoverpose(e, points1, points2, r, t); in above code, t != 0. question is: non-zero result recoverpose valid when points1 , points2 identical? if so, why? from decomposeessentialmat documentation: "by decomposing e, can direction of translation" and translation vector constructed in such way norm of translation equal 1.

gorm - Grails domain Named query for a list of string -

i have simple grails application. have domains below class author implements serializable { .... static hasmany = [ book : book ] } class book implements serializable{ author author genres genres static belongsto = [author: author , genre: genres ] static mapping = { ..... author lazy: false } } class genres implements serializable{ string title } now have requirement have list of genres title, need retrieve authors has atleast 1 book in 1 of genres. need write named query in author class. tried following query hasgenre {cl -> 'book.genre.title' in cl } and pass list of string follows author.hasgenre(generetitlestringarray) but not seems working. have other straightforward named-queries works fine. when retrieve including "hasgenere" not seem affect retrieval. doing wrong? i'm quite new area thanks in advance have been using list() method? if no, must use entity namedquery, be

design - Can I Transform Illustrator File to HTML? -

i know may sound dumb question, have complex design page need write in html. can design in adobe illustrator, , transform html file later? (so takes exact design) ? there way that? if answer no, there way make writing complex in html easier? well possible long illustrator file contains paths , no images. have save file svg. open svg text editor , copy code html file. work. svg compatible every browser. http://caniuse.com/#feat=svg note method not give working buttons or things. can add classes , ids svg elements after , make work. not way in eyes, that's how ai file html. suggest write in html , maybe use code snippets svg.

python - Why is my list index out of range? -

def main(): print("you haved activated weather pro 3.0") rain_inputs() rain_calc() def rain_inputs(): global rain rain = [] x in range(1, 13): try: rain_meter = float(input("what rainfall? ")) rain.append(rain_meter) if x == 4: print("8 more months go!") elif x == 7: print("5 more months go!") elif x == 9: print("2 more go! smash keys!") elif x == 13: return except exception err: err = ("you should putting in numbers!") print(err) rain_calc supposed calculate total of listed inputs. def rain_calc(): rain_math =(rain[0] + rain[1] + rain[2] + rain[3]) rain_math2 =(rain[5] + rain[6] + rain[7] + rain[8]) rain_math3 =(rain[9] + rain[10] + rain[11] + rain[12]) rain_total =(rain_math + rain_math2 + rain_math3)

php - What is a good strategy for getting the title of a page? -

... server side , using php. i read so article on when use regexes , states can use regexes parse html in cases. <title></title> should easy match. i see no problem this. think popular answer voted not b.c. of correctness b.c. of entrainment value. is o.k? yes, is /<title[^>]*>(.*?)<\/title>/is different people have different opinions, though. , should use regex if know you're doing. this might me interesting read: when should not use regular expressions?

cart - Custom basket icon with count for android application -

Image
i developing sample ordering application. want show basket icon added item count. whenever user add item cart, count in basket icon should increment. i want show image in bottom of application screen. use framelayout <framelayout android:layout_width="wrap_content" android:layout_height="wrap_content"> <imageview android:id="@+id/counter" android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center" android:src="@drawable/basket" android:drawablepadding="@dimen/spacing_small" /> <textview android:id="@+id/counter_value" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="1" android:gravity="center" /> </framelayout> text colour of textview should match background. use java(activity) increment count

php - Laravel 5.1 Unknown database type enum requested -

while running php artisan migrate , got following error [doctrine\dbal\dbalexception] unknown database type enum requested, doctrine\dbal\platforms\mysqlplatform may not support it. how resolve issue. code: public function up() { schema::table('blogs', function (blueprint $table) { $table->string('wordpress_id')->nullable(); $table->string('google_blog_id')->nullable()->change(); }); } the official laravel 5.1 documentation states: note: renaming columns in table enum column not supported. it doesn't matter if you're trying change column, if table contains enum anywhere won't work. it's doctrine dbal issue. as workaround either drop column , add new 1 ( column data lost ): public function up() { schema::table('users', function(blueprint $table) { $table->dropcolumn('name'); }); schema::table('users', function(blu

ios - UITableView has extra space on top during "pull down to refresh" -

Image
i have problem tableview. has space on top this: when open taskstableviewcontroller, problem doesn't show. when open viewcontroller tasktablevc this: filtertaskstableviewcontroller * fttvc = [self.storyboard instantiateviewcontrollerwithidentifier:@"filtertaskstableviewcontroller"]; fttvc.delegate = self; uinavigationcontroller * navvc = [self.storyboard instantiateviewcontrollerwithidentifier:@"popovernavigationcontroller"]; [navvc setviewcontrollers:@[fttvc]]; [self presentviewcontroller:navvc animated:yes completion:nil]; and go tasktablevc, problem occurs. when "pull down refesh", goes normal. in code tasktablevc: - (void)viewwillappear:(bool)animated { //other code [self populate]; } - (void)viewdidload { dispatch_async(dispatch_get_main_queue(), ^{ self.refreshcontrol = [[uirefreshcontrol alloc] init]; self.refreshcontrol.attributedtitle = [[nsattributedstring alloc] initwithstring:@" "]; [self.refreshcon

javascript - videojs fallback to download link -

along flash fallback want should have download link fallback. think can achieved video tag . want achieve using javascript code below . please !! var videlem = document.createelement("video"); videlem.id="id"; videlem.setattribute('class',"video-js vjs-default-skin"); videlem.setattribute('preload', "auto"); var sourcemp4 = document.createelement("source"); sourcemp4.setattribute('src', url); videlem.appendchild(sourcemp4); var div = document.getelementbyid(div1); div.appendchild(videlem); player=videojs({"controls": true , "techorder": ["html5", "flash"]}, function(){ this.on("ended", function(){ console.log("videoended") ; }); }); i want should have fallback download link . please suggest me should put code . thanks in advace . similarly how you're listening ended event can listen error event. error code of 4 means no

active directory - How to retrieve All attributes of given user from given group in ActiveDirectory using VBScript? -

can me attributes of given user in given group active-directory using vb script . on error resume next set objgroup = getobject _ ("ldap://cn=domain admins,cn=users,dc=imts,dc=test") objgroup.getinfo arrmemberof = objgroup.getex("member") wscript.echo "members:" each strmember in arrmemberof wscript.echo strmember.distinguishedname next this giving me users in group want attributes on given user eg: account_expires: account_name_history: cs_policyname: admin_count: admin_description: admin_displayname: allowedattributes: allowedattributeseffective: allowed_child_classes: allowedchildclasseseffective: altsecurityidentities: attributecertificateattribute: audio: bad_password_time: bad_pwd_count: bridge_head_serverlistbl: businesscategory: c: canonicalname: carlicense: co: so on note : sorry, i'm not in environment test , answer memory exercise. hope can help you try query ldap schema user class

sql server - SQL Select string not immediately preceded nor succeeded by other letters -

imagine following data: peter santos (sa) john doe - sa maria santos i match strings containing letters sa, not if they're inside word. in other words, when evaluating "peter sa ntos ( sa )", should fail on " sa ntos" since it's succeeded other letters, succeed on ( sa ) since there no letters preceding or succeeding it. "john doe - sa " should match sa entry there... "maria sa ntos" should not return since it's succeeded other characters. how achievable using ms sql without using regex? i believe query logic gives need without using regex: select string_to_search<br/> ...<br/> <br/> string_to_search 'sa[^a-za-z]%'<br/> or string_to_search '%[^a-za-z]sa'<br/> or string_to_search '%[^a-za-z]sa[^a-za-z]%'<br/> the 3 predicates in clause allow 'sa' appear @ beginning, middle, or end of string, neither preceded or followed letters.

java - Is it possible to imitate keyboard behaviour with selenium? -

this question has answer here: typing enter/return key in selenium 25 answers im automating , 1 thing have issue auto-complete dropdown im sending string key to, need choose drop down value select it, , have click on it. so wanted know if possible after im sending key to: go down 1 time (with "down" arrow in keyboard) then click enter is possible? i can use java or scala thanks yes can following code : webelement element = driver.findelement(by.id(""); //here give id of element & can sendkeys if require element.sendkeys(keys.down); // press down key element.sendkeys(keys.enter); // press enter key

math - How to join the same matrix several times to make a big matrix in Matlab? -

i have 4x1 matrix, a= [1;2;3;4] i want make b such size 4x50. elements in columns must contain same elements of a. example, b= [1 1 1 1.... 1 1; 2 2 2 2.... 2 2; 3 3 3 3.... 3 3; 4 4 4 4.... 4 4] in case elements of column 1 present in same way in first column of b, same second column on b, , on is there way form b a? trying concatenating below: b= horzcat(a,a,...); but in case, have write a , 50 times. there other way same result? have tried using repmat ? b = repmat(a, 1, 50); repmat (which nicely stands rep eat mat rix) takes matrix , repeats many times horizontally , vertically want. technically speaking, can choose how many times want repeat many dimensions possible there in matrix. however, our purposes here, matrix has 2 degrees of freedom / dimensions, we're considering horizontal , vertical here. in specific case, want repeat column vector 50 times horizontally, hence third parameter being set 50, while want 1 copy vertically, hence

javascript - close window after download file generates -

i have javascript code generate pdf file. have url generates pdf file. dont want user see url thats why using iframe in hidden load url , generate download popup. working me, want open iframe content in new tab, wait till download popup generate , close window. see javascript, var iframe; var url="test.com?file=download"; iframe="<iframe src='"+url+"' style='visibility:hidden' >"; var html="<html>"; html+="<head>"; html+="</head>"; html+="<body>"; html+= iframe; html+="</body>"; html+="</html>"; var printwin = window.open('','_blank','left=0,top=0,fullscreen,toolbar=0,scrollbars=1,status=0'); printwin.document.write(html); printwin.document.close(); printwin.focus(); if using printwin.close(); sudden close window without dow

How to only allows IP within given range in asterisk? -

in asterisk how can allows ip in given range.in dialpan define global variable ip=192.168.50.0/30.how can allow ips in given range do deny=0.0.0.0/0.0.0.0 permit=192.168.50.0/255.255.255.0

image - AlamofireImage GrayImageEffect -

i make request image view url whit alamofireimage. revice image want convert image in grayscale. write simple class transform image in gray scale how transform image form alamofire gray scale. try method don´t work cell.imagem.af_setimagewithurlrequest(self.imagerequest(artwork.thumbnail), placeholderimage: nil, filter: nil, imagetransition: uiimageview.imagetransition.none, completion: { (_, _, imageresult) -> void in if imageresult.issuccess { cell.imagem.image = nil cell.imagem.image = imageresult.value?.grayscaleimage() } }) and class transform image gray scale is: func grayscaleimage() -> uiimage { let imagerect = cgrectmake(0, 0, self.size.width, self.size.height); let colorspace = cgcolorspacecreatedevicegray(); let width = int(self.size.width) let height = int(self.size.height) let context = cgbitmapcontextcreate(nil, width, height, 8, 0, colorspace, .allzeros);

c++ - After forking bash with forkpty and execvp, bash does not respond to SIGINT -

background i'm writing terminal emulator text editor written in node.js (javascript). application uses c++ fork shell , communicate in backend. code forks shell written developer not seem maintaining project anymore. left me no other choice try , fix problem myself. i've gone through code line line point understand of doing. problem i can't figure out why bash won't send sigint signal it's sub processes. else works perfectly. can communicate shell instance in node.js , run commands. if write signal interrupt escape code ('\x03') fd of pty, sigint signal isn't sent. see ^c in terminal display. commands ping interpret , stop. commands cat , python , or java not stop , show ^c . example: user:example user$ cat ^c^c^c^c^c^c^c^c code first forkpty used pty instance. then, pty instance calls execvp replace process shell process. in instance, execvp launches execvp('/bin/bash', {'/bin/bash', '--login'}) . nan_metho

javascript - Script disables some components on my table -

Image
this how webpage looks like: as can seen in picture have have search on top right, in bottom right have amount of pages etc.. but add project here clicking "lägg till ny" , add project reason page end this: http://puu.sh/kkszz/387c71f487.png as can seen table "breaks" search field gets removed , pages. same things happens when chose edit or delete project i've added. this view: <div id="tabs-current"> <div id="consultanttimes"> @{ html.renderaction("consulanttimes"); } </div> <a href="javascript:opendialog()" class="btn btn-primary"> lägg till ny </a> </div> as can seen table partial view , here is: <table class="table table-striped table-bordered table-hover" id="sample_1"> <thead> <tr> <th>projekt</th> <th>mitt datum</th> <th>%<

Weblogic 12.1.3 CDI Transactional -

is there additional configuration needs done in order enable cdi jta transactions using @transactional annotation under cdi beans weblogic 12.1.3 server? i have tried add annotation service method, entitymanager didn't recognize running under transaction. is there interceptor or else needs registered? @joshament right. weblogic 12.1.3 partially supports java ee 7 (it supports 4 pieces: jpa 2.1 , jax-rs 2.0 , json-p 1.0 , websockets 1.0 ). @transactional part of jta 1.2 . right liberty profile certified against java ee 7. planned year-end weblogic 12.1.4 going support also. anyway, answering question: configured persistence.xml should enough use @javax.transaction.transactional annotation in code. // may consider move away java ee 7 ;) able freely choose whatever lib want. believe server should not provide except servlets.

Cloning private git repo in the docker container -

i have project (written in ruby) want run in docker image. project source code stored in private git repo, image created usual dockerfile. project huge , git clone takes relatively long. the problem that, i'm not sure how (when/where) clone git repo docker image properly. can clone git repository temp directory , copy source code copy command in dockerfile. don't since have maintain second clone in temp dir. or, can clone repo within docker image. problem ssh-key can't reasonably keep in image. can add "my own" keys git server allow access everything. so, created script this: uuid=`uuid` docker run \ -v $home/.ssh:/home/user/.ssh:ro\ --name=$uuid \ -it $1 /scripts/git-clone-update.sh docker commit $uuid $1 docker rm $uui git-clone-update.sh clones project if doesn't exist or updates if does. keys mounted .ssh that. works great. can update code in image calling script passing image name argument. problem config.cmd changes /scripts

html - Vertical align text within a responsive box doesn't work -

how vertical align text within responsive box? did image doesn't work span, not sure why. below half way done demo : img{ width:20px; } div{ width:100px; height:100px; background:#ddd; padding:10px; } img{ position: relative; top: 50%; transform: translatey(-50%); -ms-transform: translatey(-50%); transform: translatey(-50%); } <div> <img src="https://cdn2.iconfinder.com/data/icons/windows-8-metro-style/256/football.png"/> <span>football</span> </div> try img{ width:20px; padding:2px; } div{ width:100px; height:100px; background:#ddd; padding:10px; } img,span{ position: relative; top: 50%; transform: translatey(-50%); -ms-transform: translatey(-50%); transform: translatey(-50%); float: left; } demo here

sql server - SSRS reports cannot be opened after deleting encryption key -

recently have migrated ssrs sql server 2005 2012 running on windows 8. deleted encryption key after observing reporting server inaccessible. able access reporting server internet explorer on same machine, , able list existing reports in browser. when try open report, login name , password required before viewing report. expected behavior reports should opened without necessity provide login/password. question: caused deletion of encryption key? how solve it? go datasources reports , check credentials stored against them. may need resave these credentials create new encryption key. click 'test connection' see if successful. your reports should work fine once have re-established safe connection between report , server.

visual studio - Is there any way to make ReSharper folder's "Namespace Provider" property to false by default? -

by default resharper folder's "namespace provider" property defaults true. want property false. means, every zillon times create new folder in projects have set manually false. is there way make resharper folder's "namespace provider" property false default? my answer not default value. it's workaround. these settings stored in yourproject.csproj.dotsettings file each folder in project. if "namespace provider" set false yourfolder , following record added file: <s:boolean x:key="/default/codeinspection/namespaceprovider/namespacefolderstoskip/=yourfolder/@entryindexedvalue">true</s:boolean> so may make list of of folders using total commander or similar tool , add file, or automatically. hope helps!

Please clear this confusion regarding relational algebra/tuple relational calculus -

Image
1: explanation given query "the set of tuples t such there exists tuple s in relation borrow values of t , s cname attribute equal, , value of s amount attribute greater 1200". never mentioned relation t belongs. relation it, , why? 2: in underlying image, "and"ing 2 projections (containing attribute "customerid" "customer" relation & attribute "orderid" "order" relation) give cartesian product of these 2 one-column relations? 1: tuple t , appearing on left hand side, tuple of the answer . { t | ... t ... } means "the set of every value, t say, such ... t ... true". each tuple value refer t , if satisfies condition goes in answer. 2: in part 1 "∧" used connective , in predicate logic expression in relational tuple calculus query. here in 2 using between 2 relation expressions relational algebra operator. "⋈" used natural join , "⨯" used cartesian

R not using entire RAM Available -

this question has answer here: increasing (or decreasing) memory available r processes 4 answers i have 16gb ram machine windows 64 bit.if run model in r uses 2gb , remaining memory free. have run same model in 4gb machine takes 4 hours give result,so upgraded 16gb ram ,but still r takes same 4 hours run same model in 16gb machine also.r not using more 2gb of ram. any idea why r not using entire ram avaiable. on 64-bit os, handling 16 gb of ram should no problem r. configuration-issue prevents r doing so. you can check current memory-limit calling memory.limit() (see http://www.inside-r.org/r-doc/utils/memory.size ). can use memory.limit(12000) set new limit. but should check whether ram limiting factor. if doing number-crunching, increasing ram not speed calculation of result.

database - How to extract out all multiple ID's of the same person in MYSQL -

say given data-model different entities connected each other one-many or many-one relationships. suppose find songs done artist akon. how can use sequel query find that. has multiple id's in the entity used find song did. how can use sql find out. say given id's (1,10002,2908) not know those, know name 'akon' helps find different id's , songs connected id's hm sounds simple join query. select a.songid db.songs inner join db.artists b on b.artistid=a.artistid b.artistname='akon' is you´re looking for?

javascript - AngularJS not rendering in Chrome extension -

i been trying angularjs working in chrome extension, , i'm using ng-repeat function create wordlist. here's html of chrome extension: <!doctype html> <body> <script src="../firebase.js" ></script> <script src="../action.js" ></script> <script src="../angular.min.js"></script> <script src="browser_action.js" ></script> <style type="text/css"> #mainpopup { padding: 10px; height: 200px; width: 400px; font-family: helvetica, ubuntu, arial, sans-serif; } h1 { font-size: 2em; } </style> <div ng-app='myapp'> <div ng-controller="appcontroller"> <div ng-repeat="(f1, f2) in steps"> <p> {{f1}} : {{f2}} </p> </div> </div> </b

Use unicode as predicate in xpath with lxml and python 2.7 -

i've been facing problem have xml file unicode strings , need evaluate xpath on it, through lxml in python-2.7. # -*- coding: utf-8 -*- lxml import etree ... class language: description = none def __init__(self, description): xpath = "//language[./description = '{}']//description/text()".format(description) self.description= lang_xml.xpath(xpath) ... lang = language(u"norwegian bokmål") gives error: unicodeencodeerror: 'ascii' codec can't encode character u'\xe5' in position 14: ordinal not in range(128) stop mixing them. xpath = u"//language[./description = '{}']//description/text()".format(description)

java - Javadoc @param with - -

i'm making javadoc: /** * make * * @param value - blabla( i´m using @param value - blabla, instead @param * value blabla) * @return */ public string makesomething(string value) { return ""; } should use @param value - or @param value ? most doclets introduce hypen between @param tag , parameter's name. adding hypen cause ugly, double hypen rendered.

ffmpeg - ffprobe reports different format depending on file extension -

i using ffprobe on windows identify files. command/parameters use are: ffprobe -show_entries format=format_name -v quiet filename i noticed image files ffprobe reports different format if file name has (or not have) , extension. example, bmp image file named xxx ffprobe -show_entries format=format_name -v quiet xxx reports [format] format_name=mp3 [/format] but, if rename file xxx.bmp , rerun command ffprobe -show_entries format=format_name -v quiet xxx.bmp reports [format] format_name=image2 [/format] is behavior expected? has else encountered issue? using recent version of ffmpeg.

python - Efficiently Labeling Variable Values in Pandas -

i have dataframe variables coded integers, i'd replace actual value labels. for example, have following dataframe: >>> df=pd.dataframe([[1,3],[2,2],[3,2]], columns=['q1','q2']) >>> df q1 q2 0 1 3 1 2 2 2 3 2 if, numbers 1,2,3 represented same value in both columns, have dictionary looked this: labels={1:'yes',2:'no',3:'unsure'} and recode applymap: >>> df.applymap(labels.get) q1 q2 0 yes unsure 1 no no 2 unsure no however, integers code different label in each column. example, dictionary of value labels may this: labels2={'q1':{1:'yes',2:'no',3:'unsure'}, 'q2':{1:'very', 2:'a little', 3:'not @ all'}} what efficient way of recoding values in scenario? i using apply , loop (see below), pretty clunky. there better way? >>> import pandas pd >>> dfs=[] >&

java - Loading a static method using custom class loader -

i've custom class loader follows import java.lang.reflect.constructor; import java.lang.reflect.method; public class myclassloader extends classloader { public string invoke(final string classname, final string methodname, final string somestring) { try { final classloader classloader = getclass().getclassloader(); final class loadedclass = classloader.loadclass(classname); final constructor constructor = loadedclass.getconstructor(); final object myclassobject = constructor.newinstance(); final method method = loadedclass.getmethod(methodname, string.class); final object teststr = method.invoke(myclassobject, somestring); system.out.println(loadedclass.getclassloader()); return (string) teststr; } catch (final classnotfoundexception e) { e.printstacktrace(); } catch (final exception e) { e.printstacktrace();

Representing the ratio of two expressions in one chart in Qlikview -

i want represent ratio of 2 qlikview expressions i'm getting database , want displayed on 1 chart 2 different bars. there way that? thanks in advance.. it's unclear you're asking for, can create compound expression 2 prior ones pretty easily. if you've labeled them "expression 1" , "expression 2", reference labels calculate ratio: [expression 1] / [expression 2] for axis, you're describing sounds "split axis" property on chart's "axes" tab.

javascript - How to update session storage data without refreshing page? -

i creating spa web application , use sessionstorage store current user information in browser. use chrome test. in test progress found when user login sessionstorage updated in console when cannot access added value until refresh page. how can resolve problem? this angular service responsible storing , retrieving currentuser in sessionstorage : app.service("sessionstorageservice", ["$window","$q", function ($window, $q) { var deferred = $q.defer(); this.setcurrentuser = function (user) { $window.sessionstorage["currentuser"] = json.stringify(user); }, this.getcurrentuser = function () { if ($window.sessionstorage["currentuser"]) { console.log("bega") ; deferred.resolve(json.parse($window.sessionstorage["currentuser"])); return deferred.promise; } else { console.log("bega1") ; deferred.reject("no login user&q

python - Issues with regular_expression -

i wrote script open multiple text files if line match specific pattern. after compare line country pattern(which contain country names) , (for now) print country. (later try create method move each text file folder based on it's country) basically each of text file contains line : 25/02/2015|11:06:21|mys|mys14_frc6-7_my1_aa1_wp|mms1|wxp2632|ashraf|true|120|0|false| as can see example contains country name "mys" import os import string import re import sys import glob import fileinput country_pattern = 'mys','idn','zaf', 'tha','twn','sgp', 'nwz', 'aus','alb','aut','bel', 'bgr', 'bih', 'che','cze', 'deu', 'dnk', 'esp','est','srb','mdk','mne','bih', 'bih','mne','fin', 'fra', 'gbr','grc', 'hrv', 'hun', 'irl',

g++ - What package do I need for Cygwin's UBsan? -

i have test script grinds through various configurations. script tests availability of undefined behavior sanitizer (ubsan) , , performs build if available. here's test: $cxx -x c++ -dm -e -fsanitize=undefined -std=c++11 - < /dev/null > /dev/null 2>&1 if [ "$?" -eq "0" ]; have_ubsan=1 else have_ubsan=0 fi the test above sets have_ubsan=1 on cygwin, means gcc's cygwin claims support ubsan (otherwise, have produced error). however, i'm catching link error under both cygwin i686 , x86_64: ... g++ -ddebug -g2 -o2 -wall -std=c++03 -fsanitize=undefined -march=native -pipe -c fipsalgt.cpp g++ -ddebug -g2 -o2 -wall -std=c++03 -fsanitize=undefined -march=native -pipe -c dlltest.cpp g++ -o cryptest.exe -ddebug -g2 -o2 -wall -std=c++03 -fsanitize=undefined -march=native test.o validat1.o validat2.o validat3.o ... ./libcryptopp.a /usr/lib/gcc/i686-pc-cygwin/4.9.3/../../../../i686-pc-cygwin/bin/ld: cannot find -lubsan collect2: error:

f# - Right clicking inside an .fs file in VS2015 opens FSI -

since upgraded vs2015 right clicking inside f# .fs file no longer brings context menu instead opens fsi. happens on both desktop , laptop, not seem specific machine. i have looked through various menu , key binding options in vs2015 cannot see bound open fsi. (under view > other windows > f# interactive there no shortcut listed). does know why right clicking opening fsi , how change opening context menu? kevin's suggestion of resetting keyboard bindings got me thinking , started disabling extensions see if of responsible. with f# powertools , f# outlining disabled got standard context menu back. thought might mean problem f# outlining, after re-enabling both extensions proper context menu when right clicking. disabling , re-enabling f# related extensions seems way fix this.

html - Setting a maximum value less than a number on a decimal based input field -

Image
i'm making input field accepts number of decimals. want validate input number 5 or higher , less 100. using min , max attributes able create following html snippet. appears function correctly in every browser looks horrible. <input type="number" step="any" min="5" max="99.9999999999999999" required> is there decent way (without rounding shenanigans)? i know can solved using javascript i'm wondering if there's decent way html. i'm trying validate input of users have html5 form validation not javascript. checking input server-side forces user load page again, i'm trying avoid. maybe want include css styles in <head> google makes input fields better standart input fields browser: <link rel="stylesheet" href="https://ssl.gstatic.com/docs/script/css/add-ons1.css">

spring - read data from MultipartFile which has csv uploaded from browser -

may doing worng using multipartfile upload feature. i have read data csv file chosen client through browser. used multipartfile upload file. file coming controller unable read csv data it. please guide best way or me read csv data multipartfile. jsp has <form method="post" action="uploadfile" enctype="multipart/form-data"> file upload: <input type="file" name="file"> <input type="submit" value="upload"> press here upload file! </form> the controller has @requestmapping(value = "/uploadfile", method = requestmethod.post) public string uploadfilehandler(@requestparam("file") multipartfile file) { thanks. i figured out workaround. converted file bytes , converted bytes string. string applied string.split() wanted out of file. @requestmapping(value = "/uploadfile", method = requestmethod.

css3 - Weird box-shadow bug in Chrome on Android -

Image
i'm having weird bug box-shadow , text-shadow android chrome. chrome on desktop works fine, on android, shows weird shadow effect. take @ screenshot better understand what's going on: as can see, chrome on android rendering both text-shadow , box-shadow in different way. here's example of code i'm using menu label , hamburger menu: #menu-toggle{ position: fixed; top: 17px; right: 13px; z-index: 120; padding: 0; color: #fff; font-family: 'katahdin round',arial,helvetica,sans-serif; border: none; background-color: transparent; outline: 0; text-shadow: 0 0 7px rgba(17,17,17,.3); } #menu-toggle .bottom, #menu-toggle .middle, #menu-toggle .top{ position: absolute; left: 0; width: 21px; height: 3px; background-color: #fff; -webkit-transition: .2s ease-in-out; transition: .2s ease-in-out; -webkit-box-shadow: 0 0 7px rgba(17,17,17,.3); box-shadow: 0 0 7px rgba(17,1

parsing - Microsoft Access: Complex string search to update field in another table -

i have table linked access return results of emails folder. of emails being returned answering same questions. need parse email body text table , update several fields of table data. problem linked table brings text in super messy. though have email being returned nicely formatted in table, comes access hot mess full of spacing. want open recordset based on linked table (linktable), , parse linktable.body field somehow can update table clean data. data coming linktable looks this: permit? (note: if yes, provide specific permit type in additional requirements section) no phytosanitary certificate? (note: if recommended, input no , complete additional requirements section) yes additional requirements: if not applicable, indicate na or leave blank (type of permit required, container labeling, other agency documents, other) double containment, labeling or declaration must provide following information: -the kind, variety, , origin of each lot of seed -the designation