Posts

Showing posts from August, 2014

javascript - jquery switch to change what list is appended to -

i creating case / break loop change ul new li created in. have gotten pretty close when change variable reassign li should render value stored in variable stacks. can add li every ul there option for. here html <!doctype html> <html> <head> <link rel="stylesheet" type="text/css" href="stylesheet.css"/> <link href="https://fonts.googleapis.com/css?family=anton|baloo+tammudu" rel="stylesheet"> <script type="text/javascript" src="http://code.jquery.com/jquery- 1.9.1.min.js"></script> <script type="text/javascript" src="file:///c:/users/will/desktop/js_test/script.js"></script> </head> <body> <div class=app> <div id=menu_container> <div id=menu_title> menu </div> <input id="listinput" /></input> <button id="addtolist"...

sql - SQLCode=-138 flagging on large count tables but not small DB2 -

i built view in i'm using following code pull last name field formatted 'lastname,firstname': value(rtrim(substr(a.previous_names,1,locate(',', a.previous_names)-1)), '') "previous_name", this view worked fine working in our sandbox environment, moved test, , try open view in dbvisualizer, data results provide error: the second or third argument of substr or substring function out of range. sqlcode=-138, sqlstate=22011, driver=4.22.29 the sandbox has under 11k records, test , prod systems closer 1.2 million, i'm guessing performance issue result of complexity of piece of code. view still appears have been created, can query , return specific result/set of results, guess i'm concerned on if usable large query, or if performance concern in case? is there better way can parse last name without having use substring on locate function? thanks help! most not perfo...

c# - odataV4 filter contains with case sensitive and incase sensitive -

i have tried filter contains case sensitive in odata. not working. please find query string http://services.odata.org/v4/northwind/northwind.svc/employees/?$filter=contains(toupper(firstname),%27c%27) http://services.odata.org/v4/northwind/northwind.svc/employees/?$filter=contains(tolower(firstname),%27c%27) it return both lower , upper case . possible achieve?

IntelliJ Split Window Navigation -

if split editor window (horizontal or vertical) n tab groups, how switch/toggle 1 tab group via keyboard? if of tabs in same group can switch each tab (ctrl + right/left arrow), when they're in separate tab groups can't. i've searched through key mappings , have not found 1 seems accomplish this. know can use mouse, i'm trying find ways avoid mouse , stay keyboard. tia on this. ctrl+tab , ctrl+shift+tab window | goto next splitter , goto previous splitter . however, these hotkeys may taken switcher , need remap them in settings | keymap .

amazon web services - How to autoscale Servers in ECS? -

i started using ecs. able deploy container image in ecr , create task definition container cpu/memory limits. use case each container long running app (no webserver, no port mapping needed). containers spawned on demand 1 @ time , deleted on demand 1 @ time. i able create cluster n server instances. i'd able server instances automatically scale up/down. example if there isn't enough cpu/memory in cluster, i'd new instance created. and if there instance no containers running in it, i'd specific instance scaled down / deleted. avoid auto scale down termination of server instance has running tasks in it. what steps needed able achieve this? considering have ecs cluster created, aws provides instructions on scaling cluster instances cloudwatch alarms . assuming want scale cluster based on memory reservation, @ high level, need following: create launch configuration auto scaling group. create auto scaling group, size of cluster can scaled , down. cr...

android - How to update MVVMCross from 5.1.1 to 5.2.0 -

i updated mvvmcross 5.1.1 5.2.0 in sample project (tipcalc) android , uwp. nuget offered update updated using vs2017 nuget view. after 2 things happend:the upw designer tells me views:mvxwindowspage doesn't exist in namespace mvvmcross.uwp.views. have no longer working designer. rebuild brings these warnings ...tipcalc.ui.droid.csproj : warning xa0105: $(targetframeworkversion) mvvmcross.binding.droid.dll(v7.0) greater $(targetframeworkversion) project(v6.0). need increase $(targetframeworkversion) project. ...tipcalc.ui.droid.csproj : warning xa0105: $(targetframeworkversion) mvvmcross.droid.dll (v7.0) greater $(targetframeworkversion) project(v6.0). need increase $(targetframeworkversion) project. ...tipcalc.ui.droid.csproj : warning xa0105: $(targetframeworkversion) mvvmcross.platform.droid.dll (v7.0) greater $(targetframeworkversion) project(v6.0). need increase $(targetframeworkversion) project. starting on emulator crashes app. droid project set marshmellow (6.0)....

javascript - Validating input field based on radio input and display error message -

