Posts

How to correctly use ng-View with md-tabs in AngularJS and Angular Material -

i trying use angular material md-tabs in web site each tabs represents different url determined using ng-view tag. web site here: here . visually works i'm noticing pages loaded 5 times every time change tab .... once each tab location. is there setting or need change correctly? the code tabs follow: <div class="tabsdemodynamicheight"> <md-content class="md-padding"> <md-tabs md-dynamic-height md-border-bottom md-selected="selectedindex"> <md-tab label="featured"> <md-content class="md-padding"> <div ng-view></div> </md-content> </md-tab> <md-tab label="art sale"> <md-content class="md-padding"> <div ng-view></div> </md-cont...

php - MassAssignmentException in laravel5 -

i used laravel5...and want store data in database , when press submit error appeared > massassignmentexception in c:\xampp\htdocs\marriage\vendor\laravel\framework\src\illuminate\database\eloquent\model.php line 417: _token my controller code public function store(request $request) { $custom =request::all(); custom::create($custom); return redirect('custom'); } model code class custom_table extends model { protected $fillable=[ 'skin_color', 'cast', 'residence', 'family_members', 'hieght', 'created_at', 'updated_at' ]; } please me how resolve error you running error, because request passing "_token" attribute, , not mass assignable. you can exclude using except method, such: public function store(request $request) { $custom = request::except('_token'); // exclude _token attribute custom::create($custom); return redi...

Sum notation in julia? -

Image
i wondering if knew of julia equivalent function sum using sigma. example if wanted sum of sort (unsure of how show sigma notation, here picture of looking for): both c , x matrices define earlier in code. know how code in julia or whether julia has equivalent function? have used sum more simple vector sums, not sure if translate larger matrices. ideas? if talking plain-old-julia variables c = rand(5,3) x = rand(5,3) @show sum(c.*x) but if referring jump (based on previous questions), use sum{} : using jump m = model() @variable(m, 0 <= x[i=1:5,j=1:3] <= 1) c = rand(5,3) @constraint(m, sum{c[i,j]*x[i,j],i=1:5,j=1:3} <= 10)

python - django - how to implement a 2-step publish mechanism -

i'm new both web development , django maybe that's noob question. i want following: ask user fill form , submit it. then, parse , format content , display user let him verify it. user can accept result or go previous view, update data , resend. this far can think: views.py def add_content(request): if request.method == 'post': form = addcontentform(request.post) if form.is_valid(): content = form.save(commit=false) return verify_content(request, content) else: form = addcontentform() return render(request, 'myapp/add_content.html', {'form' : form}) def verify_content(request, content): return render(request, 'myapp/verify_content.html', {'content' : content}) the verify_content template contain 2 buttons ('back', 'ok'), don't know how pass content object view saving in db, or send previous view there. should use js? can server side cod...

driver - What happens when a Python program exits and a library is loaded using ctypes? -

i have tried find information on this, nothing far. scenario python program uses c based library loaded ctypes , encounters unhandled exception. python unlioad library? or matter? the main reason why issue library in question device driver, , want avoid leaving hardware in wrong state should go wrong.

mysqli - How to search a word on two table if have or not by php query -

i want find out userid 2 table username username have stayed in table2 or not. means if username match in table query collect userid. table 1: username --- userid > john --- 100 table 2: username --- userid > colin --- 101 i read many article here nut cannot understand should do. now think: need john's uesrid, so tried: $username = "john"; $q = "select userid table1,table2 table1.username = '$username' or table2.username = '$username'"; $result = mysqli_query($this->connection, $q); from understand want check if name exist in 1 of tables. here easy php code: <?php session_start(); include 'db_connect.php'; $check_1 = mysqli_query("select * table_1 username = '$username'"); $check_2 = mysqli_query("select * table_2 username = '$username'"); if(mysqli_num_rows($check_1)==0){ //didnt exist in table 1 } else if(mysqli_num_rows($check_2)==0){ ...

how to list all pdf files in my android device -

i found code how images. can tell me how can .pdf files in internal storage , external storage? final string[] columns = { mediastore.images.media.data, mediastore.images.media._id }; final string orderby = mediastore.images.media._id; //stores images gallery in cursor cursor cursor = getcontentresolver().query( mediastore.images.media.external_content_uri, columns, null, null, orderby); //total number of images int count = cursor.getcount(); //create array store path images string[] arrpath = new string[count]; (int = 0; < count; i++) { cursor.movetoposition(i); int datacolumnindex = cursor.getcolumnindex(mediastore.images.media.data); //store path of image arrpath[i]= cursor.getstring(datacolumnindex); log.i("path", arrpath[i]); } possible solution can go every folder , check if .pdf exists or not if yes can whaterver want file public void search_dir(...