Posts

php - Assigning abilities in Laravel 5.1 Authorization -

recently upgraded laravel 5.1 , have read new features authorization . using entrust before decided use using basic permission/abilities anyway. doc explains how define , check abilities didn't find line attach ability user. guessing these abilities should saved , pulled db, not sure how attach these. unfortunately authorization service doesn't assign abilities/permissions coming database. docs seem mislead in direction. you can opt package deal part, such https://github.com/spatie/laravel-permission

laravel - Request Data to Model Function -

i'm trying find out why when dd($request->all()) in store method of controller correct, when send model function register() no seen. i'm not quite sure i'm doing wrong. <?php namespace app\http\controllers; use app\user; use illuminate\http\request; use app\http\requests; use app\http\controllers\controller; class userscontroller extends controller { public function store(request $request, user $user) { $this->authorize('delete', $user); $this->validate($request, [ 'firstname' => 'required|min:3', 'lastname' => 'required|min:3', 'displayname' => 'required|min:3', 'emailaddress' => 'required|email|unique:users,email', 'password' => 'required|min:3', 'role' => 'required|exists:roles,id' ]); $userregistered = $user-...

java - The udp server throws OOM exception when feed data in a high rate -

in order recieve maximum 64kb of data , reduce packets loss, config udp server following netty 4.0 public class udpserver { public void run() throws exception { eventloopgroup group = new nioeventloopgroup(); try { bootstrap b = new bootstrap(); b.group( group ).channel( niodatagramchannel.class ).option( channeloption.so_broadcast, true ) .option( channeloption.udp_receive_packet_size, 1024 * 64 ) .option( channeloption.so_rcvbuf, 1024 * 1024 * 100 ).handler( new userhandler() ); b.bind( 5141 ).sync().channel().closefuture().await(); } { group.shutdowngracefully(); } } public static void main( string[] args ) throws exception { new udpserver().run(); } } when feed data in 20kmsg/s udp sercer, throws oom exception. found cause config param udp_receive_packet_size larger direct buffer memory ran out quickly. if set 102...

Redirecting merge of single file in git -

is possible explicitly tell git during merge file has been renamed or moved? the background have done refactoring class has been generalized instead of having 1 class called "myclass", have 2 classes "myclassbase" , "myclass". logic in "myclass" has been moved "myclassbase" virtual method has been added "myclass" implements. "myclassbase" , "myclass" reside in separate files ("myclassbase.cs" , "myclass.cs"), , classes in respective files. now problem when merge, lot of conflicts in "myclass.cs" there has been changes in class on master. if somehow able tell git changes file "myclass.cs" on master should merged file "myclassbase.cs", merging trivial. since commit has been done already, can add dummy commit (add empty line or comment line explaining change) explaining commit message tell in details change. correct way such thing next time h...

php - Cannot search string in elastic search after adding synonym -

i have implemented synonym in elasticsearch facing problem. whole string splited on whitespace , can not search "see result option". here settings. $indexsettings['analysis']['analyzer'] = array( 'std' => array( // allow query 'shoes' match better 'shoe' stemmed version 'tokenizer' => 'standard', 'char_filter' => 'html_strip', // strip html tags 'filter' => array('standard', 'elision', 'asciifolding', 'lowercase', 'stop', 'length'), ), 'keyword' => array( 'tokenizer' => 'keyword', 'filter' => array('asciifolding', 'lowercase'), ), 'keyword_prefix' => array( 'tokenizer' => 'keyword', ...

python - Negative infinity and negative zero in numpy -

this more of general understanding question a = np.array([-0, 5, 0]).astype(float) b = 1 / print b returns [ inf 0.2 inf] but a = np.array([-0.0, 5, 0]) b = 1 / print b returns [-inf 0.2 inf] i expected first 1 return -inf first element well, why doesn't it? integers on machines have no concept of negative zero, -0 0 . since build array integers before cast float, [0.0, 5, 0.0] . in [2]: np.array([-0, 5, 0]).astype(float) out[2]: array([ 0., 5., 0.])

html - Vertical scrollbar appearing involuntarily -

vertical scrollbar appearing in page. have no iea causing it. i've tried adding display: block , display: block-inline children did not work. had set these width weird % values seem stop working anyway. <!doctype html> <html> <head> <title>code together</title> <!--reference css--> <link href="/styles/frontpage.css" rel="stylesheet" type="text/css" /> <!--reference jquery library--> <script src="/scripts/jquery-2.2.1.js"></script> <!--reference signalr library. --> <script src="scripts/jquery.signalr-2.1.2.min.js"></script> <!--reference autogenerated signalr hub script. --> <script src="/signalr/hubs"></script> <!--reference ace--> <!--<script src="~/scripts/roomfunctions.js" type="text/javascript" charset="utf-8"></script>...