i'm trying display error message using jquery while submitting form, when radio button selected true , input box empty, reason failing. suggestions appreciated! <div class="row col-lg-offset-2 top-buffer"> <h4> <strong> <span>is account deleted?:</span> </strong> </h4> @html.radiobuttonfor(model => model.isdeleted, true) @html.label("yes") @html.radiobuttonfor(model => model.isdeleted, false) @html.label("no") <br> </div> <div class="row col-lg-offset-2 top-buffer" id="reason"> <div class="col-sm-2"> <b>reason delete:</b> </div> <div class="col-sm-10"> @html.textboxfor(model => model.reason, new { @class = "form-control", @id = "reason" }) <br /> </div> <div class="row col-sm-12"...

ruby - LDAP - How to add an entry to a groupOfUniqueNames? (ERR_250_ENTRY_ALREADY_EXISTS) -

i'm trying add new member of groupofuniquenames object "entry_already_exists" error. the server apacheds, , code ruby, using using net-ldap: ldap.add(dn: 'cn=janitors,dc=tidy,dc=example,dc=com', attributes: { :objectclass => "groupofuniquenames", :uniquemember => "uid=broom001,o=users,dc=tidy,dc=example,dc=com" } ) there 1 member in janitors -- mop99 . when call ldap.add, (reformatted readability): ldap.response: err_250_entry_already_exists cn=janitors,dc=tidy,dc=example,dc=com exists! openstruct { :code => 68, :error_message => "entry_already_exists: failed messagetype : add_request message id : 2 add request : entry dn[n]: cn=janitors,dc=tidy,dc=example,dc=com objectclass: groupofuniquenames ...

Reduce size of a SQLite database -

i created sqlite database yelp datasets client. resulting .db file 8.2gb in size, server optimized smaller databases -- 1gb or smaller, ideally ~100mb. how on earth shrink down 8.2gb database tiny size? if has thoughts, appreciate them. in advance!

PowerShell or VBS to move files older then 1 day and NOT open -

so i'm trying move files older 1 day local drive nas. problem robocopy not move files open /z /r:n /w:n stuff (it creates corrupted copy - not move). i've been looking on , haven't had luck finding other utility. there vbs script or powershell script can use that?

windows - cmd script, How to pass token variable(say %%a) to a call -

this first question please bare. serverlist= abc,def,xyz,.... each of these items comma seperated list b=apple,ball,cat... i have batch script has nested loop following setlocal enabledelayedexpansion %%a in ("%serverlist:,=" "%") ( /f "delims= " %%b in ( xxxxxxx) ( echo %%~a echo b %%~b call :header %%a %%b echo -------- ) ) :header ( echo inside header values %1 %2 ) output: --------------------------------------------- abc b apple,ball,cat inside header values "abc" apple -------- def b apple,ball,cat inside header values "def " apple -------- i need complete list of b in :header process further. of getting first element of b in call. putting formal answer comments: if arguments batch subroutine have spaces or commas, should quote arguments when call subroutine: call :header "%%a" "%%b" . (thanks aschipfl ) within subroutine, unquote arguments processing, u...

Why calling main() method from main() gives StackOverflowError in java? -

this question has answer here: what stackoverflowerror? 12 answers what causes stack overflow error? [duplicate] 10 answers i new java. had doubt in java since main() static in java, why can't call main() . class test { public static void main(string args[]) { main(null); } } once tried above code got stackoverflowerror. why did error main() static method(also method)? part of memory code filling up? please descriptive in answer.

http - Do regular and secure connections always use different ports? -

can server handle both regular tcp connections , tls secure connections single port number? or must make each 1 separately? i have used each port. , redirected http https if needed. i can't answer above questions because of lack of foundation. me. i not sure question is. however, if can server handle http , https 1 call, seem highly unlikely. making single call , call must address particular address , protocol. you may able send request parameters on server side send request secondary protocol. example, if sending request via http; pass parameters server side code utilize , then, make secondary call https. however, being said, why want use multiple protocols? think best first understand actual need , use case before proceed. cheers.

ruby on rails - How to change ckeditor backend from carrierwave to paperclip? -

i want change ckeditor backend carrierwave paperclip. how can go this. did rails generate ckeditor:install --orm=active_record --backend=carrierwave , generated necessary files. did rake db:migrate is there way uninstall ckeditor reinstall again? know need rails generate ckeditor:install --orm=active_record --backend=paperclip i'm not sure if running again replace it. i'm worried might break code.

debugging - "This page has no sources" when trying to debug a WebExtension on Firefox -

