Posts

Showing posts from January, 2012

rest - A message body writer for Java class java.util.ArrayList, and Java type class java.util.ArrayList, and MIME media type application/json was not found -

i new using jersy implementing rest api i below error, when call products service. com.sun.jersey.api.messageexception: message body writer java class java.util.arraylist, , java type class java.util.arraylist, , mime media type application/json not found. here code: @get @path("/products") @produces(mediatype.application_json) public response productsearch(@queryparam("name") string name) { list<product> products = new arraylist<>(); products.add(new product("prdname", "prdcost", "prdmodel")); return response.ok( products).build(); } i tried this: @get @path("/products") @produces(mediatype.application_json) public list<product> productsearch(@queryparam("name") string name) { list<product> products = new arraylist<>(); products.add(new product("prdname", "prdcost", "prdmodel")); return products; } the below setup of env...

Is it possible to programmatically call a Chrome Custom Tab, but as "incognito mode"? -

in case, user might not want chrome custom tab show in browsing history. there way app tell chrome custom tab display webpage in incognito mode , , avoid storing url in user normal browsing history? if that's not possible, submit feature request that? thanks!

How to sent an alert when somone open the Spreadsheet using Google Script -

situation: i have spreadsheet 15 worksheets , 20 users logging in , modifying it. i have following script should send email user email adress open spreadsheet. script function needed: send email when user open spreadsheet. problem: session.geteffectiveuser() getting the email owner of script , not getting user email. the session.geteffectiveuser() since july23 should re-autorization user. perform following note re-approve script other user script , google account test case: this script have trigger when open spreadhseet. function loginshift(){ var ss = spreadsheetapp.getactivespreadsheet(); mailapp.sendemail("xxxxxx@gmail.com", "login shift" , "login username: " + session.geteffectiveuser()); } when open spreadsheet owner of script, same sent me email email address open spreadsheet. when open spreadsheet different user not owner of script, script run , send email using owner mailbox , not mailbox of us...

sql - Get records which are not in tables when passed in In clause? -

