Posts

Showing posts from February, 2010

ios - In Memory String compression in Swift 2 -

i have long string i'd compress within memory write file later. isn't there lib available use in swift (2) works on both ios 8 , 9? you can use zlib. here an example .

php - Laravel Multi-language Support -

i trying website support multiple languages, code not work: route: route::get('lang/{lang}', function($lang){ session::put('lang', $lang); return redirect::to('/'); }); main page: <a href="{{ url::to('lang/fa') }}">[farsi]</a> <a href="{{ url::to('lang/en') }}">[english]</a> language folders: fa folder have messages.php : return array( 'mainpage'=>'صفحه اصلی', ); en folder have messages.php : return array( 'mainpage'=>'main page`, ); now trying use array have multi-language support , using code switch between languages: {{ lang::get('messages.mainpage') }} problem solved, @rezakho, after adding line route.php : if ( session::has('lang') ) { app::setlocale(session::get('lang')); } or change before on filters.php file: app::before(function($request) { if ( session::has(&

Installing Cloudify From PyPI - ERROR -

i following link http://getcloudify.org/guide/3.2/installation.html#installing-from-pypi , when running command "sudo pip install cloudify==3.2", error occurs below: ... checking uint8_t... yes checking stdlib.h... (cached) yes checking gnu libc compatible malloc... yes checking memmove... yes checking memset... yes configure: creating ./config.status config.status: creating src/config.h warning: gmp or mpir library not found; not building crypto.publickey._fastmath. building 'crypto.hash._md2' extension creating build/temp.linux-x86_64-2.7 creating build/temp.linux-x86_64-2.7/src x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -fwrapv -wall -wstrict-prototypes -fpic -std=c99 -o3 -fomit-frame-pointer -isrc/ -i/usr/include/python2.7 -c src/md2.c -o build/temp.linux-x86_64-2.7/src/md2.o src/md2.c:31:20: fatal error: python.h: no such file or directory #include "python.h"

android - Get all videos of a YouTube Playlist in Java -

context i'm working android studio (java). want obtain videos of given playlist (or 50, other after). problem see people using url https://www.googleapis.com/youtube/v3/playlistitems?part=snippet&maxresults=50&playlistid=pliewzfngb4fvrrztonlvemj6db2nmzg2m&key=aizasyc2_yrcte9916fsma0_krnef43gblzz8m0 don't know how implement in java. follow tuto , got way information totally different : youtube.search.list query; query = youtube.search().list("id,snippet"); query.setkey(my_api_key); query.setmaxresults((long)20); query.settype("video"); query.setfields("items(id/videoid,snippet/title,snippet/description,snippet/thumbnails/default/url)"); and don't understand how else search. of documentation in english only... edit ok, continued try, think got near solution, got error. private youtube youtube; private youtube.playlistitems.list playlistitemrequest; private string playlist_id = "pliewzfn

java - Why is casting not working here as I expect? -

this question has answer here: is list<dog> subclass of list<animal>? why aren't java's generics implicitly polymorphic? 12 answers here sample code: public class bar extends foo { } @suppresswarnings("unchecked") public class foo { public static void main(string[] args) { foo foo = new bar(); class<foo> x = (class<foo>) foo.getclass(); system.out.println(x); } } well expecting programs output be: foo.class since casting class see in output: class bar why? if remove casting part code, program not compile: java: incompatible types required: java.lang.class<foo> found: java.lang.class<capture#1 of ? extends foo> why compiler forcing me cast? why? because class of object bar , not foo (you created object new bar() ), , you've explicitly asked the

r - Space between gpplot2 horizontal legend elements -

Image
i have ggplot2 plot follows: library(ggplot2) ggplot(mtcars, aes(factor(cyl), fill=factor(cyl))) + geom_bar() + coord_flip() + theme(legend.position = 'top') + guides(fill = guide_legend(title=null)) i'd add spacing between fill elements follows: it seems theme(legend.text = element_text(margin = margin(r = 2, unit = 'in'))) right way accomplish task, doesn't @ all. instead, (and not first time) fall on microsoft word style of alignment-hacking, i.e. add spaces: ggplot(mtcars, aes(factor(cyl), fill=factor(paste(cyl, ' ')))) + geom_bar() + coord_flip() + theme(legend.position = 'top') + guides(fill = guide_legend(title=null)) because there's spaces on 8 well, it's little off-center, if paste them onto previous labels can nudge them around like. apologies nightmares caused graphic designers.

android - ADB : unable to connect to 192.168.1.10:5555 -

i cannot use adb connect connect via wifi device (nexus 5, android 6), since i'm developping cordova plugin using usb otg, need connect via wifi. i tried adb kill-server , , solutions provided on so, , noone working me... before working ok (i.e android 5). any idea? i had same issue since android 6 upgrading. noticed reason device playing "hard get" when try contact on wifi. try these following stpes: make sure aggressive wi-fi cellular handover under networking section in device's developer options tured off. ping continously pc device make sure it's not in network idle mode ping -t 192.168.1.10 (windows cmd), unlock device , try surf website make out of network idle. when replies ping, connect via usb, and: adb usb adb tcpip 5555 adb connect 192.168.10.1:5555 in casr it's still not connected, try switch usb connection mode mtp / ptp / camera while device connected through usb , repeat these steps on again...

android - Translation Editor doesn't show strings from library projects -

Image
i'm using several library projects in main android application. when open translation editor in android studio application shows strings main project, not library projects (see scheenshot). is there way force translation editor show strings? the answer simple, no obvious me. the translation editor show strings project, open it. since can open xml layout file project a, launch translation editor it. open xml layout project b , launch translation editor also. there 2 editor views opened. , on. here screen i've received. hope someone, because can't find similar in net.

Cordova - Android, push notifications to lock screen? -

i'm working on app sends push notifications users... nothing special that. special is, client wishes push notifications sent lock screen, , not status bar. i know it's feature of lollipop 5.0, have friend old 4.2 android , receives push notifications app lock screen somehow. i heard have androidmanifest.xml file notifications permissions , android's window manager, haven't found nothing on it. i'll appreciate assistance or words of advice regarding it, maybe there's way cordova enable it, or maybe don't understand android developing enough... much help! i have friend old 4.2 android , receives push notifications app lock screen somehow either has custom rom installed offers lockscreen notifications, or device manufacturer implemented equivalent of lockscreen notifications. there no means you, app developer, put notifications on lockscreen prior android 5.0. you can implement lockscreen app widget (in java, not via cordova) ,

cordova - My Ionic application crashes on start on an android emulator -

i'm trying emulate ionic app on android emulator. here's did: 1) built app ionic build android 2) ran on emulator ionic emulate android , installing apk through adb install my app shows on emulator, when launch it, crashes on start error message says "unfortunately, xxxx has stopped working." i ran adb logcat . following result: --------- beginning of crash 07-15 17:58:22.650 2145 2214 f libc : fatal signal 6 (sigabrt), code -6 in tid 2214 (gputhread) 07-15 17:58:22.765 950 950 selinux : selinux: loaded file_contexts contexts /file_contexts. 07-15 17:58:22.765 950 950 f debug : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 07-15 17:58:22.765 950 950 f debug : build fingerprint: 'android/sdk_phone_x86/generic_x86:6.0/master/2780065:userdebug/test-keys' 07-15 17:58:22.765 950 950 f debug : revision: '0' 07-15 17:58:22.765 950 950 f debug : abi: 'x86' 07-15 17:58:22.765 950 950 f

