Posts

Showing posts from September, 2015

amazon web services - S3 and apache mod_proxy with basic authentication -

i'd redirect s3 bucket in ssl basic authentication of files (apk files) apache mod_proxy. ssl , mod_proxy work, basic authentication ignored. <virtualhost *:443> servername resources.mydomain.jp <filesmatch "\.apk$"> order deny,allow setenvif user-agent ".*android.*" allow_ag options followsymlinks allow env=allow_ag deny authtype basic authname "secret zone" authuserfile /etc/httpd/.htpasswd require user xxx_customer </filesmatch> sslengine on sslproxyengine on sslprotocol -all +sslv3 +tlsv1 sslciphersuite all:!adh:rc4+rsa:+high:+medium:-low:-sslv2:-exp sslcertificatefile conf.d/xxx.cer sslcertificatekeyfile conf.d/xxx.key sslcacertificatefile conf.d/xxx.cer proxypass / http://resources.mydomain.jp.s3-website-ap-zone-1.amazonaws.com/ proxypa

powershell - This solution contains one or more assemblies targeted for the global assembly cache -

Image
i having sharepoint site deployed through sharepoint powershell. wsp build through visual studio 2013. all projects in solution not signed assemblies(project->right click->properties->signing->sign assemblies check box unchecked). taking wsp of solution publishing , deploying sharepoint using sharepoint powershell. when try this, getting following error: when googled solution. many of them suggesting check 'sign assemblies' check box. don't want do, because facing other issues packages install through nugget. sign libraries of solution go properties of project click signing tab , check sign libraries options , create new strong name file or without password , rebuild , deploy.

Change font size on axis for excel chart with powershell -

Image
i want change font size axis values 11 9 on chart: the chart whole worksheet & have tried run macro tool , replicate in there change font size. vba: activechart.axes(xlvalue).select selection.format.textframe2.textrange.font .baselineoffset = 0 .size = 11 end i unable reproduce in powershell. have tried: $excel = new-object -comobject excel.application $ws = $excel.workbooks.open('file.xlsx').sheets('chart') $ws.axes().item(1).format.textframe2.textrange.font.size = 11 $ws.axes().item(2).format.textframe2.textrange.font.size = 11 but textframe2 object isn't initialized. i'm pretty stuck on how proceed. thanks

php - How can I loop over this multi dimensional array? -

so im trying loop on array of categories , sub-categories im having trouble foreach loop . once i've got array working im going create menu if hover on category, sub categories appear. put way, im hopeless @ logic side of things :| array along loops i've tried: $categories = array( 'arr' => array( 'cat'=>'sport', 'subcats'=> array( "surfing", "basketball", "nfl", "afl" ) ), 'arr' => array( 'cat'=>'automotive', 'subcats'=> array( "cars", "f1", "bikes", "etc" ) ), 'arr' => array( 'cat'=>'comedy', 'subcats'=> array( "stand up", "pranks", "...", "test"

ios - Regular spacing with AutoLayout -

this question may seem simple autolayout expert, still out of own usual autolayout usage. used play .top , .bottom , .left , .right , .centerx , .centery attributes. how do when dealing few objects? for example, if have 5 uilabel(s), , want them vertically aligned, regular spacing. x-axis part, easy: myxconstraint = nslayoutconstraint(item: label1, attribute: .centerx, relatedby: .equal, toitem: superview, attribute: .centerx, multiplier: 1.0, constant: 0.0); with constraint 1 on each of 5 labels, vertically aligned. but how should write other constraints, label1 appears @ top, label2, label3 ….. label5. , want space @ top, 1 @ bottom , spaces between each consecutive label same value. create 6 spacer views. refer here .

javascript - How to bind data from Controler to chartjs line chart to create it as dynamic? -

i using chart.js create chart data recive using linq query in controler , return values json far have tried , isnt getting values of json, here have tried far:- this controller:- [httppost] public jsonresult monthlyturnover(string info) { var list = (from c in nmsdc.datasends c.userid == session["userid"].tostring() && c.rcommission != null && c.dt.month == datetime.now.month group c new { c.userid, c.dt.date } g1 orderby g1.key.date descending select new monthlyturnoverchart { amount = g1.sum(item => item.value), nooftransaction = (int)g1.count(), //date = g1.key.date.toshortdatestring() }).tolist(); return json(list, jsonrequestbehavior.allowget); } and view , javascript follows:- <div class="col-md-6" style=&

How to install ruby on rails -

i newbie ruby on rails, here trying install ruby on rails on windows 7 64 bit. installed ruby installer , installed rails. , created new app files. when start rails server showing following errors. how can rid of these errors , start developing ruby application? c:\users\walnut\desktop > bundle install fetching gem metadata https://rubygems.org/............ fetching version metadata https://rubygems.org/... fetching dependency metadata https://rubygems.org/.. resolving dependencies................. using rake 10.4.2 using i18n 0.7.0 installing json 1.8.3 native extensions gem::installerror: 'json' native gem requires installed build tools. please update path include build tools or download devkit 'http://rubyinstaller.org/downloads' , follow instructions @ 'http://github.com/oneclick/rubyinstaller/wiki/development-kit' error occurred while installing json (1.8.3), , bundler cannot continue. make sure `gem install json -v '1.8.3'` succeeds be

c# - Convert AM/PM to small case letters -

i have string start's 7/28/2015 4:00 end's 7/31/2015 4:30 am . i want should convert am/pm am/pm pragmatically in c#... please me me! use string.tolower method this: datetime.now.tostring().tolower();

PHP parse error "syntax error, unexpected '['" -

this question has answer here: php parse/syntax errors; , how solve them? 12 answers i confused because wrote code , in virtual server php worked fine when download on server got parse error , don't know how deal it. error on line 8 $tosearch ,parse error: syntax error, unexpected '[' here code : <?php function decodename($name) { if (substr($name,0,2)=="p_") { $name = substr($name,2); } $tosearch=["_c_","_s_","_q_","_d_","_p_","_e_","_lp_","_rp_","_"]; $toreplace=[",","/","\"",".","-","=","(",")"," "]; ($i=0; $i<count($toreplace); $i++) { $name = str_replace($tosearch, $toreplace, $name); } retur

All messages in out queue failed to be delivered to broker when kafka brokers restarted -

i working on c++ kafka client: librdkafka. lib here https://github.com/edenhill/librdkafka/blob/master/examples/rdkafka_example.cpp . program writing 2000000 messages broker. during process, restarted broker. sometimes, no messages failed delivered broker. times 100,000 messages failed delivered broker. queue.buffering.max.messages=100000 . it seems messages in out queue lost? error rdkafka::message delivery report: local: unknown partition . i found new problems:(1) sometimes, 200 messages sent broker twice.(2) sometimes, message sent broker already, dr_cb() called. told me message failed delivered broker. trying figure out whether problem of broker or client. has similar problems? in fact, need reliable transmission , delivery reports between client , broker server. considering using c client now. not sure whether problem happens again... the log of broker is: [2015-07-21 17:48:33,471] info 0 elected leader (kafka.server.zookeeperleaderelector) [2015-07-21 17:48

.net - How can I determine the methods contributing to high memory utilization from dump files? -

i have several .dmp files containing memory captured our .net application hosted in iis, , want run them through kind of analyzer tell me methods contributing unexplained high memory utilization our application. i have tried debugdiag analysis tools come visual studio. can manage produce list of objects in memory, have no idea method generating objects. can direct me application can me figure out, or possibly instruct me on how use debugdiag or visual studio this? i have hit google as possible, have not been successful @ finding answers looking for. willing purchase tool if takes, confirmation whatever purchased able answer questions. tl;dr: it's not possible dump files. a good dump contain .net objects, can see types increasing, object not have call stack attached. in native world (c++), there feature of heap manager attach call stack object. it's called create user stack database , can enabled gflags tool, part of debugging tools windows . such f

html - Accidently Moved Public_Html to a folder in CPANEL X -

i accidentally moved public_html in folder wd, public_html cant moved home can moved folder. i using cpanelx if have root access of server can move public_html directory /home directory otherwise can not move , yes, need contact hosting support restore on original path.

import - How to execute only some functions from other python modules? -

[problem] want execute functions other python modules [input] module 1, module 2 module 1 includes: function called ( def a) function called ( def b) [module 2] includes: from module1 import b current: function , function b executed. desired: function b should executed. if have ideas please share. if import module has code outside class/function, code run. if module calls function outside definition, runs. consider not calling function in module file.

ios - 2 arrays into one dictionary while maintaining the indexes -

i have 2 separate arrays want import dictionary. order extremely important because both arrays must match in index struct myvariables { static var users:nsarray! static var img:nsarray! } var data = searchvc.getdata() myvariables.users = data.users; //array 1 (key) myvariables.img = data.img; //array 2 // goal insert these arrays dictionary while maintaing matching indexes on both arrays // dictonary (myvariables.img, key: myvariables.users) the key in dictionary in swift must hashable . i.e., not anyobject . assuming can replace of untyped swift arrays, or cast them so: struct myvariables { var users:array<anyobject> var img:array<string> } then can iterate through 1 array using preferred swift method , access second using indexing: var dictionary = dictionary<string, anyobject>() (index, element) in enumerate(myvariables.img) { dictionary[element] = myvariables.users[index] }

node.js - Approach of sending private messages to specific clients in SocketIO and Android -

i have problem sending private messages using socketio on nodejs server , android on client side. messages not reach specific endpoint have assigned , not understand why is. know each time user connects socketio, assigned specific socket id save in object alongside socket object using client name identifier. so: // register client server, providing username socket.on('init', function(data) { console.log("userid assigned socket: " + data.userid); // store reference socket id // data.userid identifier find respective client want send message to. connectedsockets[data.userid] = { id: socket.id, usersocket : socket }; // store reference socket console.log("new connected socketid: " + connectedsockets[data.userid].id + " socket object: " + connectedsockets[data.userid].usersocket); }); when sending private message, want retrieve object send respective person so: // send message user socket.on('privatemessage', function(data)

VIM undo: Why does the cursor jump to the wrong position when undoing `undojoin`? -

edits: i've simplified function , clarified question. original question still available further down page. crossposted onto vim_dev mailing list: https://groups.google.com/forum/#!topic/vim_dev/_rz3uvxbwsq reported bug neovim: https://github.com/neovim/neovim/issues/6276 why cursor positioned differently in following 2 examples: [correct cursor position] following test produces expected result substitution change joined previous change in buffer (addition of line 3), cursor position correctly restored second line in buffer. normal ggiline 1 full of aaaa set undolevels=10 " splits change separate undo blocks normal goline 2 full of bbbb set undolevels=10 normal goline 3 full of cccc set undolevels=10 undojoin keepjumps %s/aaaa/zzzz/ normal u [incorrect cursor position] following test produces unexpected result: substitution change joined previous change in buffer (addition of line 4), cursor position incorrectly restored first line in buffer (should

php - How to merge these two queries into one? -

quite simply... how can merge these 2 queries one? $sql = "update `data` set `views` = `views` + 1 `id`=$id , `source`='$source' , `keyword`='$keyword'"; $sql = "update `settings` set `count` = `count` + 1 `id`=$id"; edit: also, there's matter of first time data entered, when data update not yet exist in data table. my insert query: $sql = "insert `_data` (`id`, `source`, `keyword`, `views`) values ($id,'$source','$keyword',1)"; is possible combine insert of new data 1 table, update table? i suggest use prepared statements. $sql = "update data, settings set data.views = data.views+1, settings.count = settings.count+1, data.id = $id , data.source = $source , data.keyword = $keyword , settings.id = $id";

Change onclick event to onhover on export option in datatables -

i'm working jquery datatables , tabletools extension in export option working fine had requirement of instead of onclick should show dropdown menu on hover of export button. i tried these bootstrap dropdown hover nothing works. i believe not possible because of tabletools functionality implemented using adobe flash. due flash security restrictions there no way programmatically trigger export pdf or csv other let user click on button. see this answer more details.

go - Adding a method for existing type in Golang: how to rewrite return value's type -

i want extend existing goquery.selection type own method , able use package's selectors. know cannot "patch" existing method -- need create new one. how can force existing package functions use new type? i'm missing in general or there's no "nice" way , it's better use function? package main import ( "fmt" "github.com/puerkitobio/goquery" ) type customselection goquery.selection func (s *customselection) custommethod() int { return 1 } doc.find("*").each(func(i int, s *goquery.selection) { fmt.println(s.custommethod()) // not works since still "goquery.selection" // how can result customselection type here? }) since inheritance not supported, best practice embed non-local type own local type, , extend it. in design patterns lingo better known composition: https://en.wikipedia.org/wiki/composition_over_inheritance

How do you I register for Electronic Data Interchange (EDI) ISA number? -

i receive 850 purchase order. in return, need generate , send 997 response, include isa/gs number. , register isa id? thanks in advance edi systems typically limited in scope between few or 2 different organizations. these organizations need decide beforehand on how of full edi specification they're going use, , how they're going specify ids. see here . also, see here . looks duns numbers or variants on them common choices ids. so organization , others need figure out if you're going use duns number or ad-hoc made numbers or what.

javascript - Why the popup is not showing second time in leaflet marker -

i drawing marker in leaflet map , on clicking marker showing popup message. if click marker first time see popup message. if close popup message , again click marker don't see popup message though code enters inside on click event code block console message printed. here code of click event circle.on("click",function(ev){ var velocity=this.options.speed; console.log(velocity.tofixed(2)); var layer=ev.target; layer.bindpopup('speed: '+velocity.tofixed(2)); console.log("where pop"); layer.openpopup(); }); currently, you're creating popup each time when user click marker. probably, creating problem. you need use bindpopup() function once i.e when create marker . , use openpopup() inside click function. try this //place below 2 lines create marker var velocity=this.options.speed; //you might need change line speed value circle.bindpopup('speed: '+velocity.tofixed(2)); //open popup when user c

java - Auto Image Rotated from Portrait to Landscape -

i taking photo , storing sd card , , later viewing sd card imageview , getting rotated ... i capturing in portrait mode , getting resultant image in landscape mode ... is there missing ? exifutil.java class found here /** * displaying captured image/video on screen * */ private void previewmedia(boolean isimage) { // checking whether captured media image or video if (isimage) { imgpreview.setvisibility(view.visible); final bitmap bitmap = bitmapfactory.decodefile(filepath); bitmap orientedbitmap = exifutil.rotatebitmap(filepath, bitmap); imgpreview.setimagebitmap(orientedbitmap); } else { imgpreview.setvisibility(view.gone); } } but still showing rotated image in imageview ... you need use exif orientation_undefined right orientation. exifinterface exif = null; try { exif = new exifinterface(path); } catch (ioexception e) { e.printstacktrace(); } int orientation = exif.getattributeint(e

Rails 4: Can't get my dynamic table generation with JQuery get working -

i trying generate application produce table when search clicked seems not working. what have tried followings. controller: def index @q = link.ransack(params[:q]) @links = @q.result(distinct: true) respond_to |format| format.html # index.html.erb format.js #index.js.erb end end index.html.erb: <h1>listing links</h1> <!= implements search feature using gem "ransack" => <p><%= link_to 'advanced search', advanced_search_links_path %></p> <%= search_form_for @q, remote: true |f| %> <%= f.label :name_or_address_cont %> <%= f.search_field :name_or_address_cont %> <%= f.submit class: 'search_submit' %> <% end %> <div id = 'result_table'> </div> <script type="text/javascript"> var ready; var result_table = $('#result_table'); ready = function(){ $('.search_submit').click(function(event){ $('#result_table').replacewit

asp.net - Create Folder Structure to Organize Content in Umbraco -

i have many pages in content section of umbraco of pages organize departmental reference not hierarchical site reference. example, pages might a, b, c, d ... z on website on backend have various teams need content grouped together. i.e. team 1 folder has a-g in it. team 2 folder has h-q. team 3 has r-z in it. how can achieved instead of seeing content on root of content page see these 3 team folders? you have carefull in achieving this. when create new nodes under home root node, eg new pages or folders, referenced url. so if have page called a , accessed using url http://www.example.com/a . when create folders organize pages , place page a under hq , page accessed http://www.example.com/hq/a . after can use url rewriting rules avaid these folders indications in url messed if have many pages. i suggest if don't want see these folder indications in url, add nodes under home node , using permission allow/disallow departments nodes. if don't care fol

javascript - Returning Zipcode from Geolocation in Meteor -

<template name="home"> <a href="#" id="showmylocation">where i</a> <div id="location">postal address</div> <div id="zipcode">zip code</div> </template> i'm trying retrieve user's current address , zipcode using geolocation in meteor. or advice appreciated. this javascript meteor.startup(function() { googlemaps.load(); }); template.home.events({ 'click #showmylocation': function(event){ event.preventdefault(); $(this).html('determining address...'); navigator.geolocation.getcurrentposition(function (position){ var geocoder = new google.maps.geocoder(); var latlng = new google.maps.latlng(position.coords.latitude, position.coords.longitude); geocoder.geocode({ 'latlng': latlng}, function (results, status){ (var = 0; < results[0].address_components.length; i++) {

jquery - Adding a Second Custom Filter to datatables -

i using jquery datatables on rails application. add in second search box filter , use second filter fetch records using ajax. event trigger ajax functionality in datatables. achievable? example: html <input class="search2"> </input> <table class="trackable"> <thead> <th> col 1 </th> <th> col 2 </th> </thead> <tbody> </tbody> </table> js $j = jquery.noconflict(); $j(document).on("ready", document, function(e) { var mytable = $j('table.trackable').datatable({ "blengthchange": true, "bfilter": true, "binfo": true, "bpaginate": false, "bautowidth": true, "deferrender": true, "sdom": 'it<"clear">flrtp', }); $j('input

javascript - How to implement custom routes in sailsjs -

i'm trying understand sails.js. firstly try generate new api. code of models , controller coutries.js module.exports = { attributes: { title:{ type:'string', unique:true, primarykey:true }, cities:{ collection:'cities', via:'country' } } }; cities,js module.exports = { attributes: { title: { type:'string', unique:true, primarykey:true }, country:{ model:'countries', type:'string' }, description: { type:'string' } } }; next in routes.js wrote 'get /countries':'countriescontroller.getallcountries' i need list of countries. can not understand how implement function getallcountries in countriescontroller.js. use local db in tmp directory. please, can understand me in details how can this? understanding tell me how implement function addnewcountries , example update

android.database.sqlite.SQLiteException: near "Standards": syntax error (code 1) -

i'm new java , android development , whenever run activity , try add new record in database, sqliteexception error. i went through lot of documentation before asking here , searched answers on page couldn't find solution problem , appreciate if me find i'm missing here. my logcat: 07-21 19:29:13.060 1187-1187/com.lysandros.mars e/sqlitelog﹕ (1) near"standards": syntax error 07-21 19:29:13.099 1187-1187/com.lysandros.mars e/sqlitedatabase﹕ error inserting induction standards met=false business number= date of birth= workplace= notes= name= email= telephone number= sick pay=sickness pay job title=deputy manager address= surname= department= start date= android.database.sqlite.sqliteexception: near "standards": syntax error (code 1): , while compiling: insert employeetable(induction standards met,business number,date of birth,workplace,notes,name,email,telephone number,sick pay,job title,address,surname,department,start date) values (?,?,?,

ios - iPad app displaying iPhone screen size -

i working on app , has 3 storyboards - ipad, iphone , iphone 4. 3 different users (myself included) have had experience on ipad - splash screen loads small , in top-left corner...leaving white space right , bottom. it if loading iphone size splash. i have no launch screen file selected in general tab of project. have noticed after restarting ipad, seem load proper screen size. ideas going on? use line of code screen size. cgrect screen_size = [[uiscreen mainscreen]bounds];

android - Can't get appView after Update to cordova 5.1 from 3.4 -

i updated app cordova 5.1 , unable make web request js. the problem during compiling inside oncreate function of class extends cordovaactivity i used this super.appview.getsettings().setappcacheenabled(false) now says cast it... tried (webview)super.appview app crashed illegal cast i read this link , tried same (webview)super.appview.getengine().getview() still not able make web request.... on ios/desktop chrome works fine nothing wrong in js code you have webview cordova engine. webview webview = (webview) appview.getengine().getview();

Buttons disabling in a random order, Rails/javascript -

i have bunch of buttons, 3 in total. these buttons messing head ha, buttons disabling in weird order. if press button 2, it'll disable (it disables because submitting data database) once disables can click button 3 submit data won't disable. however. button 1 will. its kinda same other methods. if press button 3 it'll disable , can disable other two. if click button one, can't disable other 2 data submits fine. when explaining gentle? i've started rails haha! heres code; <div id="a" style="margin-right: 5px; float: left;"> <% if @conference_status.cross_charged_user_id.present? %> <button id="a" class="btn btn-primary" disabled="disabled">disabled</button> <% else %> <%= link_to 'cross charged client', admin_conference_status_path(@conference_status, status_name: 'cross_charged_use'), class: "btn btn-primary", method: :put, remot

android - notification led doesn't work -

notification.flags |= notification.flag_show_lights; notification.ledargb = color.blue; notification.ledonms = 1000; notification.ledoffms = 1000; notification.flags |= notification.flag_ongoing_event; notificationmanager.notify(notifyid, notification); the code work in app, doesn't work in another. led doesn't flash. answer appreciated. sorry careless, reaseon 1 line code: notification.defaults = notification.default_all; it means setting, include light, sound, vibration, follow system setting. because of this, code doesn't work. notification.flags |= notification.flag_show_lights; notification.ledargb = color.blue; notification.ledonms = 1000; notification.ledoffms = 1000;

regex - How does this sed command parse numbers with commas? -

i'm having difficulty understanding number-parsing sed command saw in this article : sed -i ':a;s/\b[0-9]\{3\}\>/,&/;ta' numbers.txt i'm sed newbie, i've been able figure out: & adds what's there rather substitutes the :a; ... ;ta calls substitution recursively on line until search finds no more returns here's hoping folks can explain what -i do? can't seem find on man pages though i'm sure it's there. i'm little fuzzy on \b accomplishing here? perhaps helps left-right parsing priority, don't see how. lastly... most importantly, why execute right left instead of left right? example, part of command keeps doing like: 1234566778,9 ---> 1234,566,778,9 the matching greedy, i.e. matches leftmost 3 digits not preceded word boundary , followed word boundary , i.e. rightmost 3 digits. after inserting comma, "goto" makes match again, comma introduced new word boundary, match happens e

javascript - pandas df into nested json -

quite similar question asked there , , brilliantly answered user1609452 in r. still, specific problematic. i'd expand question. let's take same table (mydata): id location l_size l_color station s_size s_color category c_size c_color 1 alpha 6 #000000 zeta 3 #333333 big 0.63 #306100 2 alpha 6 #000000 zeta 3 #333333 medium 0.43 #458b00 3 alpha 6 #000000 zeta 3 #333333 small 0.47 #6aa232 4 alpha 6 #000000 yota 3 #4c4c4c big 0.85 #306100 5 alpha 6 #000000 yota 3 #4c4c4c medium 0.19 #458b00 6 alpha 6 #000000 yota 3 #4c4c4c small 0.89 #6aa232 7 beta 6 #191919 theta 4 #666666 big 0.09 #306100 8 beta 6 #191919 theta 4 #666666 medium

html - Tap Highlight on iOS Safari -

i trying apply -webkit-tap-highlight-color css 2 elements. works on android chrome, refuses work on ios safari. <div class="right"> <input id="search-bar" class="" type="text"/> <div id="button-menu" class="right button-clickable"></div> <div id="button-search" class="right button-clickable"></div> </div> #button-search{ width: 60px; height: 48px; background-image: url(../images/svg/magnifying-glass.svg); background-repeat: no-repeat; background-size: 30px 30px; background-position: center; } #button-menu{ width: 60px; height: 48px; background-image: url(../images/svg/menu-dots.svg); background-repeat: no-repeat; background-size: 30px 30px; background-position: center; } .button-clickable{ -webkit-tap-highlight-color: #8f7e82; } is there need enable tap colors on safari on ios? tap

structured data - getting headline and datepublished required and missing errror in blogger -

while using structured data testing tool check structured data of blogger blog getting blogposting errors regarding date , headling. datepublished error in code <abbr class='published updated' itemprop='datepublished' title='2015-07-06t07:12:00-07:00'> and headline missing , required error in code <article class='post hentry' itemprop='blogpost' itemscope='itemscope' itemtype='http://schema.org/blogposting'> i have searched alot on google did not find solution please me in error. same happens me, seems testing tool bug, review article-specific usage guidelines , policies . can't recall exact data google updated structured data documentation earlier year. google didn't support article type rich snippets. in past optimize site in-depth articles feature. optimize site google recommended marking article type , recommended marking following properties (not required), headline alternative

Can I read languages supported by an android without rooting it? -

can read languages android device supports? know can read current language, want read languages. afaik, it's there in system/fonts. can access without rooting device? edit: tried locale on moto-g , list contains gujarati language, seems because v. 5.0.2 supports language, device not support gujarati font. need know fonts supported on particular device, can decide whether render them. this worked me! public void checksupportedfonts() { mlanguagefonts = new hashmap<string, string>(); mlanguagefonts.put("en-us", "ab"); mlanguagefonts.put("hi-in", "अआ"); mlanguagefonts.put("bn-in", "অআ"); mlanguagefonts.put("gu-in", "અઆ"); mlanguagefonts.put("mr-in", "अआ"); mlanguagefonts.put("ta-in", "அஆ"); mlanguagefonts.put("te-in", "అఆ"); mlanguagefonts.put("kn-in", "ಅಆ"); ml

Selenium Webdriver - Element not clickable error -

one of test case randomly failing in chrome driver i checking wait.until(expectedconditions.elementtobeclickable(ele)); have tried thread. sleep i following error..thanks.. org.openqa.selenium.webdriverexception: unknown error: element not clickable @ point (547, 498). other element receive click: ... (session info: chrome=43.0.2357.134) (driver info: chromedriver=2.15.322455 (ae8db840dac8d0c453355d3d922c91adfb61df8f),platform=mac os x 10.9.5 x86_64) (warning: server did not provide stacktrace information) command duration or timeout: 56 milliseconds build info: version: '2.43.1', revision: '5163bce', time: '2014-09-10 16:27:58' system info: host: 'maitris-macbook-pro.local', ip: '10.9.20.70', os.name: 'mac os x', os.arch: 'x86_64', os.version: '10.9.5', java.version: '1.7.0_71' session id: dba4c84dc3f18442e47aeae5d05e5655 driver info: org.openqa.selenium.chrome.chromedriver c

javascript - Programmatically get FontAwesome unicode value by name -

following steps outlined in this answer , setting cursor fontawesome icon. now, set cursor icon, class name (for example, fa-pencil ). accomplish this, seems need able programmatically lookup unicode value of given icon. i know these values listed in font-awesome.css stylesheet, avoid parsing file, if method exists. is possible? possibly late, allow this: elt.innerhtml = faunicode('pencil'); maybe can else searching same thing. function faunicode(name) {'use strict'; // create holding element (they tend use <i>, let's that) const testi = document.createelement('i'); // create realistic classname // - maybe 1 day need both, let's add them testi.classname = `fa fa-${name}`; // need append body have // pseudo element created document.body.appendchild(testi); // computed style const char = window.getcomputedstyle( testi, ':before' // add ':before' pseudo element ).content.replace(/&#

c# - Action<string> not garbage collected. Why? -

can't seem action collected gc. why? weakreference reference = null; weakreference reference2 = null; new action(() => { action<string> deliverymessage = (ans) => { }; object = new object(); reference = new weakreference(deliverymessage); reference2 = new weakreference(a); }) (); gc.collect(); gc.waitforpendingfinalizers(); assert.null(reference2.target); //true assert.null(reference.target); //false i'm going use action in weakreference list, need simple test go through first... the lambda expression not use captured variables transformed static method. optimization, prevent additional gc overhead caused allocations, static delegate field created. static field accessed when assignment executed. new delegate not created each time. static delegate, once initialized, never collected. can see viewing decompilation .

php - Yii2: sort a relational count column in GridView -

Image
[edited 2] i'm having hard time sort 'topiccount' defined relational getter on model 'tag'. topic can have lots of tag, , wish sort tags how many topics containing tag. in models/tag.php: public function gettopiccount() { return topictag::find()->where(['tag_id' => $this->id])->count(); } and in views/tag/index.php: <?= gridview::widget([ 'dataprovider' => $dataprovider, 'columns' => [ 'id', 'name', [ 'attribute'=>'topiccount', 'value' => 'topiccount', ], 'created_at', ['class' => 'yii\grid\actioncolumn','template' => '{view}',], ], ]); ?> and in controllers/tagcontroller.php: public function actionindex() { $dataprovider = new activedataprovider([ 'query' => tag::find(), 'sort&#