Posts

Showing posts from September, 2012

swift - Epson printer - print two images horizontally from iOS -

i downloaded ios (swift) sdk epson epos2 printer , integrate application without problem. can print images or texts vertically 1 one. problem want print 2 image , 1 text horizaontal. format tried addpagearea(x,y,width,height) addpagebegin() , addpageend() , tried addpageposition(x,y) also. these methods print in vertical format only.

postgresql - How can u make psql process idempotent in ansible? -

i have process runs psql process in ansible - name: run psql pull in initial config data become_method: sudo become: yes become_user: postgres shell: psql -u postgres -w eclaim < /opt/eclaim_revamp/sql_scripts/{{ item }}.sql with_items: - initial_config - initial_sql_script - tmp_hrms this task runs time. how make idempotent ? i guess way wrap sql-script shell scripts , make checks. example (i know there postgresql_user module, example): #!/bin/bash if [[ $(psql postgres -tac "select 'found' pg_roles rolname='{{ user }}'" | grep found) ]]; echo "user exists" else psql -c "create user {{ user }} login encrypted password '{{ password }}';" > /dev/null echo "user created" fi and in playbook: - name: run psql shell: createuser.sh register: result changed_when: "'user created' in result.stdout"

java - How to refresh my current latitude longitube at background in android -

