Posts

Showing posts from September, 2011

javascript - How to render nested JSON using jquery in ul and li -

Image
i facing 2 issues 1.i not getting proper html structure see below picture currently getting html structure: what looking html structure: how make code dynamic json, eg, json may have 4 level of sub menus not able write loops , condition, trying render json writing nested loops here code tried: $(document).ready(function(){ var treejson = {"values":[ { "tree_title":"fashionworld1", "tree_image":"img_arrow", "tree_image_position":"1", "tree_image":"fashionworld", "isopen":"0", "child":[ { "values":[ { "tree_title":"submenulevel11", "tree_image":"img_arrow", "t

jquery - Checkbox is not saving after saving data via DOM -

im using datatables script , integrate laravel. have listed of users along checkbox see active , not. went check users when saved data, appears last action saved. for example: have 25 list of users per page. check #2 user , go page 2 check #26 user save data. after whole page refresh, appears #26 user checked , not #2. is there additional command this, or missing something? here's code use propeller data-table: $(document).ready(function() { var exampledatatable = $('#example').datatable({ responsive: { details: { type: 'column', target: 'tr' } }, /* columndefs: [ { classname: 'control', orderable: false, targets: 1 } ], */ order: [ 1, 'asc' ], bfilter: true, blengthchange: true, pagingtype: "simple", "paging": true, "searching&quo

javascript - Roxy Fileman remove part of URL in returnurl -

i'm attempting roxy fileman work in environment, running little hitch. can see directories images (done via symlink) when returning roxy ui via "select" button i'm getting url this: https://images.example.com/path/to/uploads/symlink/123/logo.png and want is: https://images.example.com/symlink/123/logo.png i've put in return_url_prefix, i'm still getting extended path whether use session_path_key or regular root (and browse correct directory via symlink). my code session_path_key looks like: <?php $_session['dynamic-user-folder'] = "/path/to/uploads/symlink/"; ?> and config.json: "files_root": "", "return_url_prefix": "https://images.example.com/", "session_path_key": "dynamic-user-folder", ok, found answer. in plugin php folder there file called filelist.php. in here added $fullpath = str_replace('/path/to/uploads/', '

ef core 2 apply HasQueryFilter for all entity -

is there way apply "hasqueryfilter" globaly entity ? don't want add in modelbuilder 1 one ? modelbuilder.entity<manufacturer>().hasqueryfilter(p => p.isactive); in case have base class or interface defining isactive property, use approach ef-core 2.0 filter queries (trying achieve soft delete) . otherwise iterate entity types, , each type having bool isactive property build dynamically filter expression using expression class methods: foreach (var entitytype in modelbuilder.model.getentitytypes()) { var isactiveproperty = entitytype.findproperty("isactive"); if (isactiveproperty != null && isactiveproperty.clrtype == typeof(bool)) { var parameter = expression.parameter(entitytype.clrtype, "p"); var filter = expression.lambda(expression.property(parameter, isactiveproperty.propertyinfo), parameter); entitytype.queryfilter = filter; } } wiki

jquery - Using Apache Velocity (with SparkJava) with loaded templates -

i building website using spark + velocity. has html components similar across webpages of site, have put shared components in templates dynamically load page. to give simple example, have pages such this: anypage.vm <head> stuff in here </head> <body> <div id="header"></div> $ajavaobject.tostring() # <-- using velocity templating language ... </body> <script type="text/javascript"> $(function(){ $("#header").load("header.vm"); } </script> this works right, except fact velocity code inside header.vm won't work. header.vm <h1>header</h1> $anotherjavaobject.tostring() the header.vm not contain <head> or <body> tagging. when rendering page, instead of seeing string representation of anotherjavaobject , see actual string $anotherjavaobject.tostring() . any appreciated. thanks. you can't load in javascript after templat

java - Spring Batch - Recovery after Error -

i have spring batch job itemprocessor can possibly fail exception. if happens have itemprocesslistener in place handles recovery (marking item failed not picked in next run). that solution works charm 'regular' exceptions, i've experienced java.lang.outofmemoryerror: java heap space error onprocesserror() not called , item not excluded in next run. i noticed jobexecutionlistener.afterjob() called job parameters of failed execution , query all items of execution again , mark them failed. is there better approach problem? basically onprocesserror ill-named. listens exception s, not error s. java discourages handling error s via catch-blocks. reason is, jvm signals fault not in programming in configuration of vm via error . should taken strong indicator, vm-setup needs correction. in case, write outofmemoryerror occurs if memory demand higher memory, has been assigned java-job via -xmx/xms startparameters. either assign little memory or consume of

java - How to Add Spring Security HTTP Response Headers -

starting spring 3.2 can add security xml: <security:headers> <security:frame-options policy="sameorigin" /> </security:headers> but not supported in spring version 3.1 , workaround without having upgrade version? this documentation version 3.1: http://docs.spring.io/spring-security/site/docs/3.1.3.release/reference/springsecurity.html i believe xframeoptionsheaderwriter implements logic behind configuration. introduced in spring 3.2, nothing similar exist prior version. if want implement yourself, can use simple filter: public class xframeoptionsheaderfilter extends onceperrequestfilter { @override protected void dofilterinternal(httpservletrequest request, httpservletresponse response, filterchain filterchain) throws servletexception, ioexception { response.setheader("x-frame-options", "sameorigin"); filterchain.dofilter(request, response); } } you need create b

php - How to perform ajax post request to get some values from the last row of? -

hi asked data last row in database using ajax post request. have 2 files php scrip used connect database , data , convert data json format. performed ajax post php script data. want modify ajax post request additional data last row of tables in database. for example, in student table, there 10 rows of data in database. want data last row. question how values last row in database.. requirement: not modify sql code need data , additionally last row of data. not want code data[9]['student_name']; here code below... html file <html> <head> <script type="text/javascript" src="/cesium-1.34/thirdparty/jquery-1.11.3.min.js"></script> </head> <div id="result"</div> <script type="text/javascript"> showdata(); function showdata() { $.ajax({ type: "post", url: "student.php", datatype: "json", data: "how request data las

spring - Tomcat giving java.lang.ClassNotFoundException: org.springframework.web.SpringServletContainerInitializer? -

i getting following exception when trying start tomcat through eclipse (via right click on project, run -> run on server after mvn clean , mvn install. severe: servletcontentinitializer [org.springframework.web.springservletcontainerinitializer] not created java.lang.classnotfoundexception: org.springframework.web.springservletcontainerinitializer @ org.apache.catalina.loader.webappclassloader.loadclass(webappclassloader.java:1688) @ org.apache.catalina.loader.webappclassloader.loadclass(webappclassloader.java:1533) @ java.lang.class.forname0(native method) @ java.lang.class.forname(class.java:270) @ org.apache.catalina.startup.contextconfig.getservletcontainerinitializer(contextconfig.java:1533) @ org.apache.catalina.startup.contextconfig.processservletcontainerinitializers(contextconfig.java:1456) @ org.apache.catalina.startup.contextconfig.webconfig(contextconfig.java:1193) @ org.apache.catalina.startup.contextconfig.configurestart(contextconfig.java:828) @ org.apache.ca

mysql - SQL returning string instead table -

Image
i having sql command: select company, purchases.stock,sum(ammount)*price purchases inner join curstock on purchases.stock = curstock.stock group company , purchases.stock; which returns following table : is possible print instead of table strings like: "company xxx owns yyy in zzz stock." or sql not provide such formatting , has done in code. you can use concat() function select concat('company ', company, ' owns ', sum(ammount)*price, ' in ', purchases.stock, ' stock.') value purchases inner join curstock on purchases.stock = curstock.stock group company , purchases.stock; wiki

Can I Replace Part of a Python "If" Statement with a Variablized String Literal? -

i have long question may short answer. i'm new python (almost 2 weeks, now) i've used vbscript many years understand many of basic concepts. i've searched stack overflow , internet solution haven't been able find anything; i'm not sure if possible in python, i'd bit surprised if it's not. i've written file-search program using python3 allows users search computer files. user can choose search based on several different parameters: name, size range, date-modified range and, non-linux systems, date-created range. search functionaly works quite each individual parameter combinations of parameters (which, way, in no small part many answers / discussions i've found here on stack overflow). problem actual search rather inelegant and, believe, slower be. program uses flags (not true python flags, that's happen call them) set search options. let me illustrate pseudo code: # variables values user entry sname = "test" # stri

console application - How to check for the previous path searched on a maze C# -

Image
i trying code algorithm solves maze problem facing difficulty apply correctly. the algorithm runs on walls instead of changing direction after finding valid point. complete code on github i not understand how check previouspoint , point check next valid move. could me giving me tips on direction go? class mappathfinder { public bool[,] correctpath = new bool[12,12]; public int[,] previouspoint = new int[12, 12]; public bool startpointfound = false; public bool nextvalidmove(mapfile map, int y, int x) { if ((y == map.width) && (x == map.height)) { return false; //checks if @ edge , terminates method } if ((map.matrix[y, x]) == 1 ) { return true; // check if @ wall , terminate method } if (y != 0) { if (nextvalidmove(map, y-1,x)) { map.matrix[y, x] = 9; //changes color of position correctpath[y, x] = true;

python - counting word frequencies in a corpus is taking too long -

my task to: print out list of words occur in corpus , frequencies. list should sorted word frequencies in descending order (most frequent word first)." def printwordfrequencies(index, vocab): #print("your task 3: print out list of words occur in corpus , frequencies. list should sorted word frequencies in descending order (most frequent word first).") newlist = [] in index: newlist.append([i, len(index[i])]) sorted(newlist) return newlist index dictionary (associative array) maps words list of positions , vocab alphabetically sorted list of vocabulary used in corpus. the function have written has 2 problems. firstly, not sort properly. gives right word frequency [.., ['plot', 128], ['two', 166] , ..] not sort depending on frequency. secondly, takes way long time run. assuming because it's trying append , sort such long list, not sure how fix issue. one small thing that, not sure why need vocab input

hashicorp - nomad: summary has failed=1 and complete=1 at the same time -

i've run 1 dispatched job exits code 0. in job summary see job has failed , completed @ same time. # nomad status run-packaging-a8173887-b37f-4273-9ad7-8691654bb5d4/dispatch-1503480991-c1bd3b3f id = run-packaging-a8173887-b37f-4273-9ad7-8691654bb5d4/dispatch-1503480991-c1bd3b3f name = run-packaging-a8173887-b37f-4273-9ad7-8691654bb5d4/dispatch-1503480991-c1bd3b3f submit date = 08/23/17 09:36:31 utc type = batch priority = 50 datacenters = mhd status = dead periodic = false parameterized = false summary task group queued starting running failed complete lost system 0 0 0 1 1 0 allocations id node id task group version desired status created @ aec6e219 769ff893 system 0 run complete 08/23/17 09:36:31 utc and alloc-status: # nomad alloc-status aec6e219 recent events: time type description 08/23/17 09:37:16 utc termi

c# - Error CS1929 when looking for a way to search in my ListView -

my code doesn't work , dont know why? it's part not work: (navn => navn.contains(keyword)); . error cs1929 code 1 private void søgebar_searchbuttonpressed(object sender, eventargs e) { var keyword = søgebar.text; kontakter.itemssource = vm.kontakter.where(navn => navn.contains(keyword)); } code 2 private void søgebar_searchbuttonpressed(object sender, eventargs e) { var keyword = søgebar.text; kontakter.itemssource = vm.kontakter.where(navn => navn.contains(keyword)); } your question has 2 answer depending on whats inside listview 1. strings vm.kontakter.where(navn => navn.equals(keyword)); 2. object vm.kontakter.where(navn => navn.nameoffield == keyword); hope helps wiki

workflow - How to avoid hasted gerrit review submits? -

over last year of using ~5 different gerrit servers encountered common issue: while performing review, did +2 , submitted change, entire review effort become useless. how can avoid issue? you implement special strategy "lock" approval , "unlock" after timeout. example: 1) create custom label on gerrit (ex: timeout) 2) set gerrit-trigger on jenkins trigger job every patchset pushed gerrit. every patchset following: 2.1) set label timeout = -1 (lock). 2.2) save in file change number time when unlocked. 3) set on jenkins periodical job timeout changes in lock file. set label timeout = +1 (unlock) when it's needed. some people +1 permission on label timeout can bypass timeout period if needed. wiki

sql - Incrementing a field value over time in Oracle 12c -

i new databases , dbms. have table in there multiples integer fields. number(3,0) is there way increment (+1) each ones of fields on time pl/sql (automatic)? for example, have field test(number(3,0)) in table , want value increment 1 every hour passes. thanks! it's little game, want every user 1 coin in accounts every day/hour passes you create job it: dbms_scheduler.create_job ( job_name => 'give_gold', job_type => 'plsql_block', job_action => 'begin update tab_name set gold_val = gold_val+1; end;', start_date => systimestamp, repeat_interval => 'freq=hourly; byminute=0', end_date => null, enabled => true, comments => 'this job gives +1 gold every hour'); of course fire stored procedure , make complex calculations. more info: dbms_scheduler wiki

sql server 2008 - How to sort before using STUFF in SSRS -

i have 2 different values i'm trying stuff here. quantity + price. example: 1-$0.36; 100-$0.29; 25-$0.31. how can have sort quantity before being stuffed? (1,25,100 instead of 1,100,25) did come across link sort data before concatenating using stuff xml , dealt 1 value , i'm dealing 2 values select stuff( (select distinct top (5) '; ' + (cast(floor(case when pcfbd.quantity not null pcfbd.quantity else 1 end) varchar) + '-$' + cast(replace(replace(rtrim(replace( case when pcf.pricemethod = 0 round(i.cdcost / (100 - pcf.formulapercent) * 100, 2) when pcfbh.priceformula = 2 , pcfbd.formulapercent null round(i.cdcost / (100 - pcf.formulapercent) * 100, 2) when pcfbh.priceformula = 2 , pcfbd.formulapercent not null round(i.cdcost / (100 - pcfbd.formulapercent) * 100, 2) when pcfbh.priceformula = 1 round((i.listprice * (100 - pcfbd.formulapercent)) * .01,2) else null end,

c++ - Allocating memory using new returns same memory address -

class abc { int x ; }; int main() { abc *a = new abc ; cout<< static_cast<void*>(a) << endl ; delete ; cout<< static_cast<void*>(a) << endl ; abc *b = new abc ; cout<< static_cast<void*>(b) << endl ; delete b ; cout<< static_cast<void*>(b) << endl ; return 0; } why prints same address , though deleted old memory . assign null after deletion , prints same address. even address of , b same . real time scenario : function1 -> arr[p] = new x ptr1 = arr[p] using ptr1 function2 -> ptr2 = arr[p] delete ptr2 arr[p] = new x ( new data) in real scenario ptr1 should invalidated since compiler assign same address to arr[p] in function2 ptr1 still works . why should not happen? once you've deleted memory @ particular address, memory manager @ liberty re-use address next time ask new memory. indeed common optimisation used memory ma

How to match two different databases without access to read information from both of it? -

i have 2 databases. in 1 have column email , column text information. in have email. want find whether there email second database in first 1 , text information fot id. how make it, taking in consoderation can't have access emails both databases (i can't read , save emails)? wiki

android - Scroll down with Java using Selenium Web Driver (Appium) -

i'm trying scroll down in apk page java. i'm using appium , selenium. i tried: javascriptexecutor jse = (javascriptexecutor)driver; jse.executescript("window.scrollby(0,250)", ""); and driver.scrolltoexact(); commands not supported "webdriver". how can this? if want scroll page on mobile application using appium can use below code using appium driver syntax : driver.swipe(startx, starty, endx, endy, duration); example : driver.swipe(200, 900, 200, 100, 2000); if want scroll webpage in browser can use traditional way of scrolling using javascript. wiki

charts - How can I configure the axes with a logarithmic scale? -

i have question regarding logarithmic chart. values x-axis starts 20 , goes 20000. want set interval label , grid lines logarithmic appear exact between major values. want same labels in lower picture dont know how set intervals. me.chart1.chartareas(0).axisy.minorgrid.enabled = true me.chart1.chartareas(0).axisx.majorgrid.enabled = true me.chart1.chartareas(0).axisx.intervalautomode = true me.chart1.chartareas(0).axisy.interval = 10 me.chart1.chartareas(0).axisx.majorgrid.interval = 0.5 my chart how should be wiki

css selectors - Append css to a class using a different class on the same element -

i want add opacity: 1; .main class (as itself, , not .main.flow ) when .flow added can affect .main.secondary . something similar using mouse events (hover, active). .main { opacity: 0; } <div class="main flow"> <div class="not-main"> </div> </div> <div class="main secondary"> </div> i'm limited structure of html i'm modding css. possible using css? you'll have select both .main.flow , other .main element relative it. are .main elements siblings, "flow" class being applied first of them? if so: .main { opacity: 0; } .main.flow, .main.flow + .main { opacity: 1; } wiki

javascript - how to populate a multiple email field with data in edit mode -

i have input text contains multiple emails, used this plugin it's working fine when type emails field. the problem when saved form , try edit values not displayed field .. how display emails field using javascript or jquery ? this jquery code show emails field : $('#id_emails').multiple_emails(); i tried change value of field : $('.multiple_emails-input').val({{ emails|safe }}); this what's in html : <input type="text" class="multiple_emails-input text-left"> r@gmail.com ra@gmail.com r2h@gmail.com </input> where {{emails}} emails list returned server, nothing shown could me on ? it seems plugin hasn't api reset , repopulate list, can try emulate user actions (although not nice way). for example: //remove items $('.multiple_emails-email .glyphicon-remove').click(); //add new item: $('.multiple_emails-input').val('test@new.email').blur(); $('.multiple_emails-i

How to connect my wifi module to home router in android -

i developing app control home appliances through android phone i have hardware on wifi module(eg. config_1) installed.at first connecting android phone hardware device wifi(config_1) setting name device(eg.test) , restarting it, this code setting name device new setdevicename(context).execute("http://"+confirmed_ip+"/devicename?devicename="+device_name);//calling asynctask public class setdevicename extends asynctask<string, void, string>{ context context; public setdevicename(context c) { context = c; } @override protected void onpreexecute() { super.onpreexecute(); progressdialog = new progressdialog(context); progressdialog.setmessage("setting device name..."); progressdialog.setindeterminate(true); progressdialog.setcancelable(false); progressdialog.show(); } @override protected string doinbackground(string... urls){ string responsestrin

Graphcool subscriptions: new file uploads -

in graphcool , file upload mutation 1 can subscribe to? if not: how realtime updates on newly uploaded files? i adapted code the subscriptions-with-apollo-instagram example , not seem work: subscription { file (filter: { mutation_in: [created] }) { node { id name url contenttype } } } from the docs : currently, no server-side subscriptions triggered file type. wiki

Beacon scheduling in google beacon dashboard -

i'm working 1 beacon advertising in eddystone-url , eddystone-uid @ same time. no problem eddystone-url. with uid, set several lines in google beacon dashboard. targeting options on of them. 1 monday opens instagram app, 1 tuesday-sunday 3pm-5pm url. instagram app tuesday-sunday 12am-11am, url other times of day , week, etc. not going whole details, it's quite complex. as example here copy of raw json 1 of lines: { "title": "get free pop @ xxxxxx!", "url": "https://mybitlylink", "targeting": [ { "starttimeofday": "15:00", "endtimeofday": "16:59", "anyofdaysofweek": [ 2, 3, 4, 5, 6, 7 ] } ] } all 4 urls bitly links can track number of clicks on each. haven't found way track number of instagram app opens. i set lines not redundant, meaning each line 1 unique part of day , week. have 15 lines total covering every minute o

asp.net mvc - Print Dynamically created table by Rotativa -

i creating dynamic table list using json stored procedure. need print dynamically created list of table using rotativa. here controller code: public actionresult merit(int students) { ... ... return json(list, jsonrequestbehavior.allowget); } catch (exception ex) { throw ex; } } i tried : public actionresult meritlisttopsd() { return new rotativa.actionaspdf("merit"); } but gives error of "the parameters dictionary contains null entry parameter 'students' of nonnullable type" please if have idea wiki

qt - How update a QQuickItem created only at C++ level -

i have qquickitem derived class below class myqquickitem : public qquickitem { q_object public: myqquickitem(qquickitem *parent = 0); ~ myqquickitem(); qsgnode *updatepaintnode(qsgnode *, updatepaintnodedata *); }; i have own texturenode class well. i have myqquickitem registered on qml side & embedded in main.qml below. myqquickitem { id: my_quick_item objectname: "myqquickitemobject" visible: false width: 500 height: 500 } on trigger of signal, have connected slot in myqquickitem , call this->update() . of course triggers updatepaintnode & able repaint myqquickitem new content want. is possible trigger updatepaintnode on qquickitem without declaring @ in qml file? i want dynamically create myqquickitem @ c++ level & not have defined or declared @ in main.qml how can this? core question : how can create qquickitem purely @ c++ level updatable new content calling update on updatepaintnode fired? up

ruby on rails - How can I fix the "Twilio::REST::RestError"? -

i followed documentation here: https://www.twilio.com/blog/2016/04/receive-and-reply-to-sms-in-rails.html now have following error: twilio::rest::resterror (unable create record: requested resource /2010-04-01/accounts//messages.json not found): my messages controller code is: class messagescontroller < applicationcontroller skip_before_action :verify_authenticity_token # skip_before_action :authenticate_user!, :only => "reply" def reply message_body = params["body"] from_number = params["from"] init_twilio msg = @client.messages.create( from: rails.application.secrets.twilio_number, to: from_number, body: "hello! number #{from_number}. xxx test message." ) end private def init_twilio account_sid = rails.application.secrets.twilio_sid auth_token = rails.application.secrets.twilio_auth_key @client = twilio::rest::client.new account_sid, auth_token end end

.net - C# mXparser DLL error -

Image
i've been getting error every time try run executable file project. i'm using .net framework 4.6 , have downloaded 'bin only' files mxparser site. why don't install via nuget? have automated , don't have worry whole "dll" process. you can can using manager or add following line of code: install-package mathparser.org-mxparser -version 4.1.1 in case want continue "manual method" make sure dll file same directory have executable at. if you're building app using visual studio should "debug" folder located in "bin". wiki

libalsa - How to get instantaneous volume or played-time with ALSA in Linux -

i'm writing "play sound" program on reapberry pi alsa. i called snd_pcm_writei every 1280 samples. i wish add small led, , let "lighter while sound louder, , darker while sound quieter." my plane is, if there's callback every short time period(ex: 100ms), , can instantaneous volume in callback, can control led in it. in android, there's audiotrack.setpositionnotificationperiod. however, i've no idea how under linux alsa. could give me advise? the playback function looks this: // nleftframesize: total sample number. // hdevice: play device handle (initialized beforehand). // lpbybuffer: sample buffer. while(nleftframesize > 0){ nres = (int)snd_pcm_writei(( snd_pcm_t*)hdevice, lpbybuffer, 1280); nleftframesize -= 1280; } i've tried calculate rms in while loop before snd_pcm_writei(), set led brightness, , sleep, make sure led can light while these 1280 samples playing. cause sound discontinuous. so i'd create t

javascript - NodeJS My SQL run multiple query in one session -

i have tree relation table in database. category room reservation_detail first want select category table it's filter. second want select room table pass parameter returned first query. third want select reservation_detail table pass parameter returned second query. select id,name,price,currency category branch_id=84; select id,room_no,name,price,currency room branch_id=84 , category_id=64; select d.id, d.create_date, d.update_date, d.room_id, d.status_id, d.start_date, d.end_date, s.name status_name, a.id reservation_id, a.person_no person_no, p.first_name, p.last_name, p.email reservation_detail d inner join reservation_status s on d.status_id=s.id inner join reservation on d.reservation_id=a.id inner join person p on a.person_no=p.personal_no d.room_id=44 , d.start_date >'2017-07-11' , d.start_date<'2017-09-20'; one category contains more 1 room

javascript - Handling long response time for REST API -

i have created javascript based rest api page (private chrome extension) integrates oracle tool , fetches response. works fine if response received within around 3-5 mins however, if takes additional time gives err_empty_response error. i have tried xhr.timeout still gives same err_empty_response error. how can ask javascript wait more time? thanks.. if making ajax call server , want increase waiting time of response need set "timeout" interval @ server side. in nodejs giving way can apply @ server side increase timeout period. in app.js file(express framework) write down following code app.use(function(req, res, next) { //set time out request 24hour req.connection.settimeout(24 * 60 * 60 * 1000); next(); }); you can refer this http keep-alive timeout proper use of keepalive in apache htaccess you need @ server side wiki

Java 8: How to turn a list into a list of lists using lambda -

i'm trying split list list of list each list has maximum size of 4. i know how possible using lambdas. currently way i'm doing follow: list<list<object>> listoflist = new arraylist<>(); final int max_row_length = 4; int startindex =0; while(startindex <= listtosplit.size() ) { int endindex = ( ( startindex+max_row_length ) < listtosplit.size() ) ? startindex+max_row_length : listtosplit.size(); listoflist.add(new arraylist<>(listtosplit.sublist(startindex, endindex))); startindex = startindex+max_row_length; } update it seems there isn't simple way use lambdas split lists. while of answers appreciated, they're wonderful example of when lambdas not simplify things. try approach: static <t> list<list<t>> listsplitter(list<t> incoming, int size) { // add validation if needed return incoming.stream() .collect(collector.of( arraylist::n

stored procedures - Laravel 5.4: Illegal mix of collations -

i have next error when i'm calling stored procedure: sqlstate[hy000]: general error: 1267 illegal mix of collations (utf8mb4_general_ci,implicit) , (utf8mb4_unicode_ci,implicit) operation '=' (sql: call sp_getusuarios()) i'm using mariadb, , in database configuration have: 'mysql' => [ 'driver' => 'mysql', 'host' => env('db_host', '127.0.0.1'), 'port' => env('db_port', '3306'), 'database' => env('db_database', 'forge'), 'username' => env('db_username', 'forge'), 'password' => env('db_password', ''), 'unix_socket' => env('db_socket', ''), 'charset' => 'utf8mb4', 'collation' => 'utf8mb4_unicode_ci', 'prefix' => '', 'strict'

android - App crashes when trying to add a new CyborgController using createNewLayerBuilder() -

this i'm doing in application class: @override public void oncreate() { super.oncreate(); cyborgbuilder.startcyborg(new cyborgconfiguration(this, r.layout.cyborgview__auto_reply, basicmodulepack.class)); } this how cyborgview__auto_reply.xml looks like: <?xml version="1.0" encoding="utf-8"?> <com.nu.art.cyborg.core.cyborgview xmlns:android="http://schemas.android.com/apk/res/android" xmlns:cyborg="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" cyborg:controller="com.hedshafran.autoreply.controllers.controller_permissionscreen" cyborg:tag="controller_permission"/> and i'm doing in controller_permissionscreen class causes crash: createnewlayerbuilder().setcontrollertype(controller_mainscreen.class).setlayoutid(r.layout.controller__main_screen).build(); that causes crash, looks this: e/androidruntim

c# - Create a script with Multiple languages -

problem: able create aspx file contains multiple paragraphs in different languages. example: english: here example. call ###-###-#### spanish: aquí hay un ejemplo. llama ###-###-#### japanese: 日本語を話される場合、無料 ###-###-#### etc. i have tried in html when try generate it, japanese , other languages characters not render correctly. way achieve this. i did following: <% string value1 = "日本語を話される場合"; string value2 = httputility.htmldecode(value1); response.write(value2); %> and following results generated: 日本語を話ã•ã‚Œã‚‹å ´åˆ i tried following: <style> body {font-family: "times new roman",serif; } *[lang="ar"] {font-family: "scheherazade",serif; font-size: 120%;} *[lang="zh-hant"] {font-family: kai,kaiti,serif;} *[lang="zh-hans"] {font-family: dfkai-sb,biaukai, serif;} *[lang="din"] {font-family: "doulos sil",s

php - How to make a synchronous GET request in JavaScript? -

here code: js code: function savecategories(i){ var categorieslist=json.parse(localstorage.getitem("categorieslist")); var code=localstorage.getitem("gamecode"); if(i == categorieslist.length) return; var categoryname=categorieslist[i]['name']; var items=categorieslist[i]['items']; $.get('http://localhost:8080/yourfolder/newcategory.php',{gamecode:code,items:items,categoryname:categoryname},function(resp) { savecategories(i+1); }); } php code: <?php header("access-control-allow-origin"); $host="127.0.0.1"; $user="root"; $pass="password"; $databasename="games"; $con=mysql_connect($host,$user,$pass,$databasename); if(!$con) { die("connection failed: ".mysqli_connect_error()); } $code=$_get["gamecode"]; $name=$_get["categoryname"]; $items=$_get["items"]; $data=array();