i sure title of question need change , not sure put end . i passing in clause in 2 tables want records not in both tables . table contains id 1,2 table b contains id 3,4 i passing in in clause (1,2,3,4,5,6) i looking 1 tablea 2 tablea 3 tableb 4 tableb 5 not found 6 not found i using union items table , table b not sure how not found records in both table ? here 1 method. uses exists check whether tables contain id : select id, (case when ina = 1 , inb = 1 'both' when ina = 1 'tablea' when inb = 1 'tableb' else 'not found' end) status (select id, (case when exists (select 1 tablea a.id = ids.id 1 else 0 end) ina, (case when exists (select 1 tableb b b.id = ids.id 1 else 0 end) inb (values (1), (2), (3), (4), (5), (6)) ids(id) ) i; of course, can add where ina = 0 or inb = 0 if don't want 'both' rows.

android - Using Intents to Launch another app to open a .vtk file -

i working on app in android, , in app, user can browse , select .vtk file. i have installed app called "kiwiviewer," opens these .vtk files. when manually go through tablet, , click on .vtk files using file managing app, kiwiviewer opens these .vtk files no problem. i have same thing occur in app. user's selected .vtk file opened kiwiviewer. know kiwiviewer's package ("com.kitware.kiwiviewer"), , able open app intent. however, unable open .vtk file passed app. intent = new intent(this.getpackagemanager().getlaunchintentforpackage("com.kitware.kiwiviewer")); i.setdata(uri.parse(getintent().getextras().getstring("imageuri"))); startactivity(i); i have checked, , data being sent valid (it isn't null, , right file. i have tried following, doesn't work either: intent = new intent(); i.setdata(uri.parse(getintent().getextras().getstring("imageuri"))); i.setpackage("com.kitware.kiwiviewer"); startactiv...

PHP, Javascript, mysql, and selection lists -

i'm working on piece of software grab information mysql database , throw onto our form dynamically. i'm running couple problems, though. i'll give quick rundown of functionality. when form loads, have ton of selection lists. these populated through arrays various keys/values in php. when select option 1 list, we'll call "customers" list, on-click need check if customer has special flag (stored in database), , update selection list based on data. how understand core of solution need have javascript trigger on-click, have. function called references php page handles database query through class , it's function. <script> function setservice() { // customer's "id" grabbed aforementioned customer selection list customer = $('#customer').val(); $.get('thepage.php?key=setservice?customer='+customer); } </script> this function talks php. customerprovider class works 100%. have tested thoroughl...

PostgreSQL Finding IDs that don't exist in two other tables -

i want change io_dl field 1 0 in io table, if 3 conditions hold true io table pkey -> io_id the pkey io not in entire table m fkey named m_id the pkey io not contained in table p , column p_id csv delimited string of ids ex. "1923,2309,210" the current value io_dl field in io table set 1 step 3 guess isn't needed setting 0 0 doesn't mess up, check may slow query down? this i've tried , im getting massive list of same io_id s listed, think i'm using join or union wrongly. update io set io_dl = 0 io_id in ( select i.io_id io inner join ( select p_id "io_id" p union select regexp_split_to_table(m.m_id, ',')::integer id m ) q on i.io_id != q.io_id i.io_dl = 1 ); made own solution few minutes later simpler query believe. update io set io_dl = 0 io_id in ( select i.io_id io i.io_id not in ( select p_id "io_id...

pycharm - Multiple Python Interpreters used in the same project? -

i using pycharm , lets use 1 interpreter example python 2.7.5 or python 3.5.1. the problem have modules 1 google access analytics data , 1 called docxfactory want use together. i can docxfactory work on python 3.5.1 , can analytics work on 2.7.5... how can can use these 2 modules together? read answer on here said have them in 2 different projects , unless did wrong tried no success... ideas? one idea write 2 seperate scripts; 1 analytics , 1 docxfactory. decide of these driver, , have driver shell other -- being sure invoke appropriate version of python. ex: #/usr/bin/env python2.7 import subprocess # analytics # ... # call docxfactory script subprocess.call(['python3', 'docxcript.py'])

eclipse - Java cannot open executable jar file on Windows 10 (Open with...) -

so... when want open java executable file double clicking it, system wants me select program open. before wasn't this. opened... when window pops up, first thing is: "c:\program files\java\jre1.8.0_92/bin/javaw.exe" -jar "%1" %* selecting nothing changes. trying open .bat file , cmd, showed me error: the system cannot find file c:\programdata\oracle\java\javapath\java.exe i tried many different ways it, nothing works :( also, can write programs in eclipse without problems. sure, java files "executable jar files".

xaml - ExtendedSplashScreen with custom size and Animation C# UWP -

i trying accomplish uwp app adding extendedsplashscreen. in uwp splashscreen should have specific dimensions , should added in splashrect in centre of page. want: splash taking screen size (for different screen sizes) make animation of displaying different pictures after each others. could accomplished? allowed in uwp design guidlines? accomplishing this? could accomplished? yes,i have uploaded completed demo meet requirements. can download csplashscreen solution testing. meet requirement, make animation of displaying different pictures after each others. i implement flipview control , dispatchertimer . splash screen can display picture 1 one automatically. splash taking screen size (for different screen sizes) the flipview fit window's size , image displayed full window in different devices. xaml code: <flipview x:name="imageflipview"> <image source="ms-appx:///assets/caffe600320.jpg" stretch="fill...

regex - Bash, Awk dynamically matching shell variable (Darwin BSD) -

i have series of .csv files similar this: facility, room, sn, alert_start, alert_end foo, bar, 28g63, 5/16/16 12:24, 5/30/16 12:24 foo, bar, 58dfy, 5/11/16 12:25, 5/30/16 12:24 foo, bar, dd8f6, 5/27/16 12:25, 5/30/16 12:24 foo, bar, 397d2, 5/24/16 12:24, 5/30/16 12:24 each file holding different matched pair of "room" , "alert_end" values. i trying arrange .csv report in week's worth of "room" , "alert_end" pairings contained in 1 file, "sn" being other data showing. needs arranged this: room.csv 5/26/16, 5/27/16, 5/28/16, 5/29/16, 5/30/16, 5/31/16, 6/1/16 28g63, 28g63, 28g63, 28g63, 28g63, 28g63, 28g63 58dfy, 58dfy, 58dfy, 58dfy, 58dfy, 58dfy, 58dfy , dd8f6, , , , dd8f6, 397d2, 397d2, 397d2, 397d2, 397d2, 397d2, 397d2 i58d7, , , , i58d7, i58d7, i58d7 here code block attempting formatting: function organizetext { in {0..6}; day=$(date -v-${i}d +%y-%m-%d) ...

sql - Detect gaps over 30 min in timestamp column -

i have read on , attempted using standard method of gaps , island detection in series no success because need able ignore gaps less 30 minutes. can not use cursor due performance issues. everytime there gap of @ least 30 min, need new row start , end. if there no gaps of @ least 30, result 1 row min , max of timestamps. if there 1 gap of @ least 30, there 2 rows - start of series gap , gap end. if there more gaps, rows each interval between gaps, etc. input: timestamp 2015-07-15 15:01:21 2015-07-15 15:17:44 2015-07-15 15:17:53 2015-07-15 15:18:34 2015-07-15 15:21:41 2015-07-15 15:58:12 2015-07-15 15:59:12 2015-07-15 16:05:12 2015-07-15 17:02:12 desired output : from | 2015-07-15 15:01:21 | 2015-07-15 15:21:41 2015-07-15 15:58:12 | 2015-07-15 16:05:12 2015-07-15 17:02:12 | 2015-07-15 17:02:12 easy solution using common table expression. compare cursor performance if have @ least 1000 rows. create table #tmp (dt datetime) insert #tmp values ('...

How can I implement this class in Polymorphism c++? -

i'm making game. plan on having 4 enemy types. made class 1 of them. i'm new c++ , confused polymorphism , how , when use it. i need know how create class acts base 4 of enemy classes. i know using oop, 1 of advantages less code used means it's efficient. i'm not asking code whole class me, asking how possibly use polymorphism in situation. here 1 of 4 enemy classes. (they same without polymorphism, thing change chanceofloss variable) . class punk { public: punk(player player) { chanceofloss = 50; this->player = player; } bool fight() { chanceofwin = chanceofloss + player.getweapon(); randnum = 1 + rand() % 100; if (randnum <= chanceofwin) { return true; } return false; } private: player player; int chanceofloss; int randnum; int chanceofwin; }; ...

javascript - Spring MVC + AngularJS + JWT Token Expiration - HowTo -

i ensure json web tokens revoked/expire after configurable ammount of time , have following set up: security filter: import io.jsonwebtoken.claims; import io.jsonwebtoken.jwts; import yourwebproject2.service.userservice; import org.apache.commons.lang.stringutils; import org.slf4j.logger; import org.slf4j.loggerfactory; import org.springframework.beans.factory.annotation.autowired; import org.springframework.web.filter.onceperrequestfilter; import javax.servlet.filterchain; import javax.servlet.servletexception; import javax.servlet.http.httpservletrequest; import javax.servlet.http.httpservletresponse; import java.io.ioexception; import java.util.arraylist; import java.util.list; import java.util.regex.pattern; /** * @author: kameshr */ public class jwttokenauthfilter extends onceperrequestfilter { private static list<pattern> auth_routes = new arraylist<>(); private static list<string> no_auth_routes = new arraylist<>(); public static f...

php - htaccess - Forcing trailing slash but exempt .shtml files -

i tried following code force trailing slash on website: rewriteengine on rewritecond %{request_filename} !-f rewriterule ^(.*)([^/])$ /$1$2/ [l,r=301] and works when went page should throw 404, redirecting me www.domain.com/404.shtml goes in redirect loop. the site is: http://www.shivampaw.com i have removed above code htaccess still need trailing slash forced. my full htaccess rewrite rules: rewriteengine on rewritecond %{http_host} !^$ rewritecond %{http_host} !^www\. [nc] rewritecond %{https}s ^on(s)| rewriterule ^ http%1://www.%{http_host}%{request_uri} [r=301,l] options +followsymlinks rewriteengine on rewritecond %{script_filename} !-d rewritecond %{script_filename} !-f rewriterule ^services(/)*$ ./services.php rewriterule ^contact(/)*$ ./contact.php rewriterule ^about(/)*$ ./about.php rewriterule ^work(/)*$ ./work.php rewriterule ^work/prima-healthcare(/)*$ ./my-work/primahc.php rewriterule ^work/medical-studies-europe(/)*$ ./my-work/mse.php rewriter...

javascript - HTML script src - Jquery library won't load from file -

i'm trying run socket.io example program offline. index.html page calls jquery library so: <script src="http://code.jquery.com/jquery-1.11.1.js"></script> however, won't load without internet connection. have tried using file in same folder rest of project: <script src="jquery-1.11.1.js"></script> but 404 error in developer menu when running well. i'm not sure if i'm putting file in wrong spot, or if i'm using script tag incorrectly, appreciated. edit: here full index.html file: <!doctype html> <html> <head> <title>socket.io chat</title> <style> * { margin: 0; padding: 0; box-sizing: border-box; } body { font: 13px helvetica, arial; } form { background: #000; padding: 3px; position: fixed; bottom: 0; width: 100%; } form input { border: 0; padding: 10px; width: 90%; margin-right: .5%; } form button { width: 9%; backgro...

blade - How to best get results from 3 different tables based on ID matches in Laravel. -

trying products , variants particular supplier. can products easy enough, can't figure out how best variants matching product_id , send view. variants.product_id matches product.id this works (getting products supplier) public function suppliers($id) { $supplier = supplier::orderby('company_name', 'asc')->find($id); $products = supplier::find($id)->products; $data = []; $data['supplier'] = $supplier; $data['products'] = $products; return view('admin.purchasing.supplier-details', $data); } i've tried variants without luck. controller: public function suppliers($id) { $supplier = supplier::orderby('company_name', 'asc')->find($id); $products = supplier::find($id)->products; $variants = array(); foreach ($products $product) { $product_id = $product->id; $variants[] = variant::find($product_id); } $data = []; $data['s...

mysql - How to get ranking of specific player? -

i have list of players. players sorted points. i'd know how ranking number of player? this code far (which doesn't work because seems have bugs): $rank = mysql_query (set @rank := 0; select *, @rank := @rank + 1 ava_users id = '".$id."' order points desc); $rank_res = mysql_fetch_array($rank); when try use query error message: mysql_fetch_array() expects parameter 1 resource, boolean given in /users/***/documents/arcades/arc_development/arc_projects/***/arc_dev_website/arc_offline/includes/profile/profile_main.inc.php any help, please? $rank = mysql_query ( "select a.*, ( select count(1) ava_users b (b.points, b.id) >= (a.points, a.id) ) rank ava_users a.`user` = '$id'" );

linux - How do I handle POST requests in Twisted? -

i'm trying write script can type name of website box , script render resources of website. i'm not sure how go it, i'm thinking this: class formpage(resource): isleaf = true def render_get(self, request): return b"""<html><body><form method="post"><input name="form-field" type="text"/><input type="submit" /></form></body></html>""" def render_post(self, request): answer = request.content.read()[11:].decode() reverseproxyresource(answer, 80, b'') factory = site(formpage()) reactor.listentcp(80, factory) reactor.run() this script isn't working, when script error: request did not return bytes . tell me i'm doing wrong or can learn more subject? thanks!! i haven't worked resources , site objects in while, i'm pretty sure have overload resource.getchild() method , return reverseproxyr...

java - How to change JavaFX TabPane pane type -

Image
i want make webview inside anchorpane controlled tabpane: here's tabpane hierarchy in this: i don't know how make webview fill entire area, , responsive @ same time. can change preferred size, don't know how make 100% fill pane. i'm brand new javafx, , using scene builder (i came swing). thank you! a tab size content node fill available space in tab (up max size). long leave max width , max height of web view defaults ( double.max_value ), can place web view directly in tab without using anchor pane, , sized full size of tab. here simple example: <?xml version="1.0" encoding="utf-8"?> <?import javafx.scene.web.*?> <?import java.lang.*?> <?import javafx.scene.control.*?> <?import javafx.scene.layout.*?> <?import javafx.scene.control.tabpane?> <tabpane xmlns="http://javafx.com/javafx/8.0.40" xmlns:fx="http://javafx.com/fxml/1"> <tabs> <tab text=...

phantomjs - Why does my Python subprocess error when managed by supervisord? -

i wrote small api screen captures - flask app passes capture requests casperjs using subprocess.popen in development on mac, , when run server in shell on production server ubuntu 13.04 - works great. when manage server supervisord, however, subprocess call returns error casperjs cannot find phantomjs (casper runs on phantom). the error thrown is: fatal: [errno 2] no such file or directory; did install phantomjs? the code open source. here subprocess call: https://github.com/pwalsh/moment/blob/master/moment/models.py#l215 here supervisor conf file server (i generate actual file fabric, should clear): https://github.com/pwalsh/moment/blob/master/fabfile/templates.py#l56 there 2 users on system - root, , app's user. when log on machine either of these users, can run dev server successfully, , can run phantomjs , casperjs successfully. why subprocess error supervisord? edit: adding code + stacktrace supervisord conf gunicorn server: ; generated via fabr...

appdelegate - Multiple App delegates with storyboard -

hello there everyone, i new ios development , trying understand app delegates , how work. i know fact once project created default app delegate.h/m generated. however, using current appdelegate setting core data, , need work on facebook integration in storyboard, looking @ code, can not use 1 method recall tasks, right? . do use both facebook integration , core in same appdelegate file? or create new appdelegate file , make facebook integration? , if yes, how create new appdelegate? any links tutorials? because not know if can use 2 different view controllers same method: - (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions note using sotryboard no xib try these sites; cannot guarantee find looking for, fellow person working way through app development, i'm sure know how important patiently , thoroughly analyze helpful material. https://developer.apple.com/library/ios/documentation/iphone/concep...

firebase - AngularFire 2.0 $firebaseAuth(ref); - TypeError: a.onAuthStateChanged is not a function -

using angularfire 2.0 , calling following code: app.factory("auth", ["$firebaseauth" , "servername", function($firebaseauth, servername) { var ref = firebase.database().ref(); var auth = $firebaseauth(ref); return auth; } ]); i following message: angular.js:13550 typeerror: a.onauthstatechanged not function @ angularfire.min.js:12 @ object.n [as promise] (angular.js:16225) @ object.a._initauthresolver (angularfire.min.js:12) @ object.a (angularfire.min.js:12) @ angularfire.min.js:12 @ object.<anonymous> (default.js:6) @ object.invoke (angular.js:4665) @ object.$get (angular.js:4504) @ object.invoke (angular.js:4665) @ angular.js:4464 at : var auth = $firebaseauth(ref); i using latest sdk's stated here: https://github.com/firebase/angularfire/blob/master/docs/quickstart.md i've tried var auth = $firebaseauth(); and worked me. (note $firebaseauth...

java - Adding column with header and data to the MyTableModel -

i created class mytablemodel extends defaulttablemodel. , want is, have initialized 3 columns data. inside constructor of mytablemodel set header/data values calling this.addcolumn("first col", first_col_values); exception "exception in thread "main" java.lang.arrayindexoutofboundsexception: 0 >= 0", how fix this? public mytablemodel () { // code below tried far fix exception //super(input_row_count, 1); // next 3 lines, expect work, instead exception //this.addcolumn("first column", first_col_values); //this.addcolumn("second column", second_col_values); //this.addcolumn("third column", third_col_values); //tablecolumn column = new tablecolumn(); //column.setmodelindex(0); //column.setheadervalue("string value"); //this.addcolumn(column); } update: public class main { public ma...

python - How to use redirect with parameter in Django? -

i have function in views.py: def detel_kar(request, id): detel = {} detel['detels'] = dippegawai.objects.filter(pegid=id) detel['kels']=dipkeluargapeg.objects.filter(pegid_id=id) return render(request, 'karyawan/detel_kar.html', detel) i have function insert data parameter id getting primary key elsewhere. def tambah_kel(request, id): kar = dippegawai.objects.get(pegid=id) if request.method == "post": kel=dipkeluargapeg(pegid=kar) form = datakeluarga(request.post,instance=kel) if form.is_valid(): form.save(commit=true) return redirect('detel_kar') else: form = datakeluarga() return render(request, 'karyawan/tambah_kel.html', {'form': form, 'kars': kar}) how redirect detel_kar view? if use code in tambah_kel function return redirect('detel_kar') it return anerror reverse 'detel_kar' arguments '()' , keywor...

How do I generate models for an existing database in Django? -

i have existing database i'd use django. can create models based on existing tables? this documented on django website: https://docs.djangoproject.com/en/1.9/howto/legacy-databases/ $ python manage.py inspectdb

ios - UIPageViewController programmatically allow datasource to be called -

i have uipageviewcontroller displays images transition style scroll . want handle tap , pan gestures in order that, did little hack of putting view on top of uipageviewcontroller , assign tap , pan gesture recognizers. in case, use -setviewcontrollers:direction:animated:completion: perform swipes when detect pan gestures left or right. my problem when using -setviewcontrollers:direction:animated:completion: datasource methods viewcontrollerbeforeviewcontroller , viewcontrollerafterviewcontroller doesn't called. delegate method -pageviewcontroller:didfinishanimating:previousviewcontrollers:transitioncompleted: doesnt callled. what have these methods called using setviewcontrollers ? think can uipagecontroller's gesture recognisers , , use them disable or enable uipagecontroller interaction using method of uigesturerecogniser : - (void)requiregesturerecognizertofail:(uigesturerecognizer *)othergesturerecognizer if use setviewcontrollers... m...

javascript - event to associate with div -

i have mvc application in getting results webservice , assigning model property. want pass result in javascript function , display alerts. have code in javascript can't find particular event associate div when page displays, should trigger alert (i have tried div onload). reason can't attach page or other thing except div that, it's partial view div's being loaded/unloaded on click of every menu item. need help. javascript myobject.showverificationstatus = function (verificationstatus) { alert("status: " + verificationstatus); }; view code @if (model.hasanyvalue) { var verstatus = model.clientverificationstatus != null ? ((verificationstatuss)model.clientverificationstatus).tostring().toupper() : null; <div id="divverificationstatus" class="divdetail_sectiontitle" onload="object.myobject.showverificationstatus(@verstatus)"></div> } just use document.ready on page. remove onload ...

three.js - Object with a higher renderOrder being clipped by rotated element -

a rotated object (cylinder in case) cuts off objects (a triangle made lines in case) though renderorder of second object higher. see this jsfiddle demo effect. the triangle should rendered on top of cylinder cut off outside of cylinder intersects it. it's easier understand what's happening when texture used, jsfiddle bad @ using external images. var mesh, renderer, scene, camera, controls; init(); animate(); function init() { renderer = new three.webglrenderer({ antialias: true, preservedrawingbuffer: true }); renderer.setclearcolor(0x24132e, 1); renderer.setsize(window.innerwidth, window.innerheight); document.body.appendchild(renderer.domelement); scene = new three.scene(); camera = new three.perspectivecamera(40, window.innerwidth / window.innerheight, 0.1, 10000); camera.position.set(0, 0, 7); camera.lookat(scene.position) scene.add(camera); var geometry = new three.cylindergeometry(1, 1, 100, 32, 1, true); var material = ne...

jquery - Determine clicked child whilst it's parent has it's own click listener -

Image
i have multiple accordion widgets on page. to elaborate on how it's setup the green heading shown in image below, handle jquery ui sortable the green heading has click listener collapses/expands accordion. the edit button has it's own click listener when fired intended fire listener collapse accordion is possible actual element clicked can check not edit/save/discard etc buttons? my accordion js is: this.accordion = function () { var element = $('.accordion > .panel-heading'); element.on('click', function () { var self = $(this); if (self.hasclass('open')) { self.parent().find('.panel-body').stop().slideup(); self.find('.fa-caret-down').removeclass('fa-caret-down').addclass('fa-caret-up') self.removeclass('open'); return; } self.addclass('open'); self.find('.fa-caret-up').removeclas...

PhantomJS rewriting URL in backgroundImage property to local file system -

i using phantomjs rewriting of html. i'm adding background-image property element. when write out resulting dom, url has been rewritten local url. i've boiled down following test case: js var page = require('webpage').create(); page.open("test.html",function(){ settimeout(function(){ page.evaluate(function(){ document.getelementbyid("test").style.backgroundimage="url(test.png)"; }); console.log(page.content); phantom.exit(); },1000); }); html <html> <body> <div id="test"></div> </body> </html> output $ phantomjs test.js <html><head></head><body> <div id="test" style="background-image: url(file:///c:/cygwin/tmp/test.png); "> </div> </body></html> update the problem remains if specify ./test.png or //test.png . however, http://examp...

php - exporting large files in separate sheets Laravel Maatwebsite -

i have 50,000 raw. want export them system fails export it. using code. there better solution this? excel::create('catalogdumptreport', function ($excel) use ($finalarray) { $excel->sheet('catalogdumptreport', function ($sheet) use ($finalarray) { $sheet->fromarray($finalarray); $sheet->setfontfamily('verdana'); $sheet->setfontsize(10); $sheet->row(1, function ($row) { $row->setfontweight('bold'); }); $sheet->setborder('a1', 'thin'); $sheet->setheight(1, 20); }); })->export('xls') ->download('xls'); personally, advise against expoting such large xls files (directly in browser). best way (and fastest) export in background (such async laravel queue etc.). there 2 computational complexity problem: time complexity - grows fast means time download in ...

java - My code is retrieving data only from first field of my database. Please see details -

Image
i have written code retrieves` data firebase database. the problem code retrieving data first field of data in database , not fields. i want retrieve data each , every field of database. here's code: retrieveref = new firebase("https://appname.firebaseio.com/hdetails/"); retrieveref.addchildeventlistener(new childeventlistener() { @override public void onchildadded(datasnapshot datasnapshot, string s) { hdescription = (string) datasnapshot.child("hdescription").getvalue(); himage = (string) datasnapshot.child("himage").getvalue(); hlat = (string) datasnapshot.child("hlat").getvalue(); hlng = (string) datasnapshot.child("hlng").getvalue(); postedattime = (string) datasnapshot.child("postedattime").getvalue(); postedby = (string) datasnapshot.child("postedby").getvalue(); postedondate = (string) datasnapshot.child("postedondate")...

node.js - How to export csv nodejs -

hey trying export csv node.js (pulling data mongodb). have data being pulled , separated commas , all, trying figure out how send it... sticking code in routes file. advice on how take array of data , send user straight download on request. here code: (i attempted the bottom part of code second function) exports.downloadcontacts = function(req, res) { async.waterfall([ function(callback) { var source = []; friend.find({userid: req.signedcookies.userid}, function(err, friends) { if(err) {console.log('err friends download'); } else { var usermap = {}; var friendids = friends.map(function (user) { usermap[user.friend_id] = user; return user.friend_id; }); console.log(friends); user.find({_id: {$in: friendids}}, function(err, users) { if(...

bootstrap 3 navbar active li background -

i have bootstrap navbar in this fiddle , dropdown visible on hover mouse as $('.navbar .dropdown').hover(function () { $(this).find('.dropdown-menu').first().stop(true, true).slidedown(300); }, function () { $(this).find('.dropdown-menu').first().stop(true, true).slideup(180) }); but how make parent li background still active when mouseover down dropdown menu similar 1 without sliding . you can add class open on-hover , remove on mouse leave. see below example, $(document).ready(function() { $('.navbar .dropdown').hover(function() { $(this).addclass('open'); }, function() { $(this).removeclass('open'); }); }); <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <script src="https://getbootstrap.com/dist/js/bootstrap.min.js"></script> <link href="http...

c# - Set Window owner inside of an UserControl in WPF -

i have usercontrol shows window without icon in taskbar, problem when main window lost focus , again window without taskbar icon behind main window , difficult show in front again, issue solved using window.owner = this; when class window, when usercontrol or other type (e.g. listboxitem , viewbox ) can't this. tried control.owner = (window)this; result throws exception grid cannot converted window use window.owner = window.getwindow(this);

javascript - How to convert a GET request to POST -

i don't know if possible or not. referred site, didn't exact answer. i using <a href="xyz?id=4"> click </a> when send request server in response page can see "id=4" in address bar, not secure, in post request cant see this. so can convert request post or ant other way there hide address bar. thanks in advance. <a href="#" onclick="postform()"> click </a> dynamically create , post it. function postform() { var form = $('<form method="post" action="xyz"></form>'); $(document.body).append(form); form.append('<input type="hidden" name="id" value="4"/>'); form.submit(); } as racil suggested in comments, can following <a href="#" id="postlink"> click </a> and then $('#postlink').click(function(e){ e.preventdefault(); //create form , post });

android - how to hide fragment(in FrameLayout) and show viewpager fragment? -

i having activity contains viewpager,tablayout , navigationdrawer. navigation drawer contains items(say 10). got framelayout load fragments when navigation drawer items clicked. here in viewpager got 3 fragments(say breakfast,lunch,dinner). in navigation drawer list items got same items in viewpager. now when click first 3 items viewpager fragments works fine.after clicking fourth item in drawer(i.e check calories) check calories fragment of framelayout loaded successfully.now when click breakfast,lunch or dinner item,the viewpager fragment not loading replacing framelayout fragment. come solution. here code public class homescreen extends appcompatactivity { tablayout tablayout; viewpager viewpager; relativelayout menunavigation, menuimagelayout; drawerlayout mdrawerlayout; navigationlistitemadapter navigationlistitemadapter; listview mdrawerlist; imageview homepagemenu, locationimage; de.hdodenhof.circleimageview.circleimageview profileimage; button checkout; textview t...