Posts

Showing posts from January, 2012

scala - How to fix the Dropping Close since the SSL connection is already closing error in spray -

i’m making call api, of time keep getting error: “ dropping close since ssl connection closing ” , “ premature connection close (the server doesn't appear support request pipelining) ”. 90% of time error, meaning: in rare occasions query return data supposed to. to make sure wasn’t api’s server issue, replicate exact same query using node.js (express , request libs) , works every time. makes me sure spray bug . here's example of code : case class myclass(user: string, pass: string) class myactor extends actor { import spray.client.pipelining._ import spray.http.basichttpcredentials import spray.http.{httprequest,httpresponse} import scala.concurrent.future import context.dispatcher def receive = { case myclass: myclass => { val credentials: basichttpcredentials = basichttpcredentials(myclass.user, myclass.pass) val url: string = "https://myapi?params=values" val request: httprequest = get(url) ~> addcredentials(cred

Changing window properties in Visual C# from code-behind (WPF) -

i want background of wpf window change in specific situation (but other property). let's suppose name of window mywindow1 . if treat window other item (like in windows forms), mywindow1 doesn't seem have background property set; read-only properties shown in auto-complete. if try creating new object this: mywindow1 w1 = new mywindow1(); w1 seems have right properties available changing in autocomplete, including background, , ide shows no errors. when try starting program, hangs. what doing wrong, , best practice changing wpf windows properties code-behind in visual c# 2013? try xaml. < window x:class="wpf1.mainwindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" title="mainwindow" height="350" width="525" > <grid background="{dynamicresource {x:static systemcolors.inactivecaptiontextbrushkey}}"

updating data on first tab based on bundle info which is sent from the third tab by clicking on list item of third tab in android fragment -

current situation : have 3 tab, tab1, tab2, tab3 created using fragmentactivity. have 3 fragment class each of them, , each of them display listview item in content. when click on item tab3, want change data of tab1 based on inputs item clicked. have tried below code fragmentactivitydaily mydetailfragment = new fragmentactivitydaily(); bundle bundle = new bundle(); bundle.putstring("key_detail", "hi"); mydetailfragment.setarguments(bundle); fragmenttransaction fragmenttransaction = getfragmentmanager().begintransaction(); fragmenttransaction.add(r.id.pager, mydetailfragment); fragmenttransaction.addtobackstack(null); fragmenttransaction.commit(); with above code able change data , bundle info thorugh getarguement, not able view tab selected still tab3 viewpager.setcurrentitem(tab1); if use above line reloads fragment activty again overriding data have changed though above code. questio

android - Getting section headers to work with SuperSLiM and RecyclerView -

Image
currently i'm trying implement section headers in recyclergrid in android. came across superslim has functions need. now problem is, in opinion, it's badly documented how implement it's working. reading through given example, it's full of functions partly understand do. my own implementation of superslim worked far showing headers , custom views use items, crazily messed while scrolling. (items shown multiple times, headers went on items , forth) my simple question is, can provide me simple , understandable example on how implement superslim manager (as grid manager) recyclerview? if there better alternative appreciate help. if it's not clear on how layout should have example image below: important mention is, items not simple textviews comparable cardview. thanks lot in advance!

unicode - write() in python/spyder -- 'charmap' codec encoding character u'\u0142' --- UnicodeEncodeError -

i'm having little trouble program (python 2.7) , after checking other similar questions on website, still can't find solution. show attempted solutions/thoughts. i'm not sure if matters dataset i'm working yelp challenge dataset. don't plan on submitting work yelp challenge. first load json file pandas dataframe. following code in order take text (100k reviews), lowercase it, stem it, join stemmed text 1 line/observation, , write text file: reviews = df.text.tolist() reviews = [x.lower() x in reviews] revsub=reviews[0:100000] lrev = [[stem(word) word in re.compile("\w+",re.unicode).split(sentence)] sentence in revsub] testt = [" ".join(review) review in lrev] f2 = open("yelpreviewsparagragh.txt", "w") f2.write("\n".join(str(x) x in testt)) f2.close() which gives following error: f2 = open("yelpreviewsparagragh.txt", "w") f2.write("\n".join(str(x) x in testt)) f2.close() t

requirejs - UI that depends on slow loading javascript -

all of scripts page being concatenating / optimized (requirejs) single file. stands, script takes while load depending upon browser , network connection ~ 0.5 mb. on 1 of main landing pages users funneled to, have interaction (e.g. button, lets call "click me button") dependent upon script - event handlers etc. in other words, button nothing until script has been downloaded , loaded: e.g. empty href . currently, if testing on old browser or slow connection, user see or of dom including "click me button" before script has finished loading. result, there delay (sometimes few seconds) clicking on button nothing @ all. i wondering: is there perhaps way architect such can remove delay between time button shown when clickable (via js interaction). remember scripts page concatenated single file. can try , trim down size of file, still feels wrong because there theoretically possible lag. is there else in description stands out undesirded architecture. such p

ios - Different UINavigatonBar buttons/title for viewcontrollers inside UITabBarController -

Image
i'm working on application utilizes uitabbarcontroller embedded in uinavigationcontroller (w/ 3 children view controllers). i want each of these child vc's display different things on navigation bars (different titleviews, buttons, etc), yik yak's interface (those vc's in tab bar controller well): right now, navigation bar isn't functioning correctly between switching tabs, instead each time switch between tabs, presented view controllers nav bar settings override previous 1 (if hasn't been set yet). if has, displays current nav bar settings. abstractly, app structure this: uinavigationcontroller -> uitabbarcontroller -> uiviewcontroller #1 -> uiviewcontroller #2 -> uiviewcontroller #3 i setting each view controller's nav bar settings in viewdidload example: - (void)viewdidload { self.tabbarcontroller.navigationitem.titleview = _segme

ruby on rails - Bundler::GemNotFound: Could not find i18n-0.7.0 in any of the sources -

as title, couldn't open rails app. need couldn't solve through google. i'm using rails 4.2.1 , ruby 2.2.1 below error messages. ~/.rvm/gems/ruby-2.1.1-openssl@global/gems/bundler-1.8.5/lib/bundler/spec_set.rb:92:in `block in materialize' ~/.rvm/gems/ruby-2.1.1-openssl@global/gems/bundler-1.8.5/lib/bundler/spec_set.rb:85:in `map!' ~/.rvm/gems/ruby-2.1.1-openssl@global/gems/bundler-1.8.5/lib/bundler/spec_set.rb:85:in `materialize' ~/.rvm/gems/ruby-2.1.1-openssl@global/gems/bundler-1.8.5/lib/bundler/definition.rb:132:in `specs' ~/.rvm/gems/ruby-2.1.1-openssl@global/gems/bundler-1.8.5/lib/bundler/definition.rb:177:in `specs_for' ~/.rvm/gems/ruby-2.1.1-openssl@global/gems/bundler-1.8.5/lib/bundler/definition.rb:166:in `requested_specs' ~/.rvm/gems/ruby-2.1.1-openssl@global/gems/bundler-1.8.5/lib/bundler/environment.rb:18:in `requested_specs' ~/.rvm/gems/ruby-2.1.1-openssl@global/gems/bundler-1.8.5/lib/bundler/runtime.rb:13:in `setup' ~/.rv

delphi - how to locate a hyperlink field -

i have access 2010 table hyperlink field store e-mail adress of clients. before add new e-mail want check if e-mail address there. try use locate statement (delphi 2009; adoconnection, tadodataset): if table.locate('ml_link',newadress,[locaseinsensitive]) then this statement gives error message sequence not allowed. how can search hyperlink fields? i suspect @ character considered special character. suggest try splitting address 2 parts, email , domain example, search both fields as if table.locate('email;domain', vararrayof([newemail, newdomain]), [locaseinsensitive]); you may need add variants uses clause, depending on delphi version..

ios - UIView scale animation overshoots when changed -

Image
when animate change view's transform, reset change in animation before first animation finishes, everything's great (shown here rotation). animation smoothly switches new target: but when scale, animation overshoots magnificently: here's breaking code: uiview.animatewithduration(1) { self.someview.layer.transform = catransform3dmakescale(0.001, 0.001, 1) } uiview.animatewithduration(1, delay: 0.5, options: nil, animations: { self.someview.layer.transform = catransform3didentity }, completion: nil ) has else seen this? doing wrong? edit: , there workaround? edit 2: believe duplicate of this question , voting close. this blog post provides answer: in ios 8, uiview animations additive, , has unfortunate result scale animations. basically, second animation happens together with first animation. solution explicitly remove original animation before starting new one: view.layer.transform = view.layer.presentationlayer

python - Connection with boto to AWS hangs when running with crond -

i have basic python script uses boto query state of ec2 instances. when run console, works fine , i'm happy. problem when want add automation , run script via crond . notices script hangs , waits indefinitely connection. saw boto has problem , people suggested add timeout value boto config file. couldn't understand how , where, added manually /etc/boto.cfg file suggested timeout value (5) didn't help. strace can see configuration file never being accessed. suggestions how resolve issue? there chance cron environment not close enough interactive shell of login prompt. paths , things .boto or boto.cfg files not found or in same place in cron's environment. also, on systems (ubuntu) cron runs dash , not bash, things different. if croning script, try source /etc/boto.cfg file or set aws environment variables make sure it's using proper settings better yet - read them in python script making portable , not reliant on env. vars. from configpars

vba - Excel Bar Chart - Same Color and Legend Entry for Same Names -

Image
i chart states of machine on period of time. example may "running" 2 hours , "stopped" 1 hour, , there may several times each state occurs. using stacked bar chart i'd display state , amount of time stays in state. i'm finding excel assigning new color , legend entry each new state instance if state has occurred. how can make same-named states within chart have same color (e.g. every time "running" displayed has same color , single legend entry)? thanks the state name stored series name. there series each stack in chart. possible iterate through series , style them based on series name. possible remove entries legend using legendentries object. combining these loop, can update series color if matches title , remove item legend if not 1 of first 2 series. assumes "running" , "stopped" alternate @ start , entries keep in legend. if not case, more logic spot entries keep. sub style_chart() dim cht chart

javascript - Event binding on dynamically created elements? -

i have bit of code looping through select boxes on page , binding .hover event them bit of twiddling width on mouse on/off . this happens on page ready , works fine. the problem have select boxes add via ajax or dom after initial loop won't have event bound. i have found plugin ( jquery live query plugin ), before add 5k pages plugin, want see if knows way this, either jquery directly or option. as of jquery 1.7 should use jquery.fn.on : $(staticancestors).on(eventname, dynamicchild, function() {}); prior this , recommended approach use live() : $(selector).live( eventname, function(){} ); however, live() deprecated in 1.7 in favour of on() , , removed in 1.9. live() signature: $(selector).live( eventname, function(){} ); ... can replaced following on() signature: $(document).on( eventname, selector, function(){} ); for example, if page dynamically creating elements class name dosomething bind event parent exists, document . $(document

wordpress - Display related post based on tag -

i'm working on music site uses lot of tags , categories per post. example, on artist's page related posts display artist's releases based on tags. have tried adding tag using wordpress' post_type $args = array( - 'post_type' => 'releases' but hasn't worked. for example, here complete code - <div class="relatedposts"> <h3>releases artist</h3> <?php $orig_post = $post; global $post; $tags = wp_get_post_tags($post->id); if ($tags) { $tag_ids = array(); foreach($tags $individual_tag) $tag_ids[] = $individual_tag->term_id; $args=array( 'post_type' => 'releases', 'tag__in' => $tag_ids, 'post__not_in' => array($post->id), 'posts_per_page'=>4, // number

security - The stack is executable, but should not? -

my issue simple explain ! a vulnerable program able execute shellcode in stack : (with gdb) 0xbffff6f3: push ... => 0xbffff6f8: jns ... but, stack marked not executable : (vmmap) ... b7fff000-b8000000 rw-p 0001c000 08:01 525141 /lib/i386-linux-gnu/ld-2.13.so bffdf000-c0000000 rw-p 00000000 00:00 0 [stack] how can possible ? don't know look. have idea ? thank you. jc ! may can useful : jc@kali:~/init$ uname -a linux kali 3.18.0-kali1-586 #1 debian 3.18.3-1~kali4 (2015-01-22) i686 gnu/linux jc@kali:~/init$ gcc -v using built-in specs. collect_gcc=gcc collect_lto_wrapper=/usr/lib/gcc/i486-linux-gnu/4.7/lto-wrapper target: i486-linux-gnu configured with: ../src/configure -v --with-pkgversion='debian 4.7.2-5' --with-bugurl=file:///usr/share/doc/gcc-4.7/readme.bugs --enable-languages=c,c++,go,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.7 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --w

c# - null issue during usage of count and sum LINQ -

i have 3 tables , linked grandparent -> parent -> child categorytype - > categories - > menus when try run following return categorytypes.select(x => new categorytypeindexmodel { id = x.id, name = x.name, categories = x.categories.count, items = x.categories.sum(m => m.menus.count()) }); i the cast value type 'system.int32' failed because materialized value null. either result type's generic parameter or query must use nullable type. you trying count isn't there when categories null. believe habib recommend technically work still have account null value after fact. think better solution account in linq directly looking null , providing default return categorytypes.select(x => new categorytypeindexmodel { id = x.id, name = x.name,

ios - Save objects with many redundant information (with core data) -

i designing app in objective-c uses core data structure. i have following structure : @interface classa : nsmanagedobject @property(nonatomic, strong) sometype1 * property1; .. @property(nonatomic, strong) sometypen * propertyn; @property(nonatomic, strong) nsset * children; @end and @interface classb : classa @property (nonatomic, strong) classa * parent; @end i have following features : 1) each object of classa have many children in classb. (objects in classb don't have children themselves). 2) moreover, objects of classb share many properties in common parent (for instance, can think in cases, property1 differ between object of classb , same property in parent in classa, x in classb x.property2 = x.parent.property2 , on). 3) query database through requests on object of type classa. i looking way reduce disk memory usage of app storing necessary properties of objects of type classb. instance, keep properties of object of classb set nil unless differs 1 of pa

renaming files in windows...perhaps dos command prompt (For) -

this kind of question has been asked few times before on here , have tried use answers in previous posts problem i'm still struggling. i have in directory 100's of files along lines of ab00123456.stp ab00123457.stp ab00123458.stp ...and on i rename these adding pre , post text file name. so end result be... cde_ab00123456_a.stp cde_ab00123457_a.stp cde_ab00123458_a.stp ...and on (note upper , lowercase text change also......as if wasn't difficult enough already!) any clues appreciated.....along lines of dos command perhaps.... andy for /? extremely helpful. in particular, contains following substitutions: %~ni - expands %i file name only %~xi - expands %i file extension only thus, create for loop iterates through files iteration variable %i , renames %i cde_%~ni_a%~xi . ready-to-use example: for %i in (*) echo rename %i cde_%~ni_a%~xi try in directory of choice, fine-tune , remove echo once sati

sql server - Procedure or function 'sp_InsertImages' expects parameter '@Img_path', which was not supplied -

Image
i have passed img_path in code nd procedure show me error please me. procedure : create proc sp_insertimages ( @img_path nvarchar(max), @product_id numeric(18,0), @iscover_img bit ) begin if(select count(*) tbl_productimg product_id=@product_id)<5 begin insert tbl_productimg(img_path,product_id,iscover_img)values(@img_path,@product_id,@iscover_img) select @@identity end else begin select -1 end end your command type must set storedprocedure this cmd.commandtype = commandtype.storedprocedure; to product id procedure, call executescalar() instead of executenonquery() below product_id = convert.todouble(sql.executescalar());

python - Identify and extract number from text files -

i trying extract data text file. data in file random , has numbers followed code. (example 1.25crow, 4.25crd, 10.25cr) want extract number associated #.##cr index. if find 4.25cr need parse 4.25 , add totals of these numbers. have been able identify lines contain ###.##cr shown below. trying parse number associated cr , put each occurrence in list add together, identify, etc. have looked string.operands , re.match can't come solution. appreciated. open("some.txt").read() #txt ='cr' count = 0 line in open("some.txt"): if 'crd' in line: pass elif 'crow' in line: pass elif 'cr' in line: print line count = count + 1 print print "total # count " print count yep on write track. need modify last elif block as elif 'cr' in line: print line count = count + 1 value = float(line.split('cr')[0]) listofcrs.append(value)

Applying a Kalman filter on a leg follower robot -

i asked create leg follower robot (i did it) , in second part of assignment have develop kalman filter in order improve following process of robot. robot gets person distance robot , angle (it relative angle, because reference robot itself, not absolute x-y coordinates) about assignment have serious doubt. have read, every sample have seen kalman filter has been in 1 dimension (a car running distance or rock falling building) , according task have apply in 2 dimensions. possible apply kalman filter this? if possible calculate kalman filter in 2 dimensions understand asked follow legs in linnearized way, despite person walks weirdly (with random movements) --> have doubt of how establish function of state matrix, please tell me how or tell me can find more information this? thanks. well should read on kalman filter. estimate state through mean , variance separately. state can whatever want. can have local coordinates in state global coordinates. note latter resu

c++ - Why class instance as pointer uses heap and not stack? -

i read in c++ book can have kinds of class instances in c++. normal class instances class instances pointer for example : class person { public: person(); person(std::string name, int age){ } }; //this created in stack : person john("john",68); //this created in heap b : person *marcel("marcel",31); so, why when creating object using pointer (a) uses heap , why in b, uses stack ? first, let's correct syntax: int main() { person john("john",68); //statement 1 person *marcel = new person("marcel",31); //statement 2 .... } the first statement, indeed, creates instance of class person, on stack. the second statement declares pointer of type person on stack, , assigns instance of class person on heap, because dynamically allocated. so, pointer (i.e. variable holds address of class instance) resides on stack, actual instance allocated on heap. i hope clears things up, if not, reco

Does Maven Mojo have Equivalent to ant's DirSet? -

i'm uplifting ant plugin maven plugin , ant plugin used dirset , see maven has fileset . can use fileset gather directories? should create own dirset class either reviewing ant's patternset - dirset code , implementing similar solution using maven's patternset , or fileset? is there better way gather directories includes , excludes? thanks help peter found on maven's file management examples page. filesetmanager filesetmanager = new filesetmanager(); string[] includedfiles = filesetmanager.getincludedfiles( fileset ); string[] includeddir = filesetmanager.getincludeddirectories( fileset ); string[] excludedfiles = filesetmanager.getexcludedfiles( fileset ); string[] excludeddir = filesetmanager.getexcludeddirectories( fileset ); filesetmanager.delete( fileset );

java - Wrong Servlet path while using Servlet in form's action -

i trying send data login servlet using form in jsp. jsp , servlet in different folders. parent folder "mybay". in there folder named javaservlets , 1 named main_pages. in javaservlets there loginservlet.java , loginservlet.class. in main_pages there login.jsp. when submit username , password see tomcat stays in main_pages , does't in javaservlets folder. don't know if web.xml wrong. http status 404 - /mybay/main_pages/loginservlet //here see path wrong. right path /mybay/javaservlets/loginservlet can help? here code: login.jsp <form action="loginservlet" method="post"> <p> <label id="upodeiksh">username</label> <br /> <input type="text" name="username" id="koutaki" required/> </p> <br /> <p> <label

reporting services - SSRS (SQL2014) - "Subscriptions cannot be created because the credentials used to run the report are not stored -

after deploying reports reporting server, tried add subscription on 1 of reports. not possible, , got error described in link. http://www.kodyaz.com/reporting-services/subscriptions-cannot-be-created.aspx all reports use same shared data source. i applied solution proposed in link , worked. but each time deploy reports (from sql server data tools visual studio 2013); error comes back. i tried modify properties of shared datasource sql server data tools visual studio 2013 before deploying;similarly shown in hyperlink, in case not able access reports anymore. so, seems modify credentials "online" web browser; , not "offline" sql server data tools visual studio 2013. i remarked 1 difference between "offline" , "online" properties of shared data source : online, possible check box "use windows credentials when connecting data source". checkbox not exist in sql server data tools visual studio 2013. this means : each time

javascript - JS not recoganizing Japanese charecters -

i putting japanese text in div @ run time these characters shown boxes , triangles .. here head portion of html page <meta http-equiv="content-type" content="text/html; charset=utf-8"> <meta name="viewport" content="initial-scale=1.0"> and here how putting text in div if (getqscomponent(qskeys.langid) == 1) { $('#title').text("情報"); $('#message').text("プロセスが正常に完了しました。"); } <script charset="euc-jp" src="jp.js"></script> or <script charset="euc-jp"> if (getqscomponent(qskeys.langid) == 1) { $('#title').text("情報"); $('#message').text("プロセスが正常に完了しました。"); } </script> -- in tag <meta> , : <meta http-equiv="content-type" content="text/html; charset=utf-8">

r - How do I prevent my packaged functions from being listed with ls()? -

i managed build , install r package , upon loading, functions in exported global environment , visible ls() . how can prevent behave packages on cran , not pollute global environment? you can have them start leading dot . , if not want them listed when ls() used default parameters. however, not change namespace or environment. can still see them using ls(all.names=true) .

ios - Implementing collision detections -

basically game consists of basket player moves across screen, aim of game player catch balls falling top of screen. trying add collision detection between balls , basket, facing difficulties namely, implementing collision detection. new swift, sprite kit , app development, please help. appreciated. problem facing balls falling in centre of screen. line of code supposed execute when, ball hits basket , following ball should disappear, please new spritekit. import spritekit class gamescene: skscene { var basket = skspritenode() let actionmoveright = skaction.movebyx(50, y: 0, duration: 0.2) let actionmoveleft = skaction.movebyx(-50, y: 0, duration: 0.2) //let physicsbody = skphysicsbody(texture: , size: 3500) override func didmovetoview(view: skview) { /* setup scene here */ self.physicsworld.gravity = cgvectormake(0.0, -0.5) self.backgroundcolor = skcolor.whitecolor() basket = skspritenode(imagenamed: "basket") basket.setscale(0.5) basket.pos

html5 - window.location.assign() is not catched by Router in dart -

i try use router route_hierarchical/client.dart listen onpopstate event , enable/disable <div> in index.html. (example in stagehand.pub dart plugin) if done via normal <a href="/relativepath"> in index.html, works. if try change path via button.onclick.listen() handler in call: window.location.assign('/relativepath'); i 404 , router not handling event properly. should that action not invoke popstate event caught router described here ? handlers.dart ... button.onclick.listen((_){ window.location.assign('/about'); }); ... router.dart var router = new router(); router.root ..addroute(name: 'about', path: '/about', enter: showabout) ..addroute(name: 'login', defaultroute: true, path: '/', enter: showlogin) ..addroute(name: 'context', path: '/context', enter: showcontext); router.listen(); } void showabout(routeevent e) { // extremely simple , non-scala

ios - unexpectedly found nil while unwrapping an Optional value for UITableVewCell custom cell class -

Image
when running code table view, trying instantiate custom cell , fill values , seems work find until gets putting values outlets. couple notes : i know preferred method here use "tableview.dequeuereusablecellwithidentifier" in situation taking different route. also, outlets in custom cell hooked corresponding cell in story board. appropriate delegates setup. thanks in advance. class favoritespropertyviewcell: uitableviewcell { @iboutlet weak var activityindicator: uiactivityindicatorview! @iboutlet weak var cellpropertyimage: uiimageview! @iboutlet weak var cellroomsvalue: uilabel! @iboutlet weak var cellspacevalue: uilabel! @iboutlet weak var cellpricerangevalue: uilabel! @iboutlet weak var cellcitystatezipvalue: uilabel! @iboutlet weak var celladdressvalue: uilabel! } func tableview(tableview: uitableview, cellforrowatindexpath indexpath: nsindexpath) -> uitableviewcell{ var newpropertycell: favoritespropertyviewcell = fa

python - Using int containers with two x MCP3008 ADC Rpi -

the following code uses 2 mcp3008 chips attached rpi , home alarm panel. these 16 analog values fluctuate between 600 , 715 out of 1023 depending on pirs etc. the int value prints out: chip - 1023 chip b - 242 chip - 1023 chip b - 1023 chip - 0 chip b - 68 chip - 1023 chip b - 599 chip - 1023 chip b - 1023 chip - 16 chip b - 1023 chip - 1023 chip b - 1023 chip - 1023 chip b - 1023 i need: value 1 = chip 1 readvalue 1 value 2 = chip 1 readvalue 2 etc... i tried strings, lists, io, wrappers first value. could please go more detail want? currently, unclear. – sildoreth 35 mins ago mcp3008_a , mcp3008_b print out analog values chip.i want assign each of values specific name, eg.value1 = 1023, value2 = 654 etc.. want able write ( if value 2 >=653 ) , (value10 <= 702) something. hope explains bit better – maurice1 19 mins ago maybe clearer, @ bottom of code have #v1 = input.readline() , #

javascript - How to get value from ajax php (can't get) -

page 1 : index.php script ajax <script> function fcall(clusters) { var clusters = document.getelementbyid("clusters").value; var request = $.ajax({ type: "get", url: "chart.php", data: {clusters: clusters} }); request.done( function( msg ) { $("#page").html(msg); }); } </script> script php $sql = mysql_query("select * tree_hie group no_cluster asc") or die(mysql_error()); while ($data1=mysql_fetch_array($sql)) { $clusters = $data1['no_cluster']; $sql2 = mysql_query("select * tree_hie no_cluster = '$clusters'") or die(mysql_error()); while ($data2 = mysql_fetch_array($sql2)) { <input type="button" id="clusters" name="clusters" onclick="fcall(<?php $data1['no_cluster']; ?>);" value="<?php ech

module - PERL : Unicode string : Permission denied -

this question has answer here: how can use new perl module without install permissions? 10 answers i program using perl , need install unicode string. make install tells me: files found in blib/arch: installing files in blib/lib architecture dependent library tree !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! error: can't create '/library/perl/5.16/darwin-thread-multi-2level/unicode' mkdir /library/perl/5.16/darwin-thread-multi-2level/unicode: permission denied @ /system/library/perl/5.16/extutils/install.pm line 494. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! @ -e line 1. make: *** [pure_site_install] error 13 does ever encountered problem? /library system directory. bad idea tinker system's own perl distribution. if goes wrong, you'll have lot of cle

How to use Boost with Cocoapods on IOS? -

Image
has succeeded in using cocoapods boost pod ? i not understand not seem install fully. after pod install blank project below. there step missing ? this output install pod install --verbose analyzing dependencies updating spec repositories $ /applications/xcode.app/contents/developer/usr/bin/git rev-parse >/dev/null 2>&1 $ /applications/xcode.app/contents/developer/usr/bin/git rev-parse >/dev/null 2>&1 updating spec repo `master` $ /applications/xcode.app/contents/developer/usr/bin/git pull --ff-only up-to-date. cocoapods 0.36.3 available. update use: `gem install cocoapods` more information see http://blog.cocoapods.org , changelog version http://git.io/bah8pq. inspecting targets integrate using `archs` setting build architectures of target `pods`: (``) using `archs` setting build architectures of target `pods-podboost`: (``) resolving dependencies of `podfile` starting resolution (2015-04-01 15:48:56 +0300) creating possibility stat

scala - Squeryl - HikariCP - mySql - Distributing Read Traffic to Slaves -

i'm trying follow steps listed @ http://dev.mysql.com/doc/connector-j/en/connector-j-master-slave-replication-connection.html states to enable functionality, use com.mysql.jdbc.replicationdriver class when configuring application server's connection pool from https://github.com/brettwooldridge/hikaricp - says hikaricp attempt resolve driver through drivermanager based solely on jdbcurl so configuration thats needed? db.default.url=jdbc:mysql:replication ... squeryl has has number of db adapters; understanding these unrelated? http://squeryl.org/api/index.html#org.squeryl.adapters.mysqlinnodbadapter sorry key word loading - i'm not sure need focus thanks brent replication allows different url: jdbc:mysql:replication://[server1],[server2],[server2]/[database] i've never tried it, assume resolve replicationdriver.

xml - Android Action bar not showing Icons -

how can display icons in actions bar, here code, <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"> <item android:id="@+id/search_icon" android:icon="@drawable/ic_action_search" android:showasaction="always" android:orderincategory="0" android:title="search" > </item> </menu> and @override public boolean oncreateoptionsmenu(menu menu){ menuinflater mif = getmenuinflater(); mif.inflate(r.menu.custom_action_bar,menu); return super.oncreateoptionsmenu(menu); } thanks ! if using app compat use app:showasaction <item android:id="@+id/search_icon" android:icon="@drawable/ic_action_search" app:showasaction="always" android:orderincategory="100" android:title=&qu

intellij idea - How to hide the div structure thing next to the editor tabs -

Image
there's colored bar @ top of intellij idea editor, shows div structure. know how hide that? because everytime move cursor editor tabs, cross on bar makes editor blink. (maybe better way keep bar, turn off blinking when cursor moves across bar. possible that?) you can disable unchecking show html breadcrumbs in settings/editor/general/appearance .

c# - How to pass data from childform to parentform -

i have 2 forms ,form1 , form2. form1 - parent form2 - child form1 contains following, textbox - loads file path, datagridview - loads file data, buttonnext -when button cliked opens form2, form2 contains following, browsebutton - broswe file directory textbox - shows path buttonfinish - tabes form1 *now want access datagridview form1(parent) form2(child). can broswe file on form2 , when click finish can see file path on form1(parent) textbox no databeing loaded. how can load data on form1 datagridview ? this code far.. form2. public frminputfile(frmmain_page _frmmain) { initializecomponent(); this._frmmain = _frmmain; } private void btnbrowse_click(object sender, eventargs e) { browsefile(); } private void btnfinish_click(object sender,eventargs e) { _frmmain.setfilepath(txtinputfile.text); _grid.rows.clear(); //cant grid form1 string pathselection = ""; if (txtinputfile

onfocus function in javascript without using id -

i have table , few rows, when user enters value in cell, checks correct format , pop's message if value incorrect , want focus stay in current cell. dont have id in input type, directly passing value. can tell me, without using document.getelementbyid().focus(), other way focus on current cell. tia if event handler bound input should able capture this . otherwise should able read target property of the event object .

arrays - NSSortDescriptor using NSDate attribute of Entity (Swift) -

i have question similar this one little twist. i wondering how return specific attribute ('weight' in case) in fetch request when core data model follows: client <-->> assessment ('assessment' has weight attribute) here's client class: @objc(client) class client: nsmanagedobject { @nsmanaged var name: string @nsmanaged var assessment: nsset } and assessment class: @objc(assessment) class assessment: nsmanagedobject { @nsmanaged var weight: int16 @nsmanaged var nsdateofassessment: nsdate @nsmanaged var client: client } and here's fetch request have it. understand right 'weights' array being filled managed objects, need filled ints of 'weight' attribute, , sorted date 'nsdateofassessment' described in comments of code. in turn using array fill graph. var client: client! = nil var weights = [] func weightfetchrequest() -> nsfetchrequest { let appdelegate = uiapplication.sharedap

Should i use an SSL Certificate to protect information entered in a PHP form? -

i developing php form collects personal information user. information not kept in database, sent , email address. need on https connection? if please explain why or provide link can obtain knowledge of this. how can hackers access information if not kept online or stored in data base? i if information not sensitive, don't have go ssl certificate. for example, if collecting user's firstname, lastname, email address, , message don't have use ssl. however, if collecting sensitive data ssn, bank account number, routing number, credit card numbers etc, highly recommended use ssl.

Java String.replace() - replaces more than just the substring I specify? -

as per this codingbat problem trying following: given string, if first or last chars 'x', return string without 'x' chars, , otherwise return string unchanged. my code: public string withoutx(string str) { if (str.startswith("x")) { str = str.replace(str.substring(0, 1), ""); } if (str.endswith("x")) { str = str.replace(str.substring(str.length()-1), ""); } return str; } this code replaces x characters in string, rather first , last. why happen, , way solve it? from sdk replace method: returns new string resulting replacing all occurrences of oldchar in string newchar. you can solve without replace: public string withoutx(string str) { if (str == null) { return null; } if (str.startswith("x")) { str = str.substring(1); } if (str.endswith("x")) { str = str.substring(0, str.length()-1);

sql server - What TSQL gives rights to create functions on a schema -

i have program runs following sql: create function [foo\bar].something ( the sql looks fine, error the specified schema name "foo\bar" either not exist or not have permission use it. what sql can run on database schema access create function? think want keep default schema dbo , have access other [foo\bar] schema. the sql server books online states in create function topic ( https://msdn.microsoft.com/en-us/library/ms186755.aspx ): requires create function permission in database , alter permission on schema in function being created

callback - Notify webapp that the image has been successfully captured from android hybrid app -

i have below query: scenario have developed android hybrid application, our web application hosted on remote server opened inside webview container of android. requirement capture image camera , attach form. limitations android cannot call methods (callback) on remote javascript. web application, being single page html5 , jquery application, cannot reloaded/navigated. present implementation able open camera capturing url navigation event of android webview (navigation triggered on ‘attach’ button click dummy url website). still no way notify webapp image has been captured/uploaded on server. appreciated. one way poll server @ regular intervals , check. since u cannot call remote js. other option not preferred, reload webview(refresh current page in browser history) once u done image uploading in background native.

how to create pagenation in dynamic table view in android -

paginationlayout paginationlayout = new paginationlayout(this); paginationlayout.setlayoutparams(new layoutparams(layoutparams.fill_parent, layoutparams.fill_parent)); // creates content sample tablelayout table = new tablelayout(this); table.setlayoutparams(new layoutparams(layoutparams.fill_parent, layoutparams.fill_parent)); table.setgravity(gravity.center_horizontal|gravity.center_vertical); tablerow row = new tablerow(this); row.setlayoutparams(new layoutparams(layoutparams.fill_parent, layoutparams.fill_parent)); table.addview(row); tablerow row2 = new tablerow(this); row2.setlayoutparams(new layoutparams(layoutparams.fill_parent, layoutparams.fill_parent)); table.addview(row2); for(int = 0; i< 50;i++){ button button = new button(this); button.settext("button " + i); if (i%2==0) { row.addview(button); } else { row2.addview(button); } }

time complexity - Homework: Prove or disprove: (5n)!=O(n!^5) -

Image
i have question in h.w: prove or disprove: (5n)!=o(n!^5). i don't know how approach (of course know o notation definition don't have clue how solve it).. please? i think have use stirling's approximation here, gives following approximations: since known that: we have: if need more detailed proof, can indeed use big o formal definition , still stirling's approximation, obtain result.

.htaccess - How to match right single quotation mark character in an Apache RewriteRule -

i'm trying following url: http://olddomain.com/macmillan ’s-st-luke-passion which contains right single quotation mark character ( http://www.fileformat.info/info/unicode/char/2019/index.htm ) to redirect new location. however, cannot apache this. for reference redirect code (in virtualhost) follows: rewriteengine on rewriterule ^macmillan\xe2\x80\x99s-st-luke-passion$ http://newdomain.com/tickets/events/macmillans-st-luke-passion [r=301,l] the file has other redirects exact matching urls, , 1 catch redirect @ bottom of page. 1 intended match remaining urls /events/(old url) . example send olddomain.com/page-title newdomain.com/events/page-title redirect 301 / https://newdomain.com/events/ what's happening @ present apache ignoring specific rule contains \x encoded string right quote character ’ and falls through fallback redirect sends url wrong place. can how match url right quote character ’ in apache rewriterule (or redirectmatch)? thanks!

php - Why is the <li> not lined up -

does know why below css <li> not aligning correctly? should 5 in each row per 2nd row of them. movie <li> http://i57.tinypic.com/9gd2l5.png css #movies { margin:0 auto; width:690px; } #movies ul { background-color:#222; border-radius:10px; text-align: center; display:inline-block; margin:0 auto; padding-left:10px; padding-top:10px; } #movies ul li { float:left; width:115px; padding: 5px 5px 20px 5px; list-style-type: none; } #movies ul li a{ text-decoration:none; display:block; padding:10px; color:#fff; } #movies ul li a:hover{ background-color:#111; } code <div id="movies"> <ul> <?php foreach($movietitle $movie) { echo '<li>'; echo '<img src="' . $movie->image . '" />'; echo '<div class="cfff">' . $movie->movie_name . '</div>'; echo '<div class="s11 c999">rating: ' . round($movie->rating) . '</div>'; ech

Java SE preventing maven clean -

i using maven remote resources plugin copies resources 1 module of app , creates xml file list of copied files. lot of times when build app , deploy tomcat, terminate , try again, build fails following message: [error] failed execute goal org.apache.maven.plugins:maven-clean-plugin:2.4.1:clean (default-clean) on project students-ui: failed clean project: failed delete {application-path}\target\classes\meta-inf\maven\remote-resources.xml -> [help 1] this happens randomly, doesn't happen @ , takes 5 - 10 tries go through. when happens , try delete file manually says in use java se. why java hold file?