Posts

Showing posts from March, 2011

java - Creating a 3D shadow effect on images with itextpdf -

i want create 3d shadow effect on images place in pdf. using itextpdf. question similar : adding shadow effect on itext elements but images , not texts. images placed in table cells. long table not completed, no way actual size of image nor coordinates in page, makes tricky. brilliant id ? , regards, sylvain 4 hours later, found way using pdfcellevent , drawing need inside cell's padding. static class shadowrectangle implements pdfpcellevent { public void celllayout(pdfpcell cell, rectangle rect, pdfcontentbyte[] canvas) { pdfcontentbyte lcb = canvas[pdfptable.linecanvas]; // paddings border int paddinghorizontal = 8; int paddingvertical = 8; // width of shadow int shadowwidth = 7; // calculate border location , size float left = rect.getleft() + paddinghorizontal; float bottom = rect.getbottom() + paddingvertical; float width = rect.get...

python - Django server url alias -

how can set alias in django server, example : http://10.179.146.45:8080/en/ to http://my_name/en/ i run server without apache , without mod_wsgi. you can specify host name , port django development server. $ manage.py runserver my_name:8080

linux - Find number of occurrences of keyword in log file within last minute -

for purposes of publishing metrics aws cloudwatch information of number of occurrences of keyword (eg., error, exception) within last minute (from current system time) in application logs. following commands have tried far based on answers related thread ( filter log file entries based on date range ): awk -vdate=`date -d'now-1 minutes' +["%y-%m-%d %h:%m:%s"` '($1 fs $2) > date {print $3}' application.log | grep "error" | uniq -c awk -vdate=`date -d'now-1 minutes' +["%y-%m-%d %h:%m:%s"` '{if ($1 > date) {print $3}}' application.log | grep "error" | uniq -c awk -vdate=`date -d'now-1 minutes' +["%y-%m-%d %h:%m:%s"` '{if ($1 == $date) {print $3}}' application.log | grep "error" | uniq -c but error when try this: awk: cmd. line:1: 13:06:17 awk: cmd. line:1: ^ syntax error following format of log file: 2016-02-05 12:10:48,761 [info] org.xxx 2016-02-05 12:10:4...

android - How to retain in app Locale change after orientation change -

i able change locale within application, once orientation changes app resources reloaded default system language. without seeing code... call same code changed location oncreate()

bash - Subtracting numbers in a column -

inside file have column numbers 10 elements. want subtract 1st 3rd number, 2nd 4th, 3rd 5th, 4th 6th, , on till 8th 10th. for example: 10.3456 6.3452 11.2456 5.6666 10.5678 6.4568 14.7777 7.5434 16.5467 8.9999 and file subtraction 3rd-1st 4th-2nd 5th-3rd 6th-4th 7th-5th 8th-6th 9th-7th 10th-8th quick , dirty: $ awk '{a[nr]=0+$0}end{for(i=3;i<=nr;i++)print a[i]-a[i-2]}' file 0.9 -0.6786 -0.6778 0.7902 4.2099 1.0866 1.769 1.4565 update: came funny way: $ awk 'nf>1{print $1-$2}' <(paste <(sed -n '3,$p' file) file) 0.9 -0.6786 -0.6778 0.7902 4.2099 1.0866 1.769 1.4565 update2, make result csv: kent$ awk '{a[nr]=0+$0}end{for(i=3;i<=nr;i++) printf "%s%s", a[i]-a[i-2],nr==i?rs:","}' file 0.9,-0.6786,-0.6778,0.7902,4.2099,1.0866,1.769,1.4565

Azure: BadRequest: Last endpoint can not be removed from reserved VIP -

Image
i not know how azure allows enter 2 identical endpoints in different vms, same vip. can not remove these endpoints. have idea how should do? endpoints error when removing endpoints i've tried remove vips , reserved ips... i have mention have not tried myself, looks command need run prior deleting endpoint is remove-azurereservedipassociation -reservedipname $rip -servicename $service -virtualipname $vip

react native - custom sceneConfigs for navigator.push not working -

