Posts

intellij idea - Keyboard shortcut to completely hide Java-doc comments so they take no lines in the code anymore -

Image
i know shortcuts: ctrl + shift + + ctrl + shift + - which expand , minimize java-doc comments respectively. way of line collapsing keeps line of space: how collapse no lines of code occupied comments anymore? how see java-doc comments above takes 1 line of code. i try work distraction free , want show actual code. here official page of intellij code folding shortcuts summarised (android studio fork of intellij have same shortcuts). can't find shortcut looking here. select part want hide , press ctrl + alt + t . choose either //<editor-fold desc="description"> // part hide //</editor-fold> or //region description // part hide //endregion change description won't distract you, example _ . after collapsing block see _ .

is database locking enabled by default in rails? -

some frameworks opinionated when comes database locking. example, grails orm (gorm) documents state following: by default gorm classes configured optimistic locking source : https://grails.github.io/grails-doc/latest/guide/gorm.html#locking i've read through material online rails , understanding rails not provide locking default. what rails default approach locking? note : not question approach best, question confirm rails's approach locking. by default, i'm pretty sure database locking turned off in rails. if want use locking, have @ ruby on rails docs: http://api.rubyonrails.org/classes/activerecord/locking/pessimistic.html

java - Is there a concrete implementation of OCRProcessor in openimaj -

i trying text extraction using openimaj , using liusamarabandutextextractorbasic text extractor subclass. class needs ocrprocessor implementation actual ocr. following javadoc public void setocrprocessor(ocrprocessor<t> ocr) for text regions extracted associated textual representations of text regions, ocr processor must used. use function choose ocr processor used extract read text regions. i did not find implementation in openimaj library (which strange if ask me). is there ocrprocessor implementaion can use? no, there seems no implementation. wrote java wrapper around tesseract-ocr (platform dependent) ocr.

Issue with scope of variables in C, why a function prints what it's supposed to print -

what going on in program here? why myfunction print 3 x? int myfunction(int); void main(void) /* local variables: x, result in main */ { int result, x = 2; result = myfunction(x); printf("%i", result); /* prints "3" */ printf("%i", x); /* prints "2" */ } int myfunction (int x) { x = x + 1; printf("%i\n", x); /* prints "3" */ return x; } that's because parameter local variable in function. when function called, there space allocated on stack parameter, , value variable x copied parameter. in function parameter x local varible, separate variable x in calling code. when x increased in function, happens local copy. when function ends, parameter goes away when stack frame function removed stack.

android - Can I use the same frame layout (as container) to display DrawerLayout and RecyclerView? -

i have navigation drawer using recyclerview layout. in same time, main page use recyclerview layout too. how manage optimally? this activity_main.xml <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent"> <!--toolbar--> <include android:id="@+id/toolbar_actionbar" layout="@layout/toolbar_default" android:layout_width="match_parent" android:layout_height="wrap_content" /> <!-- recyclerview commonly used attributes --> <android.support.v7.widget.recyclerview android:id="@+id/my_recycler_view" android:layout_width="match_parent" android:layout_height="match_parent" android:scrollbars="vertical" /> <imageview android:id="@+id/imageview1...

ios - Overlapping table view scrolls tableView behind it -

Image
basically have compound view in storyboard: a uiview inputs. let's call view1 container view displays tableview controller ( view2 ) works fine. i have small issue when displayed tableview uiview overlaps bottom view2 own results. cells stays within bound of view1 can interacted , selected. part of tableview (autocomplete results) overlaps view2 (and looks on top) scrolls view2 .. i tried referencing view1 , setting view1.layer.zposition higher value. wouldn't help.. any suggestions? if requires modifying code swift syntax preferred on obj-c your problem comes fact tableview autocomplete results added view1. , receive touches sent it. if select clipsubviews on view1 you'll see autocomplete results tableview cut bounds of view1 1. try add autocomplete results tableview self.view(main view of view controller). way above both view1 , view2 , receive touches come on tableview

PHP mySQL Query ignores decimal values -

i'm using ajax pull stocks database based on values contained on input. 1 of these values average returns, contains decimal value. i have 2 variables, $min_returns , $max_returns hold values such 4 , 6.6 respectively (normally hold ajax return). php code: select avgreturns stocks avgreturns >= '$min_returns' , avgreturns <= '$max_returns' in database , values 0.3 4.6, etc.. the problem getting decimals may not there. example, 1.3 valued 13, wouldn't included in example above. integers, 5, read , included above. i new php , mysql together. there doing wrong in database, need set columns correct setting? know called in query returned string, there isn't way convert within query, there? would avoid rounding values in database if @ possible. single quotes denote string literals, you're forcing database compare values lexicographically. in order interpret them numerically, drop quotes: select avgreturns stocks avg...