Image
i have created first webextension live in firefox add-on marketplace. however, doesn't seem work @ all, though see extension's icon in firefox toolbar. i tried enable add-on debugging explained here : and clicking on "debug" link in section corresponding extension: when that, believe called "browser toolbox" opens, nothing in "debugger tab", when reload page extension's content script supposed match. i tried both firefox , firefox developer edition, on ubuntu. i tried inspect variables add-on supposed set in "console" tab, none of them defined. am using correct tool debug extension ?

java - JPA abstract generics UNION error in PostgreSQL while querying -

i have abstract class: @entity @inheritance(strategy = inheritancetype.table_per_class) public abstract class fieldvalue<t> { @id @generatedvalue(strategy = generationtype.table) @getter @setter private int id; @transient @getter @setter private t value; } and following extensions of class: @entity @inheritance(strategy = inheritancetype.table_per_class) public class datefieldvalue extends fieldvalue<date> { @access(accesstype.property) @override public date getvalue() { return super.getvalue(); } } and: @entity @inheritance(strategy = inheritancetype.table_per_class) public class integerfieldvalue extends fieldvalue<integer> { @access(accesstype.property) @override public integer getvalue() { return super.getvalue(); } } the creation of whole database schema runs correctly, there table created each extension class of abstract class. can save , update entities. however, when q...

Angular Material 2 Tab Links unable to set default active tab -

after successful login on login page, route changes "inbound" view, has 2 tabs in navbar, "inbound" , "outbound". i'd "inbound" navtab selected reflect state of router. however, after implementing this demo, still isn't selected default html: <nav md-tab-nav-bar *ngif="!router.url.includes('login')"> <a md-tab-link *ngfor="let tablink of tablinks; let = index" [routerlink]="tablink.link" routerlinkactive #rla="routerlinkactive" [active]="rla.isactive"> {{tablink.label}} </a> </nav> component: import { component } '@angular/core'; import { router } '@angular/router'; import { mdtab, mdtablink } '@angular/material'; @component({ selector: 'header', templateurl: ...

robotframework - Set relative Path to access Directory of Robot Suite dynamically -

my project designed below robotframework |_api |_resources- keywords.robot | | |_testdir |_testdir1 | |_testcase1 | | |_data1.py | | |_data2.py | |_testcase2 | | |_data3.py | | |_data4.py | | | |___testdir1_integration_suite.robot | |_testdir2... . . and on testdir1_integration_suite.robot suite has both testcase1 , testcase2, when run suite, runs cases within testdir1. within testdir1_integration_suite.robot looks this: *** testcases *** testcase1 start test [documentation] send request ${conf} check response ${conf} testcase2 start test [documentation] send request ${conf} check response ${conf} i want define keyword start test in resources file keywords.robot. not able specify directory testdir1, testdir2 dynamically in relative path. not sure how it. in key...

linux - HdfsIOException: Build pipeline to recovery block failed: all datanodes are bad -

i have file in hdfs has 8 billion records , when flushing internal table encountered following error. hdfsioexception: build pipeline recovery block [block pool id: bp-2080382728-10.3.50.10-1444849419015 block id 1076905963_3642418] failed: datanodes bad. we tried setting pipeline recovery parameters dfs.client.block.write.replace-datanode-on-failure.enable true, dfs.client.block.write.replace-datanode-on-failure.policy default , dfs.client.block.write.replace-datanode-on-failure.best-effort true( , know setting lead data loss in case when data nodes go down) still wanted give try , run our insert process smoothly .however, didn't worked. here complete stack trace error. enter code here 2017-09-13 00:06:27,099 warn datanode.datanode (blockreceiver.java:receivepacket(520)) - slow blockreceiver write packet mirror took 2247ms (threshold=300ms) 2017-09-13 00:06:27,601 warn datanode.datanode (blockreceiver.java:receivepacket(520)) - slow blockreceiver write packet mirror ...

project reactor - Error Handling Asynchronous Events with a ConnectableFlux -

i have similar requirement author of post: handling errors in fluxsink continuously emits events . i have implemented concatmap individually handle errors event handlers. however, have requirement have 2 operations occur asynchronously in parallel, before continuing next operation. therefore in code below, need modify handler2 , handler3 occur in parallel before proceeding handler4, instead of synchronously executing. flux<objectfromqueue> flux = flux.create(fluxsink -> { messagelistener.setfluxsink(fluxsink); //messagelistener has 'process' method invoked there new message on queue. }, fluxsink.overflowstrategy.buffer); connectableflux<objectfromqueue> connectableflux = flux.publish(); connectableflux .concatmap(v -> mono.just(handler1.handle(v)) .doonerror(errorhandler::handle) .onerrorresume(mono.empty()) .concatmap(v -> mono.just(handler2.handle(v)) .doonerror(errorhandler::handle) ...

jquery - How to wrap anchor around HTML on tinyMCE -

well have problem, made few custom buttons tinymce wordpress editor insert html user wouldn't confused shortcodes. works relativly ok... there button wraps anchor div. <a name="buton" class="prod-button" href="some-href"> <div> ... </div> </a> the problem when content inserted editor, ancho erased. it not problem of button, how tinymce configurated believe, because happens when write html directly in editor i've done , didn't work tinymce.init({ allow_html_in_named_anchor: true, valid_children: '+a[div],+a[span],+a[img]', extended_valid_elements : "a[*]", }); any ideas? in opinion best solution insert form creating short code. so, can load form sidebar , use short code display form content. this documentation https://codex.wordpress.org/shortcode_api regards. ed

Bootstrap Tabs as Hugo Shortcodes -

i trying create shortcode bootstrap tabs. have following html structure, <nav class="nav nav-tabs" id="mytab" role="tablist"> <a class="nav-item nav-link" id="{{ .get `id` }}-tab" data-toggle="tab" href="#{{ .get `id` }}" role="tab" aria-controls="{{ .get `id` }}"> {{ .get "title" }} </a> </nav> <div class="tab-content" id="nav-tabcontent"> <div class="tab-pane fade" id="{{ .get `id` }}" role="tabpanel" aria-labelledby="{{ .get `id` }}-tab"> {{ .inner }} </div> </div> the structure contains hugo placeholder. inner part of code, is, <a class="nav-item nav-link" id="{{ .get `id` }}-tab" data-toggle="tab" href="#{{ .get `id` }}" role="tab" aria-controls="{{ .get `id` }}"> {{ .get ...

python 3.x - Can't create s3 resource/client in boto3 -

edit: believe traceback stems sort of issue dependencies. using pip upgrade packages didn't work created new folder , installed scratch , worked out i'm python novice i'm struggling debug aws lambda i'm writing. i've narrowed down line of code s3_client = botosession.resource('s3') , giving long traceback syntax error: invalid syntax. botosession variable credentials - botosession = boto3.session.session(aws_access_token, aws_secret_access_token) . i've tried s3_client = boto3.client('s3') , s3_client = boto3.resource('s3') , s3_client = botosession.resource('s3') . when used botosession.client('ses', region) had no issues sending emails. i found error: client = boto3.client('s3') | aws elastic beanstalk worker environment appeared similar issue, appeared old , wasn't able figure out solution was. tried adding import sys sys.path = [p p in sys.path if not p.endswith('futures-3.0.3-py3.4.egg...

android - Picasso resize on different screens -

i'm downloading pictures server, pictures not same (their resolution), want hardsize them picture error() method (it's 50x50 px). when tested code picasso.with(context) .load(url) .error(r.drawable.non_pic) .resize(100, 100) .into(holder.user_icon); i noticed, on meizu pro 6 (diag = 5.2, ppi = 424, 1920x1080) , on emulator, based on nexus 4 (diag = 4.7, 1280×768) there different sizes of images after resize(). on meizu image small, on emulator has same size picture error() (and it's strange me, cause non_pic png file 50x50 pixels resolution). so, how can hardset image size same non_pic parameters? it's because using px measurement. try use dp/dpi instead. here method how can convert px dp public static float convertpixelstodp(float px, context context){ resources resources = context.getresources(); displaymetrics metrics = resources.getdisplaymetrics(); float dp = px / ((float)metrics.densitydpi / displa...

jquery - Get the ids of the menu items in the level 1 panel -

currently using openpanel open right panel depending on page's url. switch ( this.filenameurl ) { case 'page1.html' : this.api.openpanel( $("#mm-1") ); break; case 'page2.html' : this.api.openpanel( $("#mm-12") ); break; case 'page3.html' : this.api.openpanel( $("#mm-71") ); break; case 'page4.html' : this.api.openpanel( $("#mm-137") ); break; case 'page5.html' : this.api.openpanel( $("#mm-146") ); break; } this.api.open(); it works fine. challenge if page added or removed or moved #mm-## change. is there better way more dynamic?

In HBase is it possible to set CELL level TTL during bulk upload? -

i think possible set cell level ttl using mutation however, there way set cell level ttl when doing bulk upload?

Python: ValueError: I/O operation on closed file on csv file -

when run following code: def read_s_par_csv(file_name): open(file_name,'r') csvdatafile: csvreader = csv.reader(csvdatafile) vg = [] vd = [] row in csvreader: vg.append(row[0]) vd.append(row[1]) return vg,vd if __name__ == '__main__': vg,vd = read_s_par_csv('./s_par_test.csv') print(vg) i following error traceback (most recent call last): file "..", line 201, in vg,vd = read_s_par_csv('./s_par_test.csv') file "..", line 189, in read_s_par_csv row in csvreader: valueerror: i/o operation on closed file

ios - Sharing Image on Twitter via UIActivityController is not working -

we developing feature in our app in trying tweet image. when app installed, in preview of tweet, image not shown. while if app not installed, shows image thumbnail in preview of tweet. in installed app case, tweet doesn’t posted well. posting screenshots both scenarios. wanted know if problem described here related issue pointed above , updates on issue. wanted know if related issue first reported in https://twittercommunity.com/t/bug-in-ios-twitter-app-when-sharing-images-as-nsurl-with-uiactivityviewcontroller/63252/2

Adding a NEW custom controller scaffold in ASP.Net Core 2 -

the question custom scaffold templates in asp.net core provides describes how customize scaffolding templates. per comments in accepted answer, how register new scaffolder appears in add=>controller context menu options?

html5 - css hexagon; Chrome vs Firefox different size :before/after -

Image
i'm trying make hexagon, reason different sizes in chrome , firefox. check out fiddle: https://jsfiddle.net/aa7o6m2l/ #packages .hexagon { margin:-42px auto; width:65px; height:65px; position: relative; line-height: 1.428; } #packages .hexagon:after { font-family:arial; position: absolute; z-index: 1; top: -36px; left: -6px; content: "⬢"; color: rgba(2, 135, 160, 1); font-size: 86px; line-height: 1.428; } #packages .hexagon:before { font-family:arial; position: absolute; z-index: 0; top: -37px; left: -6px; content: "⬢"; color: #fff; transform: scale(1.09, 1.09); font-size: 86px; line-height: 1.428; } #packages .hexagon span { z-index: 200; margin: 24px auto 0; font-size: 1.3em; color: #fff; } i've set font-family, font-size, line-height. any other ideas or suggestions great. thanks, brandon the problem unicode hexagon rendering differe...

javascript - How to merge data from D3.js Topojson to defined set to set class -

so i'm using topojson functionality of d3.js create svg world map. i've managed figure out scale , far despite being relatively new d3. issue i'm having attempting merge or filter data topojson file sets have defined. i'm going leave out functions used projection. here's have far: var svg = d3.select("#map svg"); var regions = [ { region: 'low', set: d3.set([ "usa", "can" ]) }, { region: 'med', set: d3.set([ "aus" ]) }, { region: 'high', set: d3.set([ "rus" ]) } ]; d3.json("site/js/topo.json", function(error, topology) { // individual countries svg.selectall("path") .data(topojson.feature(topology, topology.objects.worldbyiso).features) .enter() .append("path") .attr("data-iso", function(d){ return d.properties.iso; }...

python - word fragments checker with a list and for loop analyzer -

i'm trying make semi-word analyzer, here code: score = 0 letter_combos = ["hel","goo","the"] sentence = input("please enter sentence anaysing!") length = len(sentence) letter_combos in range (0, length): score += 1 print(score) the idea is, if entered "hello there i'm today" should display score 3 printing length of sentence. on i've done wrong , need fix? the pythonic way of solving problem use list comprehension: letter_combos = ["hel", "goo", "the"] sentence = input("please enter sentence analyzing: ") score = sum(sentence.count(fragment) fragment in letter_combos)

jquery - On Button Click, a DIV Fades Out, While Another DIV Fades in at the Same Location -

i have functioning image slider floated next unordered list of (3) divs. first color of slider corresponds first div. i'm trying create effect whereby when clicks 'next' button on slider, not slider transition next color, div floated next fade out, while next div, corresponds next color fades in. i have slider working, i'm having difficulty figuring out how allow each click of button continuously loop through each div corresponds colors of slider. i'm relative beginner jquery, can understand of more complex logic, can't figure out. tried making overflow of div's hidden, , follow same process of image slider, no luck. i'd appreciate help. jsfiddle of have far below. <ul id="slide_info"> <div id="info1"> <h2>blue header</h2> <p>description</p> </div> <div id="info2"> <h2>red header</h2> <p>descri...

mysql - Database - handling of unique constraint violation -

i have user creation screen takes various user details along first name , mobile number. have corresponding user table in first name , mobile number form composite unique key. there other integrity constraints defined on table well. when user data entered on create user screen violates constraint, user needs shown 'user friendly' error message. when such violation occurs, exception mysql database is: com.mysql.jdbc.exceptions.jdbc4.mysqlintegrityconstraintviolationexception: duplicate entry '1-1' key `uk_first_name__mobile_idx` there 2 options show meaningful message (for example: "error: user name exists given mobile number, please change either 1 of them"). option 1: in catch block of exception, parse mysql exception's message , 'uk_first_name__mobile_idx'. if present, show user friendly message mentioned above. option 2: write dao level api take first name , mobile number 2 parameters, fire database query see if there existing...

tensorflow - Dataset distributed tensor flow iterator -

iterator local variable doesn't share index across multiple devices , neither restore checkpoint. useful in using large input data share index across multiple devices , restore index checkpoint. there work-around using tf.contrib.data.dataser multi-device environment or did missing feature of dataset apis? here test code snippet. def pipeline(): dataset1 = tf.contrib.data.dataset.range(100)#.shuffle(10).repeat() dataset2 = tf.contrib.data.dataset.range(100)#.shuffle(10).repeat() dataset = tf.contrib.data.dataset.zip((dataset1, dataset2))#.batch(10) iterator = dataset.make_initializable_iterator(shared_name='shuffled_idx') return iterator test_ops = [] device, target = device_and_target() tf.device(device): global_step = tf.variable(tf.constant(0), trainable=false, name='global_step') apply_updates = state_ops.assign_add(global_step, 1).op test_ops.append(apply_updates) iterator = pipeline() get_next = iterator.get_...

javascript - How to create array for getelementbyid to div more than 2 id of images for perspective tranformation with matrix 3 d -

i new , not experienced coding, have been trying many different ways of array converting getelementbyid('screen') to class or array, can have more 1 image when using `, nothing seem work. tried below code, can shed light on wrong. original script fine, cannot seem add more 1 image perspective transformation. ve tried many , lost track use advises regarding id class etc.. thanks here link http://jsfiddle.net/rjw57/a6pgy/ var imgelement = document.getelementbyid('screen'); imgelement.style.display = 'none'; var screenimgelement = new image(); screenimgelement.crossorigin = ''; screenimgelement.onload = loadscreentexture; screenimgelement.src = imgelement.src;

android - Could not find kotlin-reflect.jar (org.jetbrains.kotlin:kotlin-reflect:1.1.3-2) -

hi guys build project on android studio 2.3.3 , open on android studio 3.0, error, how fix that? not find kotlin-reflect.jar (org.jetbrains.kotlin:kotlin-reflect:1.1.3-2). searched in following locations: file:/applications/android studio 3.0 preview.app/contents/gradle/m2repository/org/jetbrains/kotlin/kotlin-reflect/1.1.3-2/kotlin-reflect-1.1.3-2.jar

Why won't this SVG's fonts render on Wikipedia? -

Image
the following file has been uploaded several times different fonts (e.g. serif , liberation serif ) in ring. however, resulted in text missing. currently, workaround pre-render fonts , upload rasterized, not ideal. at first thought might've been drawing tool (inkscape) not generating xml, looked @ , font-family attribute set. so why isn't wikipedia rendering correctly? surely font-family:serif generic enough engine. intended render: wikipedia's render:

changing php array to show distinct value and array of product ids -

i'm not sure start one, , brain fried right now. thought i'd ask help! i'm working on opencart site, , i'm trying change array groups product_ids categories. here's array it's spitting out: array ( [0] => array ( [product_id] => 50 [category] => shop carton ) [1] => array ( [product_id] => 52 [category] => shop carton ) [2] => array ( [product_id] => 53 [category] => shop carton ) [3] => array ( [product_id] => 54 [category] => shop carton ) [4] => array ( [product_id] => 55 [category] => shop box ) [5] => array ( [product_id] => 56 [category] => shop box ) [6] => array ( [product_id] => 57 [cat...

java - Drag/Moving a shape around jPanel -

yesterday ask question how draw bounding box hold shape inside , how drag , drop selected shape . the first question solved. i'm having trouble move shape. there especific transformations move shape around jpanel? i have code: public boolean drag(mouseevent e) { if(points.isempty()) //if point's vector empty return false; if(!selected) return false; int x = e.getx(), y = e.getx(); if (!dragging) lastmovepoint.setlocation(x, y); dragging = true; int deslocx = 0; int deslocy = 0; int oldx = -1; int oldy = -1; int size = points.size(); for(int = 0; < size; i++) { oldx = lastmovepoint.x; oldy = lastmovepoint.y; deslocx = x - oldx; deslocy = y - oldy; points.set(i, new point(points.get(i).x + deslocx, points.get(i).y + deslocy)); //set vector of points when there repaint() repaints shape new //coordinates } lastmovepoint.setlocation(x, y); //se...

pocketsphinx - No module named _pocketsphinx -

i trying on respeaker, when want import pocketsphinx, wrong, think maybe .so file not match openwrt ,so can do. python: '/usr/lib/python2.7/site-packages/pocketsphinx/_pocketsphinx.so' not elf file error no module named _pocketsphinx anyone have idea? the file not match os architecture, compiled different os. you can try install proper version or compile software source.

How much time Google takes to unpublish an GSuite marketplace app from Chrome web store developer dashboard -

its been 3 weeks app (gsuite spreadsheet add-on) in "pending review" state after unpublishing through chrome web store developer dashboard. don't know why visible in marketplace when requested google unpublishing item. query: 3 weeks gone, idea how max time google takes unpublish gsuite marketplace app chrome web store developer dashboard? here related so post unpublished apps in web store. see full answer post: if app unpublished not available download, not appear in in-store search results, , cannot installed store. no details information google play can received direct url application. unpublishing not affect existing installations (so apps not automatically removed device got installed already). existing users still able update if on older version. and cannot have application same package name, no matter what. edit please note unpublish (and means name says, nothing more) not apk - hide related stuff (app'...

graph - floyd warshall running time complexity in terms of edges -

express running time Θ() of floyd-warshall algorithm pairs shortest path problem graph g(v, e): i. in terms of number of vertices v in g. ii. in terms of number of edges e in dense graph g. iii. in terms of number of edges e in sparse graph g. for number i. o(v^3) . ( correct me if im wrong ). number ii , iii. not find way it. still o(e^3) both? in standard implementation of floyd-warshall algorithm, there 3 nested loops run through vertices of graph. gives time complexity of o(v^3) said, , independent of size of e. if define dense graph 1 e ~ v^2 , sparse graph 1 e ~ v, answers (ii) , (iii) o(e^(3/2)) , o(e^3) respectively.

Python IndexError: index 16 is out of bounds for axis 0 with size 16 -

i wish use ascii file contains data arranged in several columns , rows (20 columns, 2737 rows). wish plot data 1 column against another. use code: import numpy np import matplotlib.pyplot plt numpy import * import math def plot(matrix): # counter naming images = 0 # color scheme color = np.array([0.4, 0.4, 0.4]) # each row, plot row in matrix: counter = 0 x = [] y = [] # uptill end of columns while counter < 20: y.append(row[counter]) x.append(row[counter + 1]) counter += 2 t = linspace(1e11, 3e13, 10000) b = y[2] * (2 * 6.626e-34 * t * t * t / 9e16) * (1 / (exp(6.626e-34 * t / (1.38e-23 * y[1])) - 1)) * (t**x[1]) print (b) l = 3e14 * 4.042 / t c = 3e14 / t plt.plot(l, b, label='shifted spectrum') plt.plot(c, b, label='restframe spectrum') # scatter plot #plt.scatter(y[3], x[2], c=color) ...

how to download pdf file from json in swift and alamofire in ios? -

how download pdf file in ios using swift 3.0 , alamofire . can able fetch url nsurlsession. looking alamofire code. please see code. func downloadpdffile(_ sender : uibutton) { print(sender.tag) print("array values cell",totalsyllabusarray.object(at: sender.tag)) var localdic :nsdictionary! localdic = totalsyllabusarray.object(at: sender.tag) as! nsdictionary let filepath = localdic["filepath"] as! string print("pressed ") let strurl1:string = fetch_inmegh_image_baseurl + filepath print("strurl1 ",strurl1) let pathurl = url(string: strurl1)! let sessionconfig = urlsessionconfiguration.default let session = urlsession(configuration: sessionconfig) let request = try! urlrequest(url: pathurl, method: .get) let task = session.downloadtask(with: request) { (templocalurl, response, error) in if let templocalurl = templocalurl, error == nil { // success if let stat...

Firebase find .info/connected of another user -

any idea how find online status of other users firebase realtime database? if .info/connected of current user, receive user's status, how find same of user? say joe. joe knows status 'info/connected'. joe want status of john. how joe info/connected of john? way make happen? .info/connected not meant used detect online/offline state of other users. its main purpose app know if connected/disconnected firebase database. from documentation : /.info/connected boolean value not synchronized between realtime database clients because value dependent on state of client. in other words, if 1 client reads /.info/connected false, no guarantee separate client read false. the best way check if other users online would create entry in database everytime user logs in , depending on value show if user online or offline. the following tutorial might helpful : https://www.youtube.com/watch?v=xqowbpadoza&t=1s

red - Rebol code gui working but not clearing fields -

i trying following code user enters 2 numbers , on clicking calculate button, answer should shown. there buttons clearing fields , exiting. rebol[] fields: [f-ht f-wt ans] reset-fields: [ unfocus f-ht/text: " " ; changing "enter number here" not f-wt/text: " " focus f-ht ] oncalc: [ ans/text: (to integer! f-wt/text) / ((100 * integer! f-ht/text) * (100 * integer! f-ht/text)) show fields ] lo: layout [ style tx label 200x24 center style fld field 200x24 center style btn button 200x24 center tx "first number:" f-ht: fld tx "second number:" f-wt: fld btn "calculate" [oncalc] ans: tx "answer" btn "clear" [reset-fields show fields] ; not working- nothing happens btn "exit" escape [unview/only lo] ] reset-fields view center-face lo the gui showing right. however, there following problems: on c...

How coud I create these kind of Button using Java Swing? -

Image
i want create button without borders or shadow , icon instead using java swing component. how can accomplish this? real button jbutton btnnewbutton = new jbutton(""); btnnewbutton.setcontentareafilled(false); btnnewbutton.setborderpainted(false); btnnewbutton.setborder(null); btnnewbutton.seticon(new imageicon(path)); this give real button without borders around given image work with. note in state button doesn't have "click animation" anymore. such animation use .setselectedicon(selectedicon); clickable image imageicon img = new imageicon(path); jlabel button = new jlabel(img); button.addmouselistener(new mouseadapter() { public void mouseclicked(mouseevent e) { //set pressed or else } }); but 1 provide clickable image , should used when clickable image without other intentions needed. note way workaround.

python - Sort a list of entries according to a given column and return the list of indices -

given list of entries (e.g. pieces of data, tuples), how sort list according 1 column (feature, e.g. int) , return not entire sorted list of entries, list of original indices (like in function np.argsort() )? i tried use lambda expressions not know how incoporate indices feature: list1sorted=sorted(list1, key=lambda x: x[1]) import pandas pd lst = [13,6,3,2,1,7,6,8] othr = [5,2,7,9,2,5,7,10] df = pd.dataframe({"list1": lst, "list2": othr}) result = df.sort_values("list1") here ldf contain 2 lists, sorted list1 , can find indices index ( result.index ) of dataframe.

c++ - How to define a friend function declared in a non template class internal to a template class outside of both classes? -

i found "how define friend template function of template class outside of declaration" ( so / cppreference ), how if add internal non template class in mix? i.e. how (externally) define operator<< declared in class internal following example: #include <iostream> template <typename t> class external { public: explicit external(t initial) : value{initial} {} class internal { public: internal(const external& e) : internal_value{e.value} {} private: friend std::ostream& operator<<(std::ostream& os, const internal& i); // ^^^ 1 /* body { return os << i.internal_value; } */ t internal_value; }; friend std::ostream& operator<<(std::ostream& os, const external& e) { return os << internal{e}; } private: t value; }; int main() { std::cout << external<int>{5}; }...

jquery - Datatables:Trying to get selected radio buttons values of each table row in csv format -

Image
i using jquery datatable plugin. trying selected radio button values in csv (comma separated values) format. there many records, pagination using. when select radio buttons on first page, can selected radio buttons values in csv. it's working fine. when go second page , select radio buttons, problem here occurs. getting selected radio buttons on second page first-page radio buttons value vanish. similarly, getting third page selected radio buttons values second page selected values gone , on... have attached image more elaboration: in short, trying selected radio button values of pages (or on pages user select radio buttons) in csv format. following jquery code using selected radio button values: var stateids = $('.status:checked').map(function() { return this.id; }).get().join(','); is there datatable api method work done? i've created fiddle check here $('.select-first').on('change', function(e) { aler...

android - Twilio intent EXTRA Always null -

i`m using twilio client sdk. call between client; demo works fine. in project intent`s extra_data allways null. here pending intent: intent intent = new intent(activity, twiliobroadcaster.class); intent.putextra(callactivity.is_out_call, false); pendingintent pendingintent = pendingintent.getbroadcast(activity, 0, intent, pendingintent.flag_update_current); clientdevice.setincomingintent(pendingintent); and in broadcastreceiver: device device = intent.getparcelableextra(device.extra_device); connection incomingconnection = intent.getparcelableextra(device.extra_connection); log.e("test", "hasdevice = "+intent.hasextra(device.extra_device)); log.e("test", "hasconnection = "+intent.hasextra(device.extra_connection)); if (incomingconnection == null && device == null) { return; } pendingconnectio...