i using component of routing in application. through props, of functions within component calling navigator.push. an example... login(navigator) { navigator.push({view: 'profile'}); } showmodal(navigator) { navigator.push({ view: 'modal', sceneconfig: navigator.sceneconfigs.floatfrombottom }); } when navigate profile via login function, navigates me floatromright default. when navigate showmodal, floatfromright regardless of floatfrombottom call. what going on here? doing improperly? $ react-native -v react-native-cli: 0.1.10 react-native: 0.19.0 the solution provided david worked. navigator looks follows: render() { return ( <navigator style={styles.application} initialroute={{id: 1}} configurescene={route => { if (route.sceneconfig) { return route.sceneconfig; } return navigator.sceneconfigs.floatfrom...

Android - Paypal Payouts in Android? -

does know if possible use paypal payouts in android app? example app user builds money in app account. decide withdraw money, go withdraw, enter paypal account , paypal account credited money app account (which come paypal account). this work gambling/casino/poker type app. does know if possible using paypal mobile sdk? or should use else , head in different direction? thanks

api - how is possible? Buyers Can Checkout Without a PayPal Account -

how possible? buyers can checkout without paypal account. customers enter name , shipping address. they’re prompted credit card, email address, , phone number. this called "guest checkout". if want force option need use express checkout apis. can add specific parameters ensure guest checkout option prominently displayed. guest checkout works standard payments buttons too, cookie based standard. such, if @ time has logged in paypal account on browser in use, system assume going log again , sort of buries guest checkout option. again, express checkout won't that, , it's #1 reason contacted people upgrading express checkout.

c++ - DX11 Mapping vertex buffer as WRL::ComPtr -

i'm having trouble mapping vertex buffer. when so: id3d11buffer* pd3dsinglevertexbuffer; ... pd3dimmediatecontext->map(pd3dsinglevertexbuffer, null, d3d11_map_write_discard, null, &mappedsubresource); everything works, frames works properly. however, when things that: microsoft::wrl::comptr<id3d11buffer> pd3dsinglevertexbuffer; ... pd3dimmediatecontext->map(pd3dsinglevertexbuffer.get(), null, d3d11_map_write_discard, null, &mappedsubresource); nothing gets rendered, application doesn't crash, nor there errors. do know doing wrong? as discovered, while classic approach creating single-element arrays used in d3d use address-of operator on single element, it's commonly used pass output paramaters creation methods (e.g. createdevice(&device) ). since more common usage, in context of entire win32 api surface, comptr designed safely provide output-parameter semantics, release() ing contained object prior returning address. there ...

gorm - Boolean value is not showing in Linux environment using Grails -

i using grails 2.4.0.and create application , deploy on linux. my domain class userdetails { string userenvironment = "" long userid = 0l boolean accountcreated = false integer retries = 0 string password = "" boolean accountcreationinprogress = true static constraints = { accountcreationinprogress nullable : true } } when saving working fine on windows.but accountcreated , accountcreationinprogress column blank on linux. why don't know. anyone please me out. change to: class userdetails { stringuserenvironment = "" longuserid= 0l boolean accountcreated= false integer retries = 0 stringpassword= "" boolean accountcreationinprogress = true static constraints = { //there no point use nullable accountcreationinprogress if set default true value during create } } remember drop table in database before rerun of app.

php - EasyAdminBundle - Key "nullable" not found - Error on creating or editing items -

i want use easyadminbundle backend. after installation via composer got following error if click edit oder create button: if click "create" button (or "edit" button) in backend, following error message: key "nullable" array keys "css_class, format, help, label, type, fieldtype, datatype, virtual, sortable, template, type_options, fieldname, columnname, property" not exist in @easyadmin/form/bootstrap_3_horizontal_layout.html.twig @ line 39 i changed nothing on entities. easyadminconfiguration this: easy_admin: site_name: 'backend' design: form_theme: 'vertical' entities: blogpost: class: ni\blogbundle\entity\post label: artikel blogkategorie: class: ni\blogbundle\entity\postcategory label: kategorien benutzer: class: ni\userbundle\entity\user label: benutzerkonten ...

powerpivot - DAX First Occurance in SUMMARIZE, FIRST_VALUE equivalent -

i'm trying create dax query combine several records withing same table , extract values these combined records. result should display not min , max of start- , stop time corresponding first , last locations. from travelid | tripid | starttime | stoptime | startlocation | stoplocation 1001______| 99______| 08:00_______| 08:10_______ | 50ab___________| 99de___________ 1001______| 100_____| 08:12_______| 08:20________|59db___________| 989fe___________ to travelid | starttime | stoptime | startlocation | stoplocation 1001______| 08:00________| 08:20_______|50ab____________|989fe_________ * * * my efforts fare are: evaluate( summarize( source, source[businessday] ,source[travelid] ,"no of trips in travels", count(source[tripid]) ,"min of starttime", min(source[starttime]) ,"max of stoptime", max(source[stoptime]) ,"first startlocation", ??? ,"last stoplocation", ??? )) * * have exper...

spring - How to design JPA polymorphic relationships in java? -

i designing product catalogue. have category tree, products can connected leafcategories , can have 1 parent category . using spring boot, spring data , hibernate 4 , h2 database(for now). base entity task abstractcategory (is there better way inherit relationships ?) (getters , setters omitted, namedentity @mappedsuperclass string name , long id) public abstract class abstractcategory extends namedentity{ @manytoone(cascade = cascadetype.persist) @joincolumn(name = "parentid") category parent; } category entities - not leafs , cannot have products connected them: @entity public class category extends abstractcategory { @onetomany(cascade = cascadetype.all, mappedby = "parent") collection<abstractcategory> subcategories; } leafcategory can used property product entity. @entity public class leafcategory extends abstractcategory { @onetomany(cascade = cascadetype.persist, mappedby = "category") collecti...

ios - Create Entity programmatically (Core Data) -

Image
is there way create entity programmatically on core data swift2? searched it, doesn't found something. there few tutorials on web (possibly one ). i not fan of xcode's gui tools (nibs, storyboards, xcdatamodeld, etc), creating (from db ui) in code usual thing me. article referenced @lubos (2 minutes after added link in comments, hmm...) written in objc. so, here swift code: internal var _model: nsmanagedobjectmodel { let model = nsmanagedobjectmodel() // create entity let entity = nsentitydescription() entity.name = "dtcachedfile" // assume there correct // `cachedfile` managed object class. entity.managedobjectclassname = string(cachedfile) // create attributes var properties = array<nsattributedescription>() let remoteurlattribute = nsattributedescription() remoteurlattribute.name = "remoteurl" remoteurlattribute.attributetype = .stringattributetype remoteurlattribute.optional...

wso2 - Access denied on API Manager -

i tried install api manager on amazon ec2 service, installation didn't return error when launch service via bash, give me : java_home environment variable set /usr carbon_home environment variable set /home/ec2-user/wso2am-1.10.0 using java memory options: -xms256m -xmx1024m [2016-02-05 14:24:27,851] info - carboncoreactivator starting wso2 carbon... [2016-02-05 14:24:27,860] info - carboncoreactivator operating system : linux 4.1.13-19.31.amzn1.x86_64, amd64 [2016-02-05 14:24:27,860] info - carboncoreactivator java home : /usr/java/jdk1.8.0_11/jre [2016-02-05 14:24:27,860] info - carboncoreactivator java version : 1.8.0_11 [2016-02-05 14:24:27,860] info - carboncoreactivator java vm : java hotspot(tm) 64-bit server vm 25.11-b03,oracle corporation [2016-02-05 14:24:27,860] info - carboncoreactivator carbon home : /home/ec2-user/wso2am-1.10.0 [2016-02-05 14:24:27,861] info - carboncoreactivator java temp dir : /home/ec2-user/wso2am-1.10.0/tmp...

reporting services - Group with different background colors in SSRS -

i have report uses grouping in ssrs. group collapsed on load , when expand each group, can see individual records. have field each row shows if "error" , "info". did give different background color row this = iif(fields!loglevel.value = "error", "maroon", "nocolor") and shows me erros different background color. but trying give whole group background color if there @ least 1 error inside it. can suggest me way this? tried backgroup color group , don't see it. please suggest way! thanks you need sum when loglevel.value = "error" using iif statement, need scope of group. the scope name of group, eg tblmain_group1, or whatever entered when created group then use criteria background colour data row =iif(sum(iif(fields!loglevel.value="error",1,0),"tblmain_group1")>0,"maroon","transparent")

listview - Android CheckBox Delete -

i having serious issues this, have listview populated entries in database, have custom row each of row in listview (textview1|textview2|textview3|checkbox). all want put listener on each of check boxes when checked removed listview , deleted database. have function deletes row database when passed value textview1. the issue having trying row id checked box or textview value. have searched everywhere still cant work checkbox cursor cursor = db.getallitems(); //string[] columns = new string[] {db.key_name, db.key_code, db.key_rowid}; final string[] columns = new string[] {db.key_item_name, db.key_measurement, db.key_unit}; int[] = new int[] {r.id.ingredientname, r.id.ingredientmeasurement, r.id.ingredientunit}; final simplecursoradapter mycursoradapter = new simplecursoradapter(this,r.layout.row4, cursor, columns, to, 0); final listview shoppinglist = (listview) findviewbyid(r.id.shoppinglist); shoppinglist.setclickable(false); //shoppinglist.s...

Android Studio - Create JAR file with dependencies for standard Java project -

i'm building standard java project, not android project. it using gson library google. there way create jar file project, while maintaining dependencies gson library? please correct me if i'm framing question wrong. the build.gradle module looks this: apply plugin: 'java' dependencies { compile filetree(dir: 'libs', include: ['*.jar']) compile 'com.google.code.gson:gson:2.3' } i used instructions here create jar file when run command line using "java -jar myproject.jar" error: no main manifest attribute, in myproject.jar i tried looking solution , seems there isn't way create jar file dependencies, although link above pretty new. seems have make aar file in case. but since mine java project rather android still apply? thanks. edit : according video manifest.mf file missing line "main-class:mymainclassname". modifying file jar corrupts it. , can't edit manifest file within android s...

json - Updating integer column from jsonb member fails with: column is of type integer but expression is of type jsonb -

in postgresql 9.5 table have integer column social . when try update in stored procedure given following json data (an array 2 objects, each having "social" key) in in_users variable of type jsonb : '[{"sid":"12345284239407942","auth":"ddddc1808197a1161bc22dc307accccc",**"social":3**,"given":"alexander1","family":"farber","photo":"https:\/\/graph.facebook.com\/1015428423940942\/picture?type=large","place":"bochum, germany","female":0,"stamp":1450102770}, {"sid":"54321284239407942","auth":"ddddc1808197a1161bc22dc307abbbbb",**"social":4**,"given":"alxander2","family":"farber","photo":null,"place":"bochum, germany","female":0,"stamp":1450102800}]'::jsonb then following c...

javascript - Debounce function implemented with promises -

i'm trying implement debounce function works promise in javascript. way, each caller can consume result of "debounced" function using promise. here best have been able come far: function debounce(inner, ms = 0) { let timer = null; let promise = null; const events = new eventemitter(); // need this? return function (...args) { if (timer == null) { promise = new promise(resolve => { events.once('done', resolve); }); } else { cleartimeout(timer); } timer = settimeout(() => { events.emit('done', inner(...args)); timer = null; }, ms); return promise; }; } ideally, implement utility function without introducing dependency on eventemitter (or implementing own basic version of eventemitter), can't think of way it. thoughts? i found better way implement promises: function debounce(inner, ms = 0) { let timer = null; let resolves = []; return function (......

javascript - Load js plugin using Require.js after Marionette module is rendered -

im new marionette , requirejs. started change old code structure (backbone) marionette. using requirejs changed old list of scripts needed in initial html page requirejs sintax. until fine, scripts loaded in every module ask. example: define(['app', 'dhcontroller', 'menu', 'gridmenu', 'menubar', 'sidebar', 'aspieprogress'], function(app) { app.module('dh.views', function (views, app, backbone, marionette, $, _) { ....other stuff... //----- requests ----- // dashboard request item view // ------------------- // // display individual request panel views.erequest = marionette.itemview.extend({ tagname: 'div', template: '#template-request', **<-- in template pluging needed** ui: { piechart: '.pie-progress-level' }, onrender: function () { this.ui...

c# - How to utilize EF and LINQ to add filters and specify tables, columns, filters and order by dynamically -

Image
i have database structure (all parent , childs tables), what doing now want create ad hoc reporting page, let user select tables , columns in these tables. when user select tables , columns, can add filters (is in list or contains or filter etc..) columns. i send information json web service create, in web service planning use entityframework required dataset. what have done i able create html ui, web services, database layer repositories , uow, database etc.. question i mean can this, var result = context.parenta.include("child1.subchild1").include(....).where(.. but not sure how can specify columns want or add filters. for specifying column names can use select linq query : var result = context.parenta.include("child1.subchild1").include(....).where(..).select(s=> new {name = s.parentname , subname = s.subchild.name }); for adding filters need define them in clause .where(p=>p.name.contains("somevalue")) ...

database - how do I model subtyping in a relational schema? -

is following db-schema ok? request-table request-id | type | meta-1 | meta-2 | this table stores requests each of has unique request-id. type either a, b or c. tell table contains specific request parameters. other have tables respective types. these tables store parameters respective requests. meta-1 additional info timestamps , stuff. type-a-table request-id | param_x | param_y | param_z type-b-table request-id | param_i | param_j type-c-table request-id | param_l | param_m | param_n | param_o | param_p | param_q the request-id foreign key request-table. is design normal/best-practice? or there better/smarter way? alternatives? it somehow feels strange me, having query on request-table find out type-table contains information need, actual query i'm interested in. for instance imagine method given id should retrieve parameters. method need 2 db-access. - find correct table query - query table parameters note: in rea...

angularjs - ASP.NET Create directory with current user permissions -

i want create directory on network path wcf web service. web service hosted under site uses windows authentication. however, when try create folder "directory.create", access denied. when check "httpcontext.current.user.identity.name", can see own user account, guess not 1 used create folder, as, when "system.environment.username", see value. i tried put " <identity impersonate="true" /> " in main web.config of web site then, nothing works anymore. so question is, possible create directory using permissions of logged user ? as precision, i'm calling webservice through angularjs , configured "$httpprovider" pass credentials (" $hp.defaults.withcredentials = true; "). edit: i added " <identity impersonate="true" /> " web.config placed in folder contains web service , now, "system.environment.username" contains correct credential still, guess access denied. tri...

printing - Anyone send commands to the SATO CL4NX label printer using C#? -

i have task of developing c# form application sends sbpl commands sato cl4nx label printer , feel i'm beating head against wall (yes hurts)! mostly, i'm having fits trying send <esc> character printer! has done same thing? steve i guess need print label sato cl4nx. colleagues have done before , here understand them. you may want use sato free .net api establishing connection or sending data printer. api detect installed printer driver, detect interface (lan/usb/rs232c/lpt), connect interface directly or via driver sending data. http://www.satoworldwide.com/software/sato-printer-interface-api.aspx for printing label, need use sbpl (sato barcode programming language). can find details in cl4nx programming manual. https://www.satoamerica.com/uploads/files/datasheets/cl4nx%20programming%20reference.pdf i not c# developer thus, cannot share actual coding samples. hope above helps.

How to SELECT and sort it by parent-children in MySQL -

i have table looks this id parent_id name address email telephone 2 null name address email phone 3 null name2 address2 email2 phone2 4 null name3 address3 email3 phone3 5 null name4 address4 email4 phone4 6 null name6 email6 phone6 7 5 name7 email7 phone7 8 null name8 email8 phone8 and want select on select rows, if row has parent displayed after parent. in case rows this id parent_id name address email telephone 2 null name address email phone 3 null name2 address2 email2 phone2 4 null name3 address3 email3 phone3 5 null name4 address4 email4 phone4 7 5 name7 email7 phone7 6 null name6 email6 phone6 8 null name8 email8 phone8 the row id=7 goes before 1 id=6 because parent...

javascript - How to set the data from server into this dynamic form? -

i using this bootsnipp bootstrap.js create dynamic fields , capture data form. after save, lets data json server key value pairs, how can construct dynamic form user can update again. any sample snippet helpful. all have write data propagating method, rather easy, here's quickie (data server stored in variable requestdata , removed unnecessary code): var requestdata = [{"name":"phone0", "value":"890890809"},{"name":"fax1", "value":"1111"},{"name":"skype2", "value":"anonononono"},{"name":"email3", "value":"huhuhuhu@huhuhu.pl"}]; function capitalize(string) { return string.charat(0).touppercase() + string.slice(1); } (function ($) { $(function () { var addformgroup = function (event) { [...] }; var removeformgroup = function (event) { [...] ...

python - Set x_axis_limit in Bokeh live plot embedded in Jupyter notebook -

i want change x axis range part of plot update in jupyter. my update function plotting time series (line instance of multi_line ): def update_plot(meta, data, fig, line, window_length=3.0): fs = meta["format"]["sample rate"] data = np.asarray(data).transpose()[4:8] x, y = dsp.time_series(data, fs) x = np.tile(x, (y.shape[0], 1)) line.data_source.data['xs'] = x.tolist() line.data_source.data['ys'] = y.tolist() if x.max() >= window_length: fig.x_range = range1d(x.max() - window_length, x.max()) push_notebook() however, while updates plot new data, not set x axis limits expected. i've tried how can accomplish `set_xlim` or `set_ylim` in bokeh? doesn't update plot. 1 option slice plotted data, want data available if user zooms out. this took me little while figure out doing seemed reasonable! (i've asked question on mailing list understand better). making work pretty straight fo...

javascript - Remove class in jQuery -

i have issue when trying remove class in jquery. checkboxes in following structure. when click on checkbox check adds class checkbox in span , shows checkbox checked. i want add condition if checked checkboxes greater one not add checkbox class on next checkbox when click on or remove class based on clicked checkbox. i using following jquery code not working. $(document).ready(function() { $("label").on("click", function(e) { var abc = $('.custom.checkbox.checked').length; if (abc > 1) { $(this).children('.custom.checkbox.checked').removeclass('checked'); alert(abc); } }); <label for="field_422_10" class="foo"> <input type="checkbox" value="yoga-tai chi-pilates" id="field_422_10" name="field_389[]" style="display: none;"> <span class="custom checkbox"></span>...

javascript - Issue with alternating colors row table with selectable rows -

i having issue generated table has alternating rows , rows selectable. $(document).ready(function() { $("tr").click(function() { $(this).toggleclass("highlighted"); }) }); table { width: 100%; border-collapse: collapse; table-layout: auto; vertical-align: top; margin-bottom: 15px; border: 1px solid #999999; } th { font: bold 11px"trebuchet ms", verdana, arial, helvetica, sans-serif; color: #f2edeb; border-right: 1px solid #c1dad7; border-bottom: 1px solid #c1dad7; border-top: 1px solid #c1dad7; letter-spacing: 2px; text-transform: uppercase; text-align: left; padding: 6px 6px 6px 12px; background: #522d25 url(images/bg_header.jpg) no-repeat; } tr { background: #fff; color: #261f1d; } tr:hover, tr.alt:hover { color: #261f1d; background-color: #e5c37e; } .highlighted { color: #261f1d; background-color: #e5c37e; } tr.alt { background: #f5fafa; color: #b4...

python 2.7 - Convert from irregular frequency to monthly within groupby objects in pandas dataframe -

i have dataframe df containing userid, date of observation (usually quarterly frequency, irregular) , characteristic value, example: from util.dates import dates, to_date import pandas pd df = pd.dataframe(dict( refissuerid=[11590] * 3 + [115948] * 4, availabledate=[to_date(d) d in (20050613, 20050905, 20051214, 20040924, 20041101, 20050202,20050516)], characteristic=[0.06, 0.09, 0.07, 0.13, 0.09, 0.06, 0.04])) userid date characteristic 115950 6/13/2005 0.06 115950 9/5/2005 0.09 115950 12/14/2005 0.07 115948 9/24/2004 0.13 115948 11/1/2004 0.09 115948 2/2/2005 0.06 115948 5/16/2005 0.04 i trying upsample monthly frequency within userid groups. is, looking smth (sorted userid , date) userid date characteristic month_date 115950 6/13/2005 0.06 6/30/2005 115950 6/13/2005 0.06 7/31/2005 115950 6/13/2005 0.06 8/31/2005 115950 9/5/2005 0.09 9/30/2005 115950 9/5/2005 0.09 10/31/2...

c# - Windows Form App for loop not working -

int = 0; private void button1_click(object sender, eventargs e) { (int j = 10; j < 1000; j = j + 1) { string y = i.tostring(); webbrowser1.document.getelementbyid("lst-ib").setattribute("value", y); i++; } } this section of code i'm working in windows form application want input value , show going jumps end , puts last output instead of counting up. people said use timers haven't been able them work. ideas? you're locking ui thread loop, doesn't update control until it's done work. end seeing final value, when loop complete , ui refreshes. take @ using timer control instead. can tell raise event @ regular intervals, , it'll allow ui updated correctly. add timer form , insert following code constructor try out. currently, updates element every 1 ms (in reality, won't fast). int = 0; int j = 10; timer1.interval = 1; timer1.tick += (s, e) => { string y = i.tostring(); ...

javascript - How can I interrup slow ajax request, running in background -

the situation: user visit fast loading page, makes ajax async request slow php script, loads, example, 30 seconds after 3 seconds user clicks link go fast loading page, browser waits 27 seconds finish ajax request slow script, , after starts load next page how can solve problem? how tell web server interrupt processing request, started defined ajax call? ps. abort() not solution pps. code example: page includes filter of shop products, loads longer other page components. after first load filter cached - next times loads fast. when page loads, don't show filter, add js, calls current page again using ajax, adding parameter (show_filter). if page receive parameter - shows filter... <div id="catalog_filter_container"> <?if($_request['show_filter'] == "y"):?> ... filter code here ... <?endif;?> </div> <?if($_request['show_filter'] != "y"):?> <script type="text/javasc...

symlink - Symbolic Link Host to Docker Container -

well, wanna create symbolic link "ln -s" host container. to sum up: host folder .m2 of host must have symbolic link .m2 folder inside container, like: $ ln -s containerip:/root/.m2 mycontaineralias i've seen below posts didn't me since don't wanna copy files local host. docker - copy file container host apache in docker says: symbolic link not allowed https://omarabid.com/symlink-to-a-mounted-volume-in-docker/ edited: i've found valuable issue here: how mount directory in docker container host? thanks... if want share data between host , container, or visa versa, need use docker volume . there many ways this, situation easiest mount host directory data volume . done -v flag docker. example docker run -it -v /path/to/.m2:/root/.m2 ubuntu:latest /bin/bash run ubuntu:latest image host directory /path/to/.m2 'symlinked' container directory /root/.m2 . hope helps.

printing - How can I print parameters's values of different methods with java asm? -

so want print parameters's values of different methods. for example if method is void print(string string,int number) { system.out.println(number +" " + string); } i want able like void print(string string,int number) { mylogger.log(methodname,string,number); system.out.println(number +" " + string); } so pass parameters of class own logger can print them out. don't know how transfer bytecode (asm). so far have managed print method's name code: (classdata class contains methods in classes should hook into) public class mytransformer implements classfiletransformer { @override public byte[] transform(classloader classloader, string s, class<?> aclass, protectiondomain protectiondomain, byte[] bytes) throws illegalclassformatexception { for(classdata classdata : myagent.classes) { string classname = classdata.classname; if (classname.equals(s)) { classreader cr=new classre...