tell me how referesh current latitude , longitude in activity @ every 5 min public class mapsactivity extends fragmentactivity implements onmapreadycallback, googleapiclient.connectioncallbacks, googleapiclient.onconnectionfailedlistener,locationlistener{ private googlemap mmap; private googleapiclient mgoogleapiclient; private locationrequest mlocationrequest; private marker mcurrlocationmarker; private textview mlatitude, mlongitude; private button mnextbtn; private location location; private int minterval = 5000; private static final string tag = "broadcasttest"; private intent intent; handler mhandler; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_maps); mlatitude = (textview) findviewbyid(r.id.tv_lat); mlongitude = (textview) findviewbyid(r.id.tv_long); mnextbtn = (button) findviewbyid(r.id.btn_next); intent = new intent(this, broadcastservice....

php - Run Symfony app with Vagrant -

i try run symfony app vagrant, install vagrant, copy symfony app in vagrant folder (vagrantrasmus/clientproject) add in hosts 192.168.7.7 clientproject , add in client.conf conf.d server { server_name clientproject; root /vagrantrasmus/clientproject/web; location / { # try serve file directly, fallback app.php try_files $uri /app.php$is_args$args; } # dev # rule should placed on development environment # in production, don't include , don't deploy app_dev.php or config.php location ~ ^/(app_dev|config)\.php(/|$) { fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_split_path_info ^(.+\.php)(/.*)$; include fastcgi_params; # when using symlinks link document root # current version of application, should pass real # application path instead of path symlink php # fpm. # otherwise, php's opcache may not detect changes # php files (see https://github....

reporting services - Date picker issue in SSRS reports hosted in WPF application -

Image
we have hosted ssrs reports in wpf application using reportviewer . month selection in date picker not working properly. date selection through navigation buttons working fine. date picker getting displayed shown in below image. on selecting month returning current date. it needs work in calendar control in wpf not sure problem here. datepicker control returns datetime object, can determine month of date using ssrs expression . if mean reporting services control in 2008 r2 isn't pretty wpf; older tech , there's nothing can apart upgrade sql server 2016.

ajax - how do we use request.session.setAttribute for already existing session variable to UI -

while loading view page setting session variable as: request.session.setattribute("list",list); after onclick of button using ajax call refresh list. in backend able see latest list contents. in ui using : list<string> clist = (list<string>)session.getattribute("list"); but after list changed not able see latest list contents.still old list contents displaying on page. need suggestions on how resolve issue. var refreshthisdiv= "refreshthisdiv"; var gourl= "unametest/getusernameslist; var httprequest=null; var refreshcontent = "null"; httprequest = xmlhttpobject(); httprequest.open("post", gourl, true); httprequest.onreadystatechange = function () {ajaxfcuntion(refreshthisdiv,httprequest); } ; httprequest.setrequestheader('content-type', 'application/x-www-form-urlencoded'); httprequest.send(null...

sql server - MSSQL After Update Trigger: Multi Row Stored Prc -

i've written stored procedure invoke on row updates. it this: create procedure [tracechange] @id uniqueidentifier, begin /*do inserts, updates, etc*/ end now create trigger table, works fine single row update: create trigger t1_traceinsert on t1 after update begin set nocount on; declare @id uniqueidentifier exec tracechange @id end this works fine - single row. how rewrite execute on multi row updates ? afaik not great approach use cursor within such triggers. thanks! there 2 options: 1) process data in while loop - data inserted table, , execute sp x times - 1 per row. 2) rewrite sp (or create new one) accepts table input parameter. process rows in 1 go if possible. depends on code of sp. so, in trigger, execute sp , pass predefined table based on inserted table see https://msdn.microsoft.com/en-au/library/bb510489.aspx example.

Architecture: How to use Spark ML predictions as HTTP service -

Image
i have spark streaming application trains model , periodically stores model hfs. in http based web service, post values , retrieve prediction it. service should reload model on demand (e.g. via request). i implemented web server spark , spray, works proof-of-concept. i'm not sure if design solution. providing web server external services if runs on cluster? how can define on node service available? i'm not sure if right idea use prediction models in way. maybe best-practice integrate spark in standalone application , access model on shared filesystem (e.g. hfs), lack cluster support, wont't it? summary : best-practice design build prediction web service apache spark.

html - How to align text and button by bottom -

Image
i want create text , button align bottom. i've typed (btw using bootstrap3) 123 <button class ="btn btn-default btn-lg ">123</button> however, seems align center of button, i've created jsfiddle illustrate code. in bootstrap default vertical-align middle need change bottom !important bootstrap css having defines vertical-align property use vertical-align:bottom !important; button body { margin: 10px; } button{ vertical-align:bottom !important } <link href="https://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet"/> 123 <button class ="btn btn-default btn-lg ">123</button>

text - What is the best practice to code when the project is on a Guest OS (Virtualbox)? -

i have project , files on guest os (red hat enterprise linux) virtualbox, host os mac os. used coding right in rhel editor atom . boss told me it's inefficient code in guest os, well, makes sense because mac os or windows more responsive linux, changed way: copy whole project located on rhel share folder between mac os , rhel using rsync code atom in mac os copy project in share folder original project in rhel rsync i'm using atom (not vim in rhel) because can edit whole project in 1 window convenient situation. there problem: after copying project in step 3, git status shows has been changed though edited few files. little annoying. is there better way code in such environment? advice appreciated. bretzl's suggestion use shared folders one, think it's important address underlying issue: boss' assumption coding being inefficient or slow because you're working on vm not true. it sounds new workflow, instituted result of his/her advic...

sql server - Add column to condition based on parameter value SQL -

i'm working in dynamic query need add column query if parameter value false. //sql: set @filterexp = 'select * tblname ptblnflag = '+convert(varchar(2),@blnflag)+') tbl 1=1'+ coalesce(nullif( convert(varchar(8000), @filterexp),''), '') in above query need check if @blnflag false column can added in condition. if true need not there. something if condition false should return values , if true result set based on condition. you need and/or operator's no need of dynamic query here select * tblname ( ptblnflag = @blnflag , @blnflag = 0 ) or @blnflag = 1 may wrong variable names logic same

asp.net mvc - Issue in Connecting Web App with localdb using DataContext file and webConfig file -

i have created mvc web application using repository & di approach. have used code first approach too. here datacontext file: namespace efreppattest.data { public class datacontext : dbcontext, idbcontext { public new idbset<tentity> set<tentity>() tentity: class { return base.set<tentity>(); } protected override void onmodelcreating(dbmodelbuilder modelbuilder) { var typestoregister = assembly.getexecutingassembly().gettypes() .where(type => !string.isnullorempty(type.namespace)) .where(type => type.basetype != null && type.basetype.isgenerictype && type.basetype.getgenerictypedefinition() == typeof(entitytypeconfiguration<>)); foreach (var type in typestoregister) { dynamic configurationinstance = activator.createinstance(type); modelbuilder.configurations.add(co...

php - Modx IF return blank page -

i trying check server date , time compate date tv of resource, blank page when try check in if statment, here need. i have snippet this <?php function getdatetimenow() { $tz_object = new datetimezone('europe/belgrade'); $datetime = new datetime(); $datetime->settimezone($tz_object); return $datetime->format('y\-m\-d\ h:i:s'); } $currentdate = getdatetimenow(); $dta = new datetime($currentdate); $dtb = new datetime($date); if ( $dta > $dtb ) { $active = 0; return $active; } else { $active = 1; return $active; } but when on page if try [[!checkcurrentdate? &date=`[[*datumisteka]]`]] i got 1 or 0 based on tv value *datumisteka, working ok, when try compare this [[!if? &subject=`[[!checkcurrentdate? &date=`[[*datumisteka]]`]]` &operator=`equals` &operand=`0` &then=`<script> $("#tab3").html("<p>u pripremi</p>"); </script>` ]] i got ...

jquery - Adding Warning icon to Bootstrap Dialog -

i using bootstrapdialog show warning, not able show warning icon in same. is there way/method/key set icon in bootstrapdailog code. new bootstrapdialog() .settitle('warning') .setmessage('warning on action.') .settype(bootstrapdialog.type_warning) .open(); in case dialog common pages. so, preferred achieve using script instead of html modal. using: bootstrap.min.css, jquery.min.js, bootstrap.min.js, bootstrap-dialog.min.css , bootstrap-dialog.min.js. title string or object(html) you can try set title "icon + title text" .settitle($('<span class="glyphicon glyphicon-alert">').append('warning'))

javascript - Can not display the error message using Angular.js -

i have issue. not display error message while input field takes invalid data using angular.js. explaining code below.\ <form name="billdata" id="billdata" enctype="multipart/form-data" novalidate> <div ng-class="{ 'myerror': billdata.type.$touched && bill data.type.$invalid }"> <input type="number" class="form-control oditek-form" ng-model="type" name="type" step="1" min="0" placeholder="add type" ng-pattern="/^[0-9]+([,.][0-9]+)?$/"> </div> <div class="help-block" ng-messages="billdata.type.$error" ng-if="billdata.type.$touched"> <p ng-message="pattern" style="color:#f00;">this field needs number(e.g-0,1..9).</p> </div> </form> here need give number input .if user entering rather number should display error mess...

java - Jenkins: Deleting Old Builds -

how delete old jenkins builds manually? used discard old builds plugin , set keep last 10 builds. not working , keeping 13 builds. there proper way manually build numbers [#1 #2 ...etc] reorganised? if don't mind scripting deletion algorithm yourself, can create in groovy postbuild . for example, if wanted keep last 10 builds , delete rest, copy , paste 1 liner in groovy postbuild step: manager.build.parent.builds.drop(10).each { it.delete() } what's approach have full control on how things deleted. example, fancy delete builds based on logarithmic approach older builds dropping off faster newer ones.

geolocation - CheckPermissions Error for LocationManager in Android Studio -

i had working app getgeolocation api level 23( using checkselfpermission). but, had make compatible api level 21. so, checkselfpermission didn't work introduced in api level 23. so, changed code accomodate this: protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); checkforcoarselocationpermission(); } private void checkforcoarselocationpermission() { if (android.os.build.version.sdk_int >= 23) { // android 6.0 , up! boolean accesscoarselocationallowed = false; try { // invoke checkselfpermission method android 6 (api 23 , up) java.lang.reflect.method methodcheckpermission = activity.class.getmethod("checkselfpermission", java.lang.string.class); object resultobj = methodcheckpermission.invoke(this, manifest.permission.access_coarse_location); int result = integer.parseint(resultobj.tost...

mysql - Is it okay to reference the primary keys of all tables in database as a foreign key of one table? -

i trying make demo database have tables household(primary key - hid) people(primary key - pepid) parchildold(primary key - pcoid) job(primary key - empid) school(primary key - schlid) pension(primary key - penid) now have various attributes details of people in each household in different tables. can take primary keys of tables , make 1 table, allkeys , reference them foreign keys in particular table? ie: allkeys table primary key: akid -- other columns include foreign keys- hid,pepid,pcoid,empid,schid,penid* i don't know if silly ask or not, but, is such reference allowed? can considered normalized form? queries fired in way joining allkeys table , other table(depending on query) work efficiently? you if of tables related, fail third , fourth normal forms, having both functional , multivalued dependencies in table. consider huge amounts of duplication required store relationships single household: 1 household (hid=1), 2 parents (pepid=1,2), 2 childr...

java - How server spawns new thread for a singleton object in spring framework -

i have been working on spring framework controller / service / repository annotations , each class singleton. whenever request comes server , server has spawn new thread corresponding controller class ( singleton ) each thread have own stack execute same method of class in different stacks. when see controller class neither implement runnable class nor extending thread. i know code behind this. how server spawns thread singleton controller class. will done reflection or anonymous thread or other method. please post example code. the server doesn't need spawn new thread every new request, wasteful , not scalable. has fixed pool of threads sit , wait new requests. whenever such request arrives, server delegates processing 1 of idle threads. part of processing calling method on (already existing, singleton) object. so, there's no need controller or service runnable . 1 of working threads awakes, calls method on class (its stack temporarily growing durin...

fabricJS Not persisting Floodfill -

i have algorithm floodfilling canvas. im trying incorporate fabricjs. here dilemna.... create fabric.canvas(). creates wrapper canvas , upper-canvas canvas. click on canvas apply floodfill(). works fine , applies color. go drag canvas objects around, or add additional objects canvas, color disappears , looks resets of sort. any idea why is? this happen because fabricjs wipe out canvas every frame , redraw internal data.

amazon web services - AWS::CloudFormation::Init not executing commands in metadata -

this template test command in metadata. can't figure out why command doesn't executed. it's supposed save string file in /tmp. machine ubuntu 16.04 cloud-init installed. in userdata install helper scripts , execute cfn-init. thanks help. { "awstemplateformatversion": "2010-09-09", "metadata": { "aws::cloudformation::designer": { "2af5b799-f6bf-7f20-a6eb-943274f18373": { "size": { "width": 60, "height": 60 }, "position": { "x": 326, "y": 118 }, "z": 0, "embeds": [] } } }, "resources": { "ec2i3wadd": { "type": "aws::ec2::instance", "properties": { "imageid": "ami-c60b90d1", "keyname": "cf-key", ...

python 3.x - Pandas insert alternate blank rows -

Image
given following data frame: import pandas pd import numpy np df1=pd.dataframe({'a':['a','b','c','d'], 'b':['d',np.nan,'c','f']}) df1 b 0 d 1 b nan 2 c c 3 d f i'd insert blank rows before each row. desired result is: b 0 nan nan 1 d 2 nan nan 3 b nan 4 nan nan 5 c c 6 nan nan 7 d f in reality, have many rows. thanks in advance! use numpy , pd.dataframe def pir(df): nans = np.where(np.empty_like(df.values), np.nan, np.nan) data = np.hstack([nans, df.values]).reshape(-1, df.shape[1]) return pd.dataframe(data, columns=df.columns) pir(df1) testing , comparison code def banana(df): df1 = df.set_index(np.arange(1, 2*len(df)+1, 2)) df2 = pd.dataframe(index=range(0, 2*len(df1), 2), columns=df1.columns) return pd.concat([df1, df2]).sort_index() def anton(df): df = df.set_index(np.arange(1, ...

c - Explanation of a function -

could can tell following code does? write or read on table ? function in program. trying understand program.if reply explanation great help. typedef struct { short a[16]; } pre25g; pre25g pre25g_g[4] = { 1,1,0,0,0,0,0,0,1,1,0,0,0,0,0,0, /*1*/ 1,1,0,0,0,0,0,0,1,1,0,0,0,0,0,0, /*2*/ 1,1,0,0,0,0,0,0,1,1,0,0,0,0,0,0, /*3*/ 1,1,0,0,0,0,0,0,1,1,0,0,0,0,0,0 /*4*/ }; this not function. first part typedef defines structure . , latter definition of initialized array of structure type pre25g .

c# - How to save a method in a class to be executed later -

i need know how pass method class constructor can called later. idea have bullet class has 2 properties, damage integer , method can called when bullet of type has hit object. code below should explain bit better: public class bullet { public method onhit; public int damage; public bullet(int damage,method onhit) { this.damage = damage; this.onhit = onhit; } } this can make bullets preform different tasks upon impact running bullet.onhit(hitgameobject). you can use action pass function function store in action . function stored can called action.invoke() . public class bullet { public int damage; system.action savedfunc; public bullet(int damage, system.action onhit) { if (onhit == null) { throw new argumentnullexception("onhit"); } this.damage = damage; savedfunc = onhit; } //somewhere in bullet script when bullet damage == damage void yo...

loops - DELPHI move 2nd line to 1st Line Memo -

Image
i need transfer 1st line of memo1 memo2, , move remaining lines of memo1 up. these expected results: like this: memo2.lines.add(memo1.lines[0]); memo1.lines.delete(0);

javascript - Chrome keeps caching my old page until I hit the refresh button -

i'm having strange behavior spa in chrome. i'm running local iis server angularjs frontend. i'm using gulp bust-cache javascript , css files. discovered site loading old html files , due angular $templatecache , used gulp-angular-templatecache solve new problem appeared. when turn on pc, start iis server , load application chrome typing localhost in url bar, chrome loads cache, old js, css , html files (i see chrome loading old index.html file) if go other route localhost/mainpage loads new files , works intended. after that, if go localhost again, old site loaded cache again!! i'm not expert seems weird behavior. chrome bug? chrome's fault or in angularjs spa ? in web.config have disable caching of index.html : <!-- disable index.html cache --> <location path="index.html"> <system.webserver> <staticcontent> <clientcache cachecontrolmode="disablecache" /> </staticc...

jpeg - Gstreamer 1.8.3 rtpbin and rtpjpegpayload throws internal data flow error -

i'm using gstreamer version 1.8.3 , following pipelines send , receive rtp/rtcp streaming. vars: export sample="overwatch.mjpeg" export image_caps="image/jpeg,width=1280,height=720,framerate=1/10,format=i420" listener: test_play_rtpbin(){ gst-launch-1.0 --gst-debug=3 rtpbin name=rtpbin \ udpsrc port=25000 ! application/x-rtp,media=video,payload=26,clock-rate=90000,encoding-name=jpeg,width=1280,height=720 ! rtpbin.recv_rtp_sink_0 \ rtpbin ! rtpjpegdepay ! queue ! jpegparse ! jpegdec ! videoconvert ! fpsdisplaysink \ udpsrc port=25001 ! rtpbin.recv_rtcp_sink_0 \ rtpbin.send_rtcp_src_0 ! udpsink port=25005 host="192.168.0.33" sync=false async=false } publisher: test_record_rtpbin(){ gst-launch-1.0 --gst-debug=3 rtpbin name=t \ multifilesrc location=$sample loop=true ! queue ! $image_caps ! jpegparse ! $image_caps ! queue ! rtpjpegpay pt=26 ! application/x-rtp,media=video,payload=26,clock-rate...

android - How do get SQLiteDatabase in GreenDao 3 -

since update greendao 3, statements not work anymore: getdatabase().insert(tablename, null, values); getdatabase().delete(...); getdatabase().update(...); the getdatabase() greendao interface doesn't have insert, delete , update methods. thus, gives me compile time errors. solved issue? the class getting org.greenrobot.greendao.database.database , database abstraction meant greendao. have 2 options: you hold reference original sqlitedatabase , pass greendao during initialization. the database abstraction class has method getrawdatabase , returns underlying sqlitedatabase. if not using encryption, android.database.sqlite.sqlitedatabase. have cast.

Entering multiple lines of code to be run later at the Python REPL -

this question has answer here: python, writing multi line code in idle 4 answers i picked basic book today on programming. coding language python , have been trying out few hours i'm stuck, because can't figure out how write multiple lines of code. example, when write print("one") , hit enter, runs , prints word, one. how can have print word, one, , word, two, on line below it? also, when hit tab moves on 4 spaces, or so. can't figure out how have not run first command, , give me '>>>' on next line. guess i'm asking is: keystrokes need use like: >>> print("one") >>> print("two") thanks much! (sorry such basic question, i'm totally confused on one.) the python repl automatically executes each command typed in. why called "read-eval-print loop". accepts 1 input...

multithreading - Array Offset C++ pthreads return -

i running following code in c++. it runs expected, however, first result null in second loop...however, every ensuing result correct. pthread_t pthread_t_array[thread_count]; int ireturn[thread_count]; float chunk_elements[thread_count]; (int = 0; < thread_count; i++) { float vector_chunk[3] = {2.0,4.0,3.0}; pthread_t x; pthread_t_array[i] = x; ireturn[i] = pthread_create(&x,null,worker,(void *) vector_chunk); } (int = 0; < thread_count; i++) { void * result; ireturn[i] = pthread_join(pthread_t_array[i],&result); // lines below: @ = 0, result = null // however, @ every other value of i, 14 returned expected. if (result != null){ chunk_elements[i] = *(float *) result; } free(result); } the full code here . i not sure why there array offset (at line testing if result null--at = 0, result null, every other i, not). seems...

javascript - How do i change the name of menu 'Admin' in Mean.js -

i using mean.js app, , when log in admin see menu 'admin' showing up, change it's name users. in user/client/config/users-admin.client.menus.js have: 'use strict'; // configuring articles module angular.module('users.admin').run(['menus', function (menus) { menus.addsubmenuitem('topbar', 'admin', { title: 'manage users', state: 'admin.users' }); } ]); this sub-menu, dont see option change 'admin'. how achieve such thing, possible? i have attached screenshot of mean. screenshot

regex - sed: remove numbers from file -

i'm trying remove words file contain number attempt sed -r 's/\w*\d\w*//g' file.txt sample file.txt: 12.23 worda 01234 wordb wordc fe424 wordd a232efe424 worde 7 a232efe424 wordf wordg 7 a232efe424 wordh h5f desired ouput: worda wordb wordc wordd worde wordf wordg wordh sed oneliner sed -r 's/[^[:space:]]*[0-9][^[:space:]]* ?//g'

lambda - java-8 Stream of Map.entry to SortedMap with a custom comparator -

this method takes map values equal null , returns sortedmap of same keys, new values (obtained via objectivefitness) step 1. first, take keys input map , construct new hashmap same keys, new values objectivefitness(key). public sortedmap<integer[], integer> evaluate(map<integer[], integer> population, integer[] melody, integer[] mode) { map<integer[], integer> fitpop = new hashmap<>(); fitpop = population.keyset() //you have keys. .stream() .collect(collectors.tomap(p -> p, p -> this.objectivefitness(p))); step 2. next step use stream collect of entries hashmap sortedmap custom comparator. after reading oracle website: http://docs.oracle.com/javase/tutorial/collections/interfaces/order.html ...i found since want maintain sortedness of sortedmap based on other natural ordering of entries, need implement comparator 2 parts. i'll sorting based on fitness value, using key compare uniqueness. *also, want ca...

Write SQL Server query -

help me please query: select * sc84 nom join sc319 p on p.parentext = nom.id join sc219 pt on p.sp327 = pt.id join _1sconst c on c.objid=p.id as result approximately such table car / price_base / 08-08-2016:13-40 / 100 / car / price_base / 08-08-2016:14-40 / 150 / car / price_base / 08-09-2016:13-40 / 190 / car / price_super / 08-09-2016:18-40 / 210 / car / price_super / 08-10-2016:13-40 / 290 / i want return car / price_base / 08-09-2016:13-40 / 190 / car / price_super / 08-10-2016:13-40 / 290 / that good, types of price of date , value. prompt please how last (the current price each type of price , each goods) tried options group there not enough skill. nom.id - pk sku pt.id - pk price type p.id -pk price p.parentext - parent price (sku) p.sp327 - fk price type date = date column i using sql server 2008. table structure t=1sconst | ----columns------- name |descr |type|length|pre...

html5 - CSS border-bottom line not directly under text -

i started learning html5 in congruence css, , trying make own resume (exercise codecademy). issue subheading divs planning make, trying place black line underneath subheading text. there large gap in between line , text, however. #header { margin-top: -3.5px; background-color: #c3cdd4; height: 90px; width: 98.5%; position: relative; } #name { font-family:verdana, geneva, sans-serif; font-size: 40px; float: left; margin-left: 20px; margin-top: 20px; /*padding bottom: 50px;*/ } #address { font-family: verdana, geneva, sans-serif; float:right; margin-top: 25px; margin-right: 60px; } #contact { font-family: verdana, geneva, sans-serif; float: right; clear: left; margin-top:-60px; margin-right: 20px; } .subheader { position: relative; height: 100px; margin-left: 20px; margin-top: -2.5px; font-size: 20px; font-family: verdana; border-bottom: 1px solid; } <!doctype html> <ht...

javascript - How do I include jQuery in a project with babel, Node.js, and webpack? -

looking @ jquery documentation on npm , i'm confused have use it. know can include script tag in index.html use it, how else work? if choose not use script tag, understand can install node , import babel file want use jquery in. webpack come play? have use webpack's require if i'm not using babel, correct? webpack's require alternative babel's import? it seems either can use babel , node.js or webpack , node.js? thought babel , wepback serves separate purposes though, babel trans-compiling ecmascript 6 ecmascript 5 , webpack bundling files one. if i'm using webpack, babel, , node.js. best way include , use jquery? if plan on working anywhere without internet connection, go ahead , npm install minified version of jquery modules. otherwise, use cdn in html file easy global jquery access. doesn't make difference how include in project in terms of webpack/babel methods; sure stay consistent how import them. difference require ecmascript 5 , im...

c# - iTextsharp - Repeat a html table on top of every page -

i plan create invoice using itextsharp, inside invoice, consist of 3 parts table on top of page ( include vendor information) gridview (item of purchase) signature part (only in last page of invoice) so far complete gridview part using pdfptable + splitlate pdfptable table = new pdfptable(gv.columns.count); table.addcell(new pdfpcell(new phrase(celltext, fonth1))); ... ... //create pdf document document pdfdoc = new document(pagesize.a4, -30, -30, 15f, 15f); pdfwriter.getinstance(pdfdoc, response.outputstream); pdfdoc.open(); pdfdoc.add(table); pdfdoc.close(); response.contenttype = "application/pdf"; response.addheader("content-disposition", "attachment;" + "filename=gridviewexport.pdf"); response.cache.setcacheability(httpcacheability.nocache); response.write(pdfdoc); response.end(); but have no idea how insert tab...

Cut a part of a ring in Android Drawable -

Image
i have been trying , researching on how cut part of ring in android make percentage screen image below. have been trying use path, canvas, clipdrawable can't seem right. ideas how implement image below can cut part of circle show percentage difference on total screen?

uitabbar - How Can I style the colors in the AVPlayerViewController Tab Bar Menu on Apple TV? -

Image
the avplayerviewcontroller tab bar menu on apple tv following : it appears when swipe down on control. i want change background color orange. want change color of strings orange when it's focused. i able achieve in tabbarviewcontroller's tab bar following code : [uitabbaritem appearance] settitletextattributes:@{ nsforegroundcolorattributename : [uicolor whitecolor] } forstate:uicontrolstatenormal]; [[uitabbaritem appearance] settitletextattributes:@{ nsforegroundcolorattributename : [uicolor orangecolor] } forstate:uicontrolstatefocused]; [[uitabbar appearance] setbartintcolor:[uicolor blackcolor]]; [[uitabbar appearance] settintcolor:[uicolor blackcolor]]; how can achieve this?

android - Actionbar overlapping Scrollbar inside fragment -

Image
i have scrollview root view of fragment. it's child vertical linear layout 4 elements. first element image. issue image getting cut , can't seem scroll upwards. issue in landscape mode. following xml: <?xml version="1.0" encoding="utf-8"?> <scrollview xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="wrap_content" android:layout_width="match_parent"> <linearlayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:weightsum="4" android:orientation="vertical"> <imageview android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/logo_dark" android:id="@+id/imageview2" android:layout_gravity="center" /> ...

javascript - Trying to use Geocoder for several arrays of 100 addresses each one -

i use javascript program run geocoder latitude , longitude array of addresses 100 , run fine. however, if want process list of addresses more 100, have run program several times, each time filling array 100 addresses or less, until complete list. i try modify it, , split array in several arrays, each 1 of 100 addresses , run geocoder each array. however, executed last array, maybe because program run geocoder in recursive mode. is there way run geocode() several arrays? in example, try process array of 150 addresses, split in 2 arrays, 1 of 100 , other 1 of 50. here initialize variables: <script type="text/javascript"> var map = null; var geocoder = null; var addresses = null; /* array used geocode() function */ var current_address = 0; var geocode_results = new array(); var markers = new array(); var infowindows = new array(); var timeouts = 0; var geocodewait = 1000; //wait second betweeen requests function initialize() { var mapoptions = { ...