r - Filter Data Range based on User Input -

i have shiny app plots 2 variables in scatter plot , filters based on user input. trying user can filter data based on range specify. however, want filter applied if field filled out, , return data if field empty (null). example, if launch code have attached, want user able check specify data ranges checkbox , when put in 4.8 in min x input box, data filtered out no data points less 4.8 considered. sample code have prepared below attempt @ i'm trying commented out near middle. #check packages use in library { library('shiny') #allows shiny app used library('ggvis') #allows interactive ploting } alldata <- iris #establish options drop down menus { specieschoices <- unique(as.character(alldata$species)) } # ui ui<-fluidpage( titlepanel("explorer"), fluidrow( column(4, wellpanel( h4("apply filters"), selectinput(inputid = "species", label="select species:", choices = sort(specieschoice

A_inverse*A=Identity Matrix in Octave? -

this question has answer here: why output of inv() , pinv() not equal in matlab , octave? 3 answers if nxn matrix, in octave, pinv(a) represent inverse of a. pinv(a)*a should yield identity matrix i(n). following code not working. a=[ 1 2 3, 4 5 6, 7 8 9]; pinv(a)*a 0.83333 0.33333 -0.16667 0.33333 0.33333 0.33333 -0.16667 0.33333 0.83333 the diagonal elements , (pinv(a)*(a))[i,i] i=1,2,3 not near one.what went wrong? try use inv(a) function , useful information: >> inv(a) warning: matrix singular machine precision, rcond = 1.54198e-018 matrix not invertible! singular. try change matrix a: >> a=[ 10 2 3; 4 5 6; 7 8 9] = 10 2 3 4 5 6 7 8 9 >> inv(a)*a ans = 1.00000 0.00000 0.00000 -0.00000 1.00000 0.00000 0.00000 0.00000 1.00000 >> pinv(a)*a ans = 1.0000e+000 -2.2204e-016 -4

php - How to implement time ago like facebook -

can explain me concept of implementing time ago facebook in php. dont want code. want know flow database field type, whether use utc time stamp , convert local time. thanks it users location. if have users @ single timezone , no need of conversion. if users @ different time zones , require conversion. in second scenario, covert , save time in db utc , according each user location, convert time during fetch.

javascript - Marker locations accumilate when adding a marker on a previously created Layer in Leaflet using MarkerClusterGroup -

Image
i want add layer on top of google maps contains indoor map. , add incoming events contains latitudes , longitudes markers on layer contains indoor map. as managed add layer on top of google map var imagebounds = new l.latlngbounds([p, q], [r, s]); var imageurl = 'assets/img/indoor.svg'; indoormap = l.imageoverlay(imageurl, imagebounds, {opacity: 0.7}); layergroupindoor = new l.markerclustergroup(); var overlay = {'beacons': layergroupindoor}; layergroupindoor.addlayer(indoormap); layergroupindoorcontrol = l.control.layers(null, overlay).addto(map); then added markers dynamically layergroupindoor follows. layergroupindoor.addlayer(markerobject); but when marker locations nearby (eg: 2 markers nearby) leaflet gives new averaged location shown below. any suggestion visualize markers is? best regards, i refer read me [1] , made following change , got un-cluster @ zoom level layergroupindoor = new l.markerclustergroup({ disableclusteringatzo

php - background picture alignment -

Image
my background picture alignment seem not right. bottom part seems cut off. how background picture align middle. body { background-image: url('<?php echo $backgroundpic;?>'); background-repeat:no-repeat; background-position:center; background-attachment:fixed; width: 100%; height: 100%; } all need add background-size , set cover body { background-image: url('http://i.stack.imgur.com/ewfou.jpg'); background-repeat:no-repeat; background-position:center; background-size:cover;//answer background-attachment:fixed; width: 100%; height: 100%; } hope you.

c++ - I inherit from std::iterator, but compiler does not recognise 'pointer' or 'reference' -

i in process of making custom iterator, puzzled on makes compiler not recognise pointer or reference typedefs in case of templated iterator implementation. the following code compiles fine: #include <iterator> struct : std::iterator<std::random_access_iterator_tag, int> { int *v; pointer operator-> () { return v; } reference operator* () { return *v; } }; but once templatize custom iterator errors: #include <iterator> template <class t> struct it2 : std::iterator<std::random_access_iterator_tag, t> { t *v; pointer operator-> () { return v; } reference operator* () { return *v; } }; whole code here error: 'pointer' not name type note: (perhaps 'typename std::iterator<std::random_access_iterator_tag, t>::pointer' intended) error: 'reference' not name type ... 1> why can't compiler see pointer , reference definitions contained in std::iterator ? according note , se

ms access - Operation Not Supported on Linked Table -

when function below executes '.append fld' produces error 3057. suspect qualified name needed method escaping me. sub calling function passing way of strtablename "tbl_elements" should not enough function. i have tried fitting bit of code has reached linked table. currentdb.execute "alter table [" & currentdb.tabledefs(strimportholdingtable).connect & "].[" & strimportholdingtable & "] drop column romis_tran_id;" function in question below public function createautonumberfield(byval strtablename string, byval strfieldname string) boolean on error goto err_createautonumberfield dim db dao.database dim fld dao.field dim tdef dao.tabledef set db = application.currentdb set tdef = db.tabledefs(strtablename) set fld = tdef.createfield(strfieldname, dblong) fld .attributes = .attributes or dbautoincrfield end tdef.fields .append fld .refresh end

Python printing list in columns -

this question has answer here: how print list more nicely? 14 answers how can print in python values list in columns? i sorted them, don't know how print them in 2 ways instance: list=['apricot','banana','apple','car','coconut','baloon','bubble'] first one: apricot bubble ... apple car baloon coconut second way: apricot apple baloon bubble car coconut i want align ljust/rjust. i tried this: print " ".join(word.ljust(8) word in list) but displays in first example. don't know if proper way this. the_list = ['apricot','banana','apple','car','coconut','baloon','bubble'] num_columns = 3 count, item in enumerate(sorted(the_list), 1): print item.ljust(10), if

android - jpm-mobile fails with ReferenceError: cmd is not defined -

here stacktrace shown: $ /tmp/node_modules/jpm-mobile/bin/jpm-mobile init /tmp/node_modules/jpm-mobile/bin/jpm-mobile:50 if (cmd.isemptycommand(program)) { ^ referenceerror: cmd not defined @ object.<anonymous> (/tmp/node_modules/jpm-mobile/bin/jpm-mobile:50:5) @ module._compile (module.js:456:26) @ object.module._extensions..js (module.js:474:10) @ module.load (module.js:356:32) @ function.module._load (module.js:312:12) @ function.module.runmain (module.js:497:10) @ startup (node.js:119:16) @ node.js:902:3 npm list shows jpm-mobile installed. this bug in jpm-mobile , solution can found in pull request .

ios - UITableView not refreshing on reloadData -

note: have read similar questions, none of answered question specifically. have been trying understand why uitableview not refreshing when data pieces added list. checked (through print() statements) , everytime call tableview.reloaddata() , checks length of array use, , nothing there. tried using function instead: func refreshui() { dispatch_async(dispatch_get_main_queue(),{ self.tableview.reloaddata() }); } which found on answered question, did not fix situation. problem override func tableview(tableview: uitableview, cellforrowatindexpath indexpath: nsindexpath) -> uitableviewcell {} never getting called, though override func tableview(tableview: uitableview, numberofrowsinsection section: int) -> int {} is returning non-zero number when should. code new info added list , should displayed: self.firebase.observeeventtype(.value, withblock: { (snap) in print("\n\n\n\n\n\nsnap recieved firebase: \n\n\(snap)\n\n")

javascript - How to set fixed auto width in tab-content bootstrap? -

Image
i have search box forms using bootstrap css included several columns based on category selection. first add columns in same line , set auto width them accordingly .col-lg-12 { width: 100%; } .col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12 { float: left; } .col-md-6 { width: 50%; } .col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12 { float: left; } .form-group { margin-bottom: 15px; } .tab-content { position: relative; } <div class="tab-content"> <form style="margin-top:-20px" method="get" action=""> <div class="col-xs-12 col-md-12 col-lg-12 col-sm-12 go-right"> <div class="form-group"> <img src="http://elizavetababanova.com/wp-content/uploads/2015/0

ios - Swift - How to check a value in parse and return it -

so yeah i'm new swift, , i'm developing ios application final project problem follows: the app ask user when he/she sign specify gender male/female, value stored in user class in parse under column named "gender". in app, males , females not have same menu , interface. based on that, want check when user login wether he/she male or female , redirect each 1 related interface. i couldn't figure out right query that, appreciated. thank you try this: if let user = pfuser.currentuser() { let gender = user.objectforkey("gender") as! string }

php - Codeigniter :Parsing array data in view -

i trying fetch posts data , past view using controller $data['data']=$this->home->fetch_all_posts($this->news); $this->load->view('home',$data); in view when print_r($data) array ( [0] => array ( [post] => stdclass object ( [id] => 65 [date] => 2016-07-08 [title] => title of news [content] => content of news [type] => news ) [attachments] => stdclass object ( [id] => 2 [attachment_id] => 65 [type] => news [path] => c:/wamp/www/school/ci/images/jellyfish22.jpg ) ) ) now when try foreach , print not work , please helo how can print these values codeiginiter turn values of $data it's own variables. $data[

c++ - Do I need to include the lib file in my final release when building an EXE and a DLL? -

i understand *.lib file used linker map dll entry points executable. however, once executable ( *.exe ) has been built, lib file need included in installer customer? no doesn't. need dll.

Javascript replace regex don't work -

this question has answer here: regular expression [allchars] 1 answer i have problem regexp replace html code in string. had tried online regexp tester match, causes canť replace. ${productean} want replace. idea wrong? the string here: <label for="productean" id="productean" class="col-sm-3 control-label">${productean}</label> javascript code: let strtoreplace = 'productean'; let reg = new regexp('/(\$\{'+strtoreplace+'\})/','g') str.replace(reg,'some text'); the regexp constructor doesn't need slashes ( /.../ ) around expression, regex literals. , when backslash-escape characters, escaped in string passed constructor, pass unescaped actual regex expression. need double-escaped. so, change line this: let reg = new regexp('\\$\\{'+strtoreplace+

Memory error Using intertool in python -

i write programme input 10 example , find odd number first , number , put them in list [1,3,5,7,9,2,4,6,8,10] , input number choose number in list example 3 print 5 , on write code from itertools import count n,y=map(int, raw_input().split()) # input 2 numbers listaa=[0,] # list save x in count(1,1): if x%2!=0: listaa.append(x) if x==n: break h in count(1,1): if h%2==0: listaa.append(h) if h==n: break res=listaa[y] print res # print number in array or list but when submit code on online judge try number 1000000000000 500000000001 runtime_error try on eclipse memory error note first try xrange error when search found generator try , use count instead of xrange note run time limit each test case 1 second you cannot solve problem using approach because list big time limit test case suggested 1000000000000 500000000001 contains approximately 4*10^12 numbers needs more terabyte of ram. don't use list use math formula instead. s

python - SQLAlchemy Migrate - Can I add (or modify) a column to a certain position of an existing table? -

i want add column position of existing table or move 1 of columns. can't find method in sqlalchemy-migrate. i want know methods equivalent following mysql queries in sqlalchemy-migrate alter table tablename add column_name2 int after column_name1 alter table tablename add column_name2 int first alter table tablename modify column column_name2 int after column_name1; you need follow below steps: create temp table, copy records in temp table rename temp original table. during alter operation flow well, these operation executed internally.

javascript - AngularJS injector problems -

i'm having [$injector:unpr] error in angularjs application. i've looked @ link error provides me in order fix problem, sadly didn't change anything. hoping guys might able see have done wrong. first error browser console error: [$injector:unpr] http://errors.angularjs.org/1.4.7/$injector/unpr?p0=configprovider%20%3c-%20config%20%3c-%20navcontroller @ error (native) @ http://localhost:8080/simplanner/lib/angular-1.4.7/angular.min.js:6:416 @ http://localhost:8080/simplanner/lib/angular-1.4.7/angular.min.js:40:409 @ object.d [as get] (http://localhost:8080/simplanner/lib/angular-1.4.7/angular.min.js:38:394) @ http://localhost:8080/simplanner/lib/angular-1.4.7/angular.min.js:40:483 @ d (http://localhost:8080/simplanner/lib/angular-1.4.7/angular.min.js:38:394) @ object.e [as invoke] (http://localhost:8080/simplanner/lib/angular-1.4.7/angular.min.js:39:161) @ p.instance (http://localhost:8080/simplanner/lib/angular-1.4.7/angular.min.js:

c++ - Double free or corruption, why does this appear? -

i've finished smart pointer (i know...) uploaded univerity's website runs number of automated tests on code. there 2 things wrong number of tests: memory or time limit exceeded memory access problem (ie. null pointer) the thing don't know kind of tests being excecuted. able read automated tests' stdout did, written there: in instantiation of ‘my_pointer<t>::my_pointer() [with t = tester]’: error: no matching function call ‘tester::tester()’ note: candidates are: tester::tester(my_pointer<tester>) candidate expects 1 argument, 0 provided tester::tester(const tester&) candidate expects 1 argument, 0 provided so i'm guessing odd reason won't invoke my_pointer() constructor? smart pointer class: template<class t> class my_pointer { t* raw_pointer; public: my_pointer() { raw_pointer = new t(); raw_pointer->increfcnt(); } my_pointer(t *obj) : raw_pointer(obj) { if(raw_pointer != null)

java - meaning of pool number in default name of thread in ScheduledExecutorService -

i using scheduledexecutorservice maintain thread pool of core size 10 scheduledexecutorservice visiblitythreadpool = executors.newscheduledthreadpool(10); now in log see thredname pool-39-thread-3 . i ok thread number 3 assuming thread number can vary 1 10 how come pool number in name in 39 ? what 39 indicates here ? please put light on it. that string name prefix thread objects initialized java.util.concurrent.executors$defaultthreadfactory . the source code of class looks like /** * default thread factory */ static class defaultthreadfactory implements threadfactory { private static final atomicinteger poolnumber = new atomicinteger(1); private final threadgroup group; private final atomicinteger threadnumber = new atomicinteger(1); private final string nameprefix; defaultthreadfactory() { securitymanager s = system.getsecuritymanager(); group = (s != null) ? s.getthreadgroup() : th

gremlin - Titan 1.0.0 TitanFactory.open() Hook creation trace error(?) -

i'm trying out titan 1.0.0 cassandra 2.1.2. i keep getting long debug trace , strange error gremlin when opening graph (using titanfactroy.open()): ... 17:54:36.551 [main] debug c.t.t.g.database.standardtitangraph - installed shutdown hook thread[thread-3,5,main] java.lang.throwable: hook creation trace @ com.thinkaurelius.titan.graphdb.database.standardtitangraph.(standardtitangraph.java:156) [titan-core-1.0.0.jar:na] @ com.thinkaurelius.titan.core.titanfactory.open(titanfactory.java:94) [titan-core-1.0.0.jar:na] @ com.thinkaurelius.titan.core.titanfactory.open(titanfactory.java:74) [titan-core-1.0.0.jar:na] @ com.ibm.titantest.graph.writetograph.main(writetograph.java:27) [classes/:na] 17:54:36.646 [pool-19-thread-1] debug c.t.t.diskstorage.log.kcvs.kcvslog - messagepuller configured readmarker timestamp ahead of read lag time; waiting clock catch 17:54:41.650 [pool-19-thread-1] debug c.t.t.d.c.cassandratransaction - created cassandratransaction@6e234a4a[read=

powershell - Filtering Get-aduser on csv contents -

i have csv formatted like ln,fn jones,bob jagger,mick and trying mail attribute out of ad these users running following: $names = import-csv .\names4.csv foreach ($name in $names){ get-aduser -f {surname -eq "$name.ln" -and givenname -eq "$name.fn} -pr mail } this returns nothing @ all. if echo $name.ln shows list of users first names csv unsure why above command not returning results. inside context of expandable string (ie. in double-quotes), powershell parser expands references . - remove "" quotes: $names = import-csv .\names4.csv foreach($name in $names){ get-aduser -filter {surname -eq $name.ln -and givenname -eq $name.fn} -properties mail } alternatively, assign each property value it's own variable: $names = import-csv .\names4.csv foreach($name in $names){ $sn = $name.ln $gn = $name.fn get-aduser -filter {surname -eq $sn -and givenname -eq $gn} -properties mail } in other situation need dereference

ELKI DBSCAN LngLatDistanceFunction producing one cluster -

i'm using elki lnglatdistancefunction cluster lon/lat points it's returning 1 cluster (was returning more clusters when used euclid distance). tried multiple epsilon values i'm still getting 1 cluster. int minpts=20; double eps=10; listparameterization params = new listparameterization(); params.addparameter(dbscan.distance_function_id, lnglatdistancefunction.class); params.addparameter(dbscan.parameterizer.minpts_id, minpts); params.addparameter(dbscan.parameterizer.epsilon_id, eps); params.addparameter(abstractdatabase.parameterizer.database_connection_id, dbcon); params.addparameter(abstractdatabase.parameterizer.index_id, rstartreefactory.class); params.addparameter(rstartreefactory.parameterizer.bulk_split_id, sorttilerecursivebulksplit.class); params.addparameter(abstractpagefilefactory.parameterizer.page_size_id, 600); database db = classgenericsutil.parameterizeorabort(staticarraydatabase.class, params); db.ini

php - saving the pdf using phpexcel terminate the rest of the script -

the echo statement not running , below script not running header("http/1.1 200 ok"); header("pragma: public"); header("cache-control: must-revalidate, post-check=0, pre-check=0"); header("cache-control: private", false); header('content-type: application/pdf'); header('content-disposition: attachment;filename="rename.pdf"'); //tell browser what's file name header('cache-control: max-age=0'); //no cache $objwriter = phpexcel_iofactory::createwriter($objphpexcel, 'pdf'); $objwriter->setsheetindex($i); $objwriter->save('php://output'); echo "this not diplaying"; //code terminated don't echo when you're sending data php://output file headers.... echo sends data php://output ..... you're doing writ

php - Form with Bootstrap+Tabs not send all item on POST event. Only first tab work fine -

i'm working on laravel 4.2 + blade. when send form post, , capture exit dd(item:all) first 5 elements of form $var. after load page edit settings, laravel , blade show code. think it's correct. <form method="post" action="http://fqdn.com/settings" accept-charset="utf-8" novalidate="novalidate" class="form-horizontal" id="formsettings"><input name="_token" type="hidden" value="iflxf11zf8afgfqszjyobgmizqvlxprsel8n6ffk"> <div class="tab-content"> <!-- tab storage --> <div role="tabpanel" class="tab-pane active" id="storage"> <div class="col-sm-12"> <div>&nbsp;</div> <!-- option remote --> <div class="form-group" id="groupremote"> <div class="form-group ">

java - Hibernate Criteria could not resolve property when it's there -

this 1 has me stumped. have idea how criteria works reason query giving me issues not being able find property when it's there. shelf.java @entity @table(name="bookshelf") public class shelf { @id private int shelfid; private string shelfname; private string shelftype; @onetomany(mappedby="shelf",cascade=cascadetype.all) private set<book> book = new hashset<book>(0); //getters&setters here book.java @entity @table(name="books") public class book { @id private int bookid; private string bookname; private string bookstate; @manytoone(cascade=cascadetype.all) private shelf shelf; //getters&setters here here's criteria query: criteria criteria = session.createcriteria(book.class) .add(restrictions.eq("shelf.shelfid", booklocid)) .add(restrictions.ne("shelf.shelftype", "table")) .add(restrictions.ne("bookstate"

java - Why does PreparedStatement (JDBC) result in a MySQLSyntaxErrorException in MySQL 5.7.9? -

this question has answer here: mysql prepared statement error: mysqlsyntaxerrorexception 2 answers code: package com.qapro.register; import java.io.ioexception; import java.sql.connection; import java.sql.drivermanager; import java.sql.preparedstatement; import java.sql.resultset; import java.sql.sqlexception; import java.sql.statement; import java.sql.timestamp; import java.util.arraylist; import java.util.date; import javax.servlet.requestdispatcher; import javax.servlet.servletexception; import javax.servlet.annotation.webservlet; import javax.servlet.http.httpsession; import javax.servlet.http.httpservlet; import javax.servlet.http.httpservletrequest; import javax.servlet.http.httpservletresponse; @webservlet("/registermember") public class registermember extends httpservlet { private static final long serialversionuid = 1l; public regist

java - How to manipulate Object through the selectedItem of a Combobox -

just in case want me, appreciate lot that, because i'm noob in java , trying learn concept and, in same time, maintain code clean , read. if think it's stupid question because have wrong approach coding, care opinion , if explain me why try experience. now questions is: i have mainapp containing observablelist of persons , observablelist of events public class mainapp extends application { private stage primarystage; private borderpane rootlayout; private observablelist<evento> eventi = fxcollections.observablearraylist(); private observablelist<person> persons = fxcollections.observablearraylist(); public observablelist<evento> geteventi() { return eventi; } public observablelist<person> getpersons() { return persons; } public static void main(string[] args) {launch(args);} public void start(stage primarystage){ this.primarystage = primarystage; this.primarystage.settitle("bett

ios - Can't Save Snapshot to Data Model? -

in viewcontroller file, had following code: self.rootref.child("users/").child("stringkey").observeeventtype(.value, withblock: { snapshot in self.usera.name = snapshot.value!.objectforkey("name") as? string self.usera.urlone = snapshot.value!.objectforkey("urlone") as? string self.usera.urltwo = snapshot.value!.objectforkey("urltwo") as? string }) print(self.usera.name) print(self.usera.urlone) print(self.usera.urltwo) but reasons unknown me, output empty . when put print statements inside observer event, desired output. why aren't allowed save snapshot data model? [observeeventtype] processed in background , print commands on main thread. need saving in background thread or use method completion handler

java - Getting exception while reading from a file using Scanner -

i'm trying program read contents of text file, store each line in array, , output results in ordered fashion each type. have sorted part down, every time run main program, keep getting error message try/catch (this still work in progress) package p20; import java.io.*; import java.util.*; public class employeeorderingdemo { public static void main(string[] args) { scanner input=null; arraylist<employeefx> employeelist=new arraylist<employeefx>(); try { filereader info=new filereader("p01_data.txt"); input=new scanner(info).usedelimiter("\\s\\s+"); } catch(filenotfoundexception nofile) { system.out.println("can't open file"); system.exit(1); } try { while(input.hasnextline()) { employeelist.add(new employeefx(input.nextint(),input.next(),input.next(), input.nextboolean(), input.nextint())); input.nextline(); } }