Posts

Showing posts from June, 2010

html - Any way to transform a block style/CSS to inline CSS? -

i'm writing html/css email template triggered gmail , other mails. however, gmail not load <style> blocks, have use inline 'style' attribute make work. to illustrate problem: <style> .center { text-align:center; } </style> <a class="center"> text </a> transform to: <a class="center" style="text-align:center;"> text </a> does here know better way or program doing it? there web app designed job. converts css rules inline style attributes https://inlinestyler.torchbox.com/

sockets - Port number handling on a multi user Windows server -

i working on tool run multiple users on same terminal server. tools uses tcp sockets ipc between multiple processes. multiple instances of tool running @ same by multiple logged in users, want know how ports managed on windows server? in, concept of virtual ports os can map system wide unique port or tools running different users need handle in user space? the instances of tool need listen @ different port numbers, or same number @ different ip addresses. [assuming listening @ all, isn't stated, actual source of concern.]

JSON output in Bottle, Python and MongoDB -

i running bottle , python pull data mongodb. output comes in json object format. used have following {u'product': u'mortgage', u'total_product': 146533} {u'product': u'debt collection', u'total_product': 65639} but wanted rid of 'u , following format: 'product':'mortgage', total_product: 146533 'product':'debt collection' 'total_product:65639 after running code, left blank screen no results , no error message. suggestion? # find single aggregates choices = dict( aggr1 = db.complaints.aggregate([{"$group":{"_id":"$disputed", "total_disputed":{"$sum":1}}},{"$sort":{"total_disputed":-1}},{"$project":{"_id":0, "disputed":"$_id", "total_disputed":1}}]), aggr2 = db.complaints.aggregate([{"$group":{"_id":"$product", "total_prod...

swift - Healthkit HKAnchoredObjectQuery in iOS 9 not returning HKDeletedObject -

i excited learn apple added tracking of deletes in healthkit in ios 9. set test project try out. unfortunately, while can new data fine, not getting deleted objects in callbacks. i have functioning hkanchoredobjectquery tracks hkqueryanchor , gives me new hksamples whenever add bloodglucose quantity healthkit via health app. when delete same quantity , re-run app hkdeletedobject empty. add , delete @ same time. seems no matter do, hkdeletedobject array empty. additions work fine (only getting added samples since last anchor). here code. 2 files. recreate project make new swift project, give healthkit entitlement, , copy these in. (note: when run it, 1 update each run if make changes in healthkit have stop , restart app test callbacks.) this healthkit client: // // hkclient.swift // hktest import uikit import healthkit class hkclient : nsobject { var issharingenabled: bool = false let healthkitstore:hkhealthstore? = hkhealthstore() let glucosetype ...

mysql - How to retrieve hierarchial parent-child data related by multiple tables? -

i have website contains guitar lessons , exercises, broken down category. have category scales . lesson scales lesson1 , contain exercise1_1 , exercise1_2 . likewise other categories , lessons exercises. lessons , exercises considered nodes (it drupal site). there node table has node ids, node type (lesson or exercise) , titles. other info fields these nodes (lesson/exercise text, etc) stored in separate tables each field. instance there drupal_field_data_description table contains description each lesson , exercise. categories stored in taxonomy term table. relations among categories handled via taxonomy index table establishes child-parent relation (so have scales, scales->major scales, etc). for question, considering 1 depth of category. categories of lessons , exercises stored in table drupal_field_data_field_category , maps lessons , exercises category part of. exercise-lesson child-parent relations stored in table drupal_field_data_field_lesson maps exercise...

Change font family in interaction plot in R -

Image
i using sjplot - package builds off ggplot2 new - , trying change font family times new roman. using example code: require(sjplot); require(effects) fit <- lm(weight ~ diet * time, data = chickweight) sjp.int(fit, type = "eff") however, when try add argument such as: theme(text = element_text(size = 14, family = "times new roman")) it doesn't work; nor when try enter similar code in sjp.settheme() . thoughts? thanks. sjp.settheme doesn't allow specify font family (you'll find missing arg list). wasn't trudging through all of code figure out how alter function give font family spec, able alter font family through theme_set: library(sjplot) library(effects) library(ggplot2) data("chickweight") fit <- lm(weight ~ diet * time, data = chickweight) theme_set(theme_bw(base_family = 'ar berkley')) sjp.int(fit, type = "eff") theme_set(theme_bw(base_family = "times new roman")) sjp....

Converting a character string into a date in R -

the data i'm trying convert supposed date, formatted mmddyyyy no separation dashes or slashes. in order work dates in r, have formatted mm-dd-yyyy or mm/dd/yyyy. i think might need use grep() , i'm not sure how use reformat of dates in mmddyyyy format. have @ lubridate mdy function require(lubridate) <- "10281994" mdy(a) gives [1] "1994-10-28 utc" of class "posixct" "posixt" datetime in r. (thanks joshua ulrich correction) you use as.date(mdy(a)) = 1994-10-28 object of class date . there mutations ymd , dmy within lubridate well.

CSS HTML Minimum width and report width -

Image
i using ie only!!.how correct css not cut off width. set minimum width = 5000px; tried margin: 0 auto cutting off last column. instead of 17.456.78, stops @ 17. also, how hide browser title header. know question has been asked earlier many others. tried different things, columns squished in trials any appreciated <div id="printreport" style="font:100; margin-left: 0; margin-right:0 ; margin-top:0; margin-bottom:0; display:block; white-space:nowrap; margin: 0px auto 0px auto ;width:100%;min-width: 5000px;"> </div> body { background:#ffffff; color:#000000; font-family: rvconsolas; } @font-face { font-family: rvconsolas; font-style: normal; font-weight: normal; src: url('emconsola.eot'); src: url('emconsola.eot?#iefix') format('embedded-opentype') } #rptv...

excel - Search multiple items in a list for values in other cells -

let's searching apples , oranges in list under column a. if either found return (in column c, formula column) price in column b. have found formulas close, not looking yet. line line calculation rather total of all. this formula used 1 item, want 2 items, or multiple items: =if(iserror(search("apple*",a1)),"",b1) how search 2 values in list , return corresponding cell values? assuming apple in f1 , orange in g1 please try in c1 (copied down suit): =if(and(iserror(search(f$1&"*",a1)),iserror(search(g$1&"*",a1))),"",b1)

Java 8 String deduplication vs. String.intern() -

i reading feature in java 8 update 20 string deduplication ( more info ) not sure if makes string.intern() obsolete. i know jvm feature needs g1 garbage collector, might not option many, assuming 1 using g1gc, is there difference/advantage/disadvantage of automatic deduplication done jvm vs manually having intern strings (one obvious 1 advantage of not having pollute code calls intern() )? this interesting considering oracle might make g1gc default gc in java 9 with feature, if have 1000 distinct string objects, same content "abc" , jvm make them share same char[] internally. however, still have 1000 distinct string objects. with intern() , have 1 string object. if memory saving concern, intern() better. it'll save space, gc time. however, performance of intern() isn't great, last time heard. might better off having own string cache, using concurrenthashmap ... need benchmark make sure.

c++ - How to iterate QVariant? -

i did updated qtcreator 5.5 , created new project, in implementation didn't qlist values in qml (from signal call): class: ... int main(int argc, char *argv[]) { qapplication application(argc, argv); const qstring mainqmlapp = qstringliteral("qrc:///exemplo.qml"); qquickview view; qmlregistertype<exemplocontroller>("org.qtproject.example", 1, 0, "exemplocontroller"); view.setsource(qurl(mainqmlapp)); view.setresizemode(qquickview::sizerootobjecttoview); qobject::connect(view.engine(), signal(quit()), qapp, slot(quit())); view.setgeometry(qrect(100, 100, 400, 400)); view.show(); return application.exec(); } controller: header file: ... class exemplocontroller : public qwidget { q_object public: explicit exemplocontroller(qwidget *parent = 0); q_invokable void getmatrix(); signals: void receivematrix(qlist <qlist <double> > matrix); public slots: }; impleme...

How to sum last n rows conditionally in R -

i have long data frame (master) this: (last row expect couldn't figure out how it) id match points team team/points in last 3 matches 44631 154235 3 nacional 4 44623 154231 3 millonarios 3 44639 154239 1 nacional 4 44640 154239 1 junior 4 44637 154238 1 millonarios 5 44670 154260 3 junior 2 44657 154249 3 nacional 2 44668 154258 1 millonarios 7 44495 154149 0 nacional 3 44685 154263 1 junior 1 44687 154266 1 nacional 3 44688 154266 1 millonarios 6 44698 154265 3 millonarios 3 44695 154264 0 junior 1 44707 154274 1 nacional 2 44713 154273 1 nacional 1 44724 154281 3 millonarios 0 44725 154282 1 junior 0 44737 154991 1 ...

vba - Creating Diagram from Excel Using VB -

sorry can't embed images, have links instead (... can post 2 links. have removed http:// substring of links). i looking take .csv file (really, file, generating myself), , create visio (2010) diagram out of it. have imported excel sheet visio, , can create rough diagrams, not enough. i'm trying create . here following tactics have tried, prefer vb method, whatever works works: data graphics: closest i've gotten solution. create shapes , can put data in it. problem is, style of display available limited, can see here (imgur.com/cltlcxk). after importing excel sheet, had drag , drop create these shapes. closest have gotten here . however, need outside box (or container, aesthetic reasons). (some information here [support.office.com/en-us/article/enhance-your-data-with-data-graphics-45af64a4-1dcb-4463-9a7e-67709786181c]) vb: have been using (msdn.microsoft.com/en-us/library/office/ff959245%28v=office.14%29.aspx). have ran of example code, lost. have run of exampl...

befor the MainActivity shows in my app a white page shows in android -

i wrote app , first activity splash screen befor activity null white page shows. how can remove that? code protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_splash); getactionbar().hide(); delay=4000; new handler().postdelayed(new runnable() { @override public void run() { intent intent_obj=new intent(splash.this,content.class); startactivity(intent_obj); finish(); } },delay); try adding handler code in separate function. public void splashtimer(int duration) { new handler().postdelayed(new runnable() { @override public void run() { intent intent_obj = new intent(splash.this, content.class); startactivity(intent_obj); finish(); } }, duration); } and call oncreate() method

node.js - Mongoose use array in find().where() -

i have array of strings want use parameter finding documents in mongodb. basically want is // using query builder person. find(). where('name.last').equals('ghost' || 'etc' || 'etc').... but instead of using bunch of or statements, want pass array of strings. is possible? just use .in method, taking $in operator in play: person. find(). where('name.last').in(['ghost', 'foo', 'bar']) quoting the mongodb docs : the $in operator selects documents value of field equals value in specified array.

android - Camera2 API - How to set long exposure times -

i'm trying capture images 30 seconds exposure times in app (i know it's possible since stock camera allows it). but sensor_info_exposure_time_range (which it's supposed in nanoseconds) gives me range : 13272 - 869661901 in seconds just 0.000013272 - 0.869661901 which less second. how can use longer exposure times? thanks in advance!. the answer question : you can't. checked right information , interpreted correctly. value set exposure time longer clipped max amount. the answer want : you can still want, though, faking it. want 30 continuous seconds' worth of photons falling on sensor, can't get. can (virtually) indistinguishable accumulating 30 seconds' worth of photons tiny missing intervals interspersed. at high level, need create list of capturerequest s , pass cameracapturesession.captureburst(...) . take shots minimal interstitial time possible. when each frame of image data available, pass new buffer somewhere , ac...

if statement - If Else: String Equality (Java) -

lab description : compare 2 strings see if each of 2 strings contains same letters in same order. this have far far: import static java.lang.system.*; public class stringequality { private string wordone, wordtwo; public stringequality() { } public stringequality(string one, string two) { setwords (wordone, wordtwo); } public void setwords(string one, string two) { wordone = one; wordtwo = two; } public boolean checkequality() { if (wordone == wordtwo) return true; else return false; } public string tostring() { string output = ""; if (checkequality()) output += wordone + " not have same letters " + wordtwo; else output += wordone + " have same letters " + wordtwo; return output; } } my runner looks this: import static java.lang.system.*; public class stringequalityrunner { public static void main(string args[]) { stringequal...

css - Trouble Vertically Aligning Text to Middle of Window/Viewport -

i'm trying align text bottom of loading sequence & think best way part way there use vertical-align. trouble is not working. have replica of code here . html: <div id="bg_loader" style="background-image:url(http://www.myhhf.com/images/loading/myhhub_loading_4.gif);"></div> css: #bg_loader { width: 100%; height: 100%; z-index: 100000000; background-image: url(../images/loading/myhhub_loading.gif); background-repeat: no-repeat; background-position: center; } #bg_loader:before { content: "thank waiting"; display: inline-block; width: 100%; height: 100%; vertical-align: middle; text-align: center; font-size: 140%; font-weight: bold; color: #080; } i have done extensive research on matter. can tell should working. however, using pseudo element insert text & haven't been able find documentation on vertical-align & pseudo in these particular types of cases. ...

thread safety - Invoke: how can I assign UI obj from BackgroundWorker? C# -

here core of code. i've tried invoke every way china, same big red x , objectdisposed exception on form1. (edited out unrelated code brevity.) using system; using system.globalization; using system.componentmodel; using system.collections.generic; using system.drawing; using system.io; using system.windows.forms; using knowncolorspalette; namespace color_visualizer { public partial class form1 : form { static cultureinfo m_culture = cultureinfo.currentculture; fastpixel m_fp; // fastpixel encapsulates // bitmap.lockbits() funcs & data private void backgroundworker1_dowork(object sender, system.componentmodel.doworkeventargs e) { double fangle, fradius, d; point3d vu, vv; point plocation = new point(); { m_pnormal = coord.plane.normal; fangle = math.atan2(m_pnormal.y, m_pnormal.x); fradius = math.sq...

Glassfish with Oracle DS -

i using glassfish 3.1 , configure oracle datasource. however, tried ping glassfish admin console, hitting error oracle.jdbc.pool.oracledatasource not found. issue? as per http://docs.oracle.com/cd/e18930_01/html/821-2432/gkyan.html - need insert oracle jdbc driver manually not come bundled glassfish 3.1 installation. put required jar domain/lib directory. driver jar downloadable http://www.oracle.com/technetwork/database/features/jdbc/index-091264.html

vb.net - Determine if listview multiple item checkbox is checked -

i have list view check box. want make button visible, if item in listview checked. if there's no checked item visible = false . another quick example... private sub form1_shown(sender object, e eventargs) handles me.shown listview1_itemchecked(nothing, nothing) end sub private sub listview1_itemchecked(sender object, e itemcheckedeventargs) handles listview1.itemchecked button1.visible = (listview1.checkeditems.count > 0) end sub

angularjs - Protractor test timing out after login -

working on first angular app, , writing first protractor test check login functionality. authentication using ng-token-auth , i'm using ui-router. suspect issue test not catching redirect i've tried various workarounds , cannot work. here's basic routing , redirection code: angular .module('testangularapp', [ 'nganimate', 'ngcookies', 'ngresource', 'ui.router', 'ngsanitize', 'ng-token-auth' ]) .config(function ($stateprovider, $urlrouterprovider, $authprovider, $locationprovider) { $locationprovider.html5mode(true).hashprefix('!'); $urlrouterprovider.otherwise('/'); $authprovider.configure({ apiurl: 'http://backend.dev' }); $stateprovider .state('index', { url: "/", templateurl: 'views/main.html', controller: 'mainctrl', controlleras: 'main' }) ...

Rails 4 Rack::Deflater is not working. Page speed says not gzipped -

i have enabled rack::deflater in app. in headers can see accept-encoding:gzip, deflate, sdch . pagespeed insights report gzip not enabled! use nginx , puma in server. how can fix this? i had similar problem. when started suggestion here inserting config.middleware.use rack::deflater in config/application.rb content not compressed. solutions suggested using config.middleware.insert_before or updating config.ru did not work. then found out not because of problem approaches listed above, because, using apache/httpd , had explicitly enable rack_deflate module described here , , compression started working.

ruby on rails 4 - Paper Clip is not saving thumbnails -

i have following code in model: has_attached_file :avatar, path: ':class/:attachment/:id/:style/:basename.:extension', :styles=> { :original => "500x500", :small => "200x200" }, default_url: "icons/user.png" i have installed imagemagick. which convert /usr/bin/convert in development.rb paperclip.options[:command_path] = %w(/usr/local/bin/ /usr/bin/) i have tried following: paperclip.options[:command_path] = "/usr/bin/" but when try upload picture saves original file. message log is: [paperclip] saving user_profiles/avatars/53/original/2015-06-08-153213.jpg what i'm missing? in model can add below code. don't need worry size specified in code, can change size need. has_attached_file :avatar, styles: { medium: '200x200>', thumb: '80x80>' }, default_url: "/icons/user.png" validates_a...

Choose Spark/Scala kernel for Jupyter/IPython -

there lot of scala/spark kernels ipython/jupyter: iscala ispark jupyter scala apache toree (prev spark kernel ) does know wich of them compatible ipython/jupyter , comfortable use with: scala spark(scala) i can't speak of them, use spark kernel , works using both scala , spark. i found iscala , jupyter scala less stable , less polished. jupyter scala prints every variable value after execute cell; don't want see 99% of time. spark kernel favourite. both spark , plain old scala.

.net - How to compare two anonymous types or two collection of different types using SemanticComparison -

1. there simple way compare 2 anonymous types using semanticcomparison autofixture ? current issue can't construct likeness second anonymous object. simplified example : var srcanon = new { time = expectedtime, data = docsarray }; var resultanon = new { time=actualtime, data = sutresponsearray }; var expectedalike = srcanon.assource() .oflikeness<??whatshere??>() 2. think question pretty related first 1 both use semanticcomparison create iequatable implementations. in question mark seemann provided answer on how using mstest assertions , linq sequenceequal method. is possible use xunit2 assertions library in similar scenario? xunit supports assert.equal() collections of same type, can used collections of different types, if elements implement iequatable (using likeness). (this doesn't work result , alllikeness have different types): assert.equal(alllikeness.toarray(),result.toarray()); independently of unit testing framework, can...

PHP: mysqli clearing stored results -

i using function clear stored results after calling procedure etc. function clearstoredresults($mysqli_link){ #------------------------------------------ while($mysqli_link->next_result()){ if($l_result = $mysqli_link->store_result()){ $l_result->free(); } } } but keep getting following message/error mysqli::next_result(): there no next result set. please, call mysqli_more_results()/mysqli::more_results() check whether call function/method in if change next_result() more_results() page keeps loading while , time out error: maximum execution time of 30 seconds exceeded any ideas on how fix this? you need use both methods: function clearstoredresults($mysqli_link) { #------------------------------------------ while($mysqli_link->more_results()) { $mysqli_link->next_result(); if($l_result = $mysqli_link->store_result()) { $l_result->free(); } } ...

c# - Visual Studio 2015 MonoGame: Cannot find Texture2DReader -

this line of code backgroundimage = content.load<texture2d>("backgrounds/titlescreen"); causes error an unhandled exception of type 'microsoft.xna.framework.content.contentloadexception' occurred in microsoft.xna.framework.dll additional information: error loading "backgrounds\titlescreen". cannot find contenttypereader microsoft.xna.framework.content.texture2dreader. this code working before tried convert visual studio 2010 2015. inside content folder backgrounds folder has titlescreen.png, know path correct. please try .xnb files in bin\content folder. double check path of texture , name of file(i mean case sensitive). when deployed in xna visual studio,it working fine..when deployed in monogame,it throwing error,i trying file name screen,where filename screen. safest try using xnb files.

c# - How to convert Bitmap image to Base64PNG string in monodroid -

hi want convert bitmap image base64png format tried using following code.i don't think code works enough.any suggestions appreciated. bitmap immagex = signature; memorystream baos = new memorystream(); immagex.compress(bitmap.compressformat.png, 100, baos); byte[] b = baos.toarray(); string base64encodestring = base64.encodetostring(b, base64.default); i belive trick. string tempbase64 = convert.tobase64string(b); goodluck.

c# - Password RegExpression -

i have following requirements password field "the password must contain least 1 out of 4 groups: upper case, lower case, number, special character" please help ^(?=.*[a-z]{1,})(?=.*[a-z]{1,})(?=.*[0-9]{1,})(?=.*[!@#\$%\^&\*()_\+\-={}\[\]\\:;"'<>,./]{1,}).{4,}$ should it. explaination: ^ start (?=.*[a-z]{1,}) @ least 1 upper (?=.*[a-z]{1,}) @ least 1 lower (?=.*[0-9]{1,}) @ least 1 digit (?=.*[!@#\$%\^&\*()_\+\-={}\[\]\\:;"'<>,./]{1,}) @ least 1 of mentioned chars .{4,} min length 4 $ end

javascript - Accessing facebook through iframe tag and getting a cross origin error -

i'm testing in local host , getting cross origin error.. how resolve problem me i'm beginner , don't have knowledge that <script type="text/javascript"> function iframeloaded() { var iframeid = document.getelementbyid('idiframe'); if (iframeid) { iframeid.height = ""; iframeid.height =iframeid.contentwindow.document.body.scrollheight + "px"; </script> <iframe onload="iframeloaded()" src="http://www.facebook.com/plugins/like.php?href=http://www.facebook.com/palletech" frameborder="1"..../> you can't. design, access content served other origins (domains, etc.) protected same origin policy . access page on origin, other site have explicitly give access, facebook not do.

r - How to automate zero-inflated beta regressions reporting results in a table? -

i have matrix 11 columns named "env", 1 response variable bounded between 0 , 1 ("r1") , 10 possible predictors ranging "p1 "p10". use zero-inflated beta regression (r package , function "gamlss") assess individual effect of each predictor on response variable summarizing aic, estimate , probability each predictor in table. table should have predictors rows , model parameters (aic, estimate , probability) columns. process must repeated individually 3 coefficients of beta distribution (mu, nu , sigma). here subset of data matrix (sorry not being able simulate following guidelines) p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 r1 600 243.89 2.68 180.32 1753.62 5.15 16.11 46.59 1.52 0.96 0.04 674 259.43 1.49 174.06 1230.71 5.50 19.42 45.65 1.62 0.88 0.28 231 156.19 0.00 151.68 1002.93 5.22 12.76 50.38 1.63 1.00 0.00 624 256.53 8.58 181.32 1194.07 5.35 25.33 58.74 1.33 0.94 ...

c++ - Pattern-match/SFINAE on parameterization of container for specific classes? -

i have base class , derived classes. bit patterns come in external code can make these, , there generic code builds them. generic code has use explicit template "factory": auto d = factory<d>(data); // d derived class this factory sfinae-enabled classes derived base: template< class t, typename = typename std::enable_if< std::is_base_of<base, t>::value >::type > t factory(externaldata &data) { t result; if (!result.initfromdata(&data)) throw std::runtime_error("data not set"); return result; } i'd add variant works std::experimental::optional<derived> cases when bit patterns indicate things unset. in case generic code passing in either type: auto dod = factory<dod>(data); // dod can derived or std::optional<derived> using explicit parameterization this, how create sfinae variant "pattern match" existence for std::experimental::optional<any...

php - Unable to load FFProbe driver for FFmpeg -

hi trying install php-ffmpeg. can guide me or correct me in steps. i installed composer on windows , traversed folder had created run install ffmpeg cmd after running command composer.json , composer.lock file created along vendor folder. later installed shared ffmpeg build 64bit here http://ffmpeg.zeranoe.com/builds/ and form folder copied bin folder directory set ffmpeg , ffprobe path during create() $ffmpeg = \ffmpeg\ffmpeg::create([ 'ffmpeg.binaries' => '/vendor/bin/ffmpeg.exe', 'ffprobe.binaries' => '/vendor/bin/ffprobe.exe' ]); currently getting error says : "fatal error: uncaught exception 'alchemy\binarydriver\exception\executablenotfoundexception' message 'executable not found, proposed : /vendor/bin/' in d:\xampp\htdocs\health\vendor\alchemy\binary-driver\src\alchemy\binarydriver\abstractbinary.php:160 stack trace: #0 d:\xampp\htdocs\health\vendor\php-ffmpeg\php-ffmpeg\src\ffmpe...

c# - Search a substring in another string -

string name = "blk000012345summary.pdf"; string filename = "20150929111111zp2zq23blk000012345summary.pdf"; i have string name have find in filename , if exists should return true otherwise false. string name = "blk000012345summary.pdf"; string filename = "20150929111111zp2zq23blk000012345summary.pdf"; bool value = filename.contains(name);

html - Google Rich Snipper structured data - http://schema.org/Recipe - correct way to add ratings -

i have wordpress site have posts using " http://schema.org/recipe " can show me correct way add in ratings " http://schema.org/recipe "? from https://schema.org/rating copy code json-ld tab in header.php . use this <script type="application/ld+json"> { "@context": "http://schema.org", "@type": "product", "aggregaterating": { "@type": "aggregaterating", "ratingvalue": "3.5", "reviewcount": "11" }, "description": "0.7 cubic feet countertop microwave. has 6 preset cooking categories , convenience features add-a-minute , child lock.", "name": "kenmore white 17\" microwave", "offers": { "@type": "offer", "availability": "http://schema.org/instock", "price": "55.00", "pr...

What is the best practice to deal with Google Play Store Security Alert? -

i have received following error google play developer console: "please address vulnerability possible , increment version number of upgraded apk. handle ssl certificate validation, change code invoke sslerrorhandler.proceed() whenever certificate presented server meets expectations, , invoke sslerrorhandler.cancel() otherwise." i guess issue caused implementation of "onreceicedsslerror()". proceed "handler.proceed()" without checking. i know best practice deal ssl error. , if domain checking, google play still show me such alert? thanks in advance. you should remove onreceivedsslerror implementation , use default behavior, cancel. the best practice treat couldn't connect server. people have no reason override certificate checking @ all.

android - apk size increases when I use the ffmpeg library -

previously used ffempg library video compression in android. apk size increased 25 mb. please me find alternative way compressing video. i guess apk size increased because ffmpeg binaries put inside apk. for android version 4.3 (api 18) , newer can use mediacodec api . introduced in api 16 expanded functionality available since api 18 (e.g. mediamuxer class). to understand how works recommend go through android's unit tests here , here .

gradle - Android: What is the difference between "support" and "appcompat" -

this question has answer here: difference between android-support-v7-appcompat , android-support-v4 3 answers i have come upon these lines in build.gradle file: compile 'com.android.support:support-v13...' compile 'com.android.support:appcompat-v7...' until thought supporting older versions of android use appcompat libs. so difference between "support" , "appcompat"? v4 support library this library designed used android 1.6 (api level 4) , higher. includes largest set of apis compared other libraries, including support application components, user interface features, accessibility, data handling, network connectivity, , programming utilities. v7 libraries there several libraries designed used android 2.1 (api level 7) , higher. these libraries provide specific feature sets , can included in application independ...

How to configure SMTP to save send mails? -

can please tell me how configure smtp save send mails in sent items folder of mail. note: using yahoo mail credentials send mails. that not possible using smtp only. smtp message delivery, has no knowledge of inbox , folders tructure. when send mail using mail client (outlook, phone, gmail, etc), : use smtp send mail then use different protocol (usually imap or mapi) move message "sent items" folder. there exceptions : mail providers automatically copy sent items messages sent account through smtp server. believe gmail that. that's not easy maythink, since 1 must ensure message not ciped twice (once email client, 1 smtp server).

python - Formating related datetime field -

i have related datetime field 'expected_date' : fields.related('picking_id','date',type='datetime', relation='stock.picking', store=true, string="date"), then want show field in report, want change format of field using code 'picking_date' : datetime.strftime(datetime.strptime(str(expected_date), '%y-%m-%d %h:%m:%s'),'%d-%m-%y'), then got error time data 'none' not match format '%y-%m-%d %h:%m:%s' can show me did go wrong? i'm using openerp6 expected_date none str(expected_date) returns string value "none" , hence not match error. you want 'picking_date' : (expected_date not none , datetime.strftime(datetime.strptime(str(expected_date), '%y-s%m-%d %h:%m:%s'),'%d-%m-%y') or 'none'),

shell - I want to execute a cygwin script from maven's pom.xml -

i need execute shell script under cygwin, because i'm under windows. shell executed commands arent' recognize ... see below : <build> <plugins> <plugin> <artifactid>maven-antrun-plugin</artifactid> <version>1.7</version> <executions> <execution> <id>openocd</id> <phase>validate</phase> <configuration combine.self="override"> <tasks> <exec executable="c:/cygwin/bin/sh.exe" failonerror="true"> <arg line="${project.basedir}/make.sh" /> </exec> </tasks> </configuration> <goals> ...

java - Weird behavior of GridBagLayout -

Image
i've discovered strange thing in code: import java.awt.color; import java.awt.container; import java.awt.gridbagconstraints; import java.awt.gridbaglayout; import java.io.ioexception; import javax.swing.borderfactory; import javax.swing.box; import javax.swing.jcomponent; import javax.swing.jframe; import javax.swing.jlabel; import javax.swing.jpanel; import javax.swing.swingutilities; public class test { public static void main(string [] args) throws ioexception { final jframe frame = new jframe(); frame.setdefaultcloseoperation(jframe.exit_on_close); jpanel panel = new jpanel(); panel.setlayout(new gridbaglayout()); gridbagconstraints gbc = new gridbagconstraints(); gbc.insets.top = 5; gbc.insets.right = 5; add(0, 0, 1, 1, 2, 1, gridbagconstraints.both, gridbagconstraints.center, gbc, panel, createpanel()); add(2, 0, 1, 1, 2, 1, gridbagconstraints.both, gridbagconstraints.center, gbc, panel,...