Posts

Showing posts from July, 2010

javascript - can't get server response when using dropzone.js version 4 -

i'm using dropzone.js version 4 upload files webpage server. upload works fine, i'm trying server response. i'm creating dz programmatically. // create dropzone var dz=' <form action="../home/cgi/newfileupload.exe" '; dz+=' class="dropzone"'; dz+=' id="my-awesome-dropzone">'; dz+=' <input type="hidden" name="token" value="token2send"'; dz+=' </form>'; $("#mydz").prepend(dz); // there div called mydz settimeout(function(){ // init dynamic dropzone myawesomedropzone=$("#my-awesome-dropzone").dropzone(); // configure dropzone.options.myawesomedropzone = { init: function() { this.on("success", function(file, responsetext) { ...

javascript - How to allow http requests in Node.js Nginx? -

i have node app (using pm2) listening on http://127.0.0.1:3000 on digitalocean droplet running ubuntu. however, have problem. works fine except fact of http post requests recieve 404 not found error. have no idea why. here nginx conf file looks like: server { listen 0.0.0.0:80; root /var/www/app_folder; server_name example.com; location / { proxy_pass http://127.0.0.1:3000; } } it loads fine. static images, css, html, , javascript files. however, outgoing http posts 404. any appreciated. ahead of time. edit: node.js file other. here's rundown. app.post('/someurl', function(req, res) {...} app.listen(3000, "127.0.0.1"); so solved it! i running ubuntu 14.04 on digitalocean droplet. problem when called sudo apt-get install nginx , install nginx version 1.4.6 automatically. however, latest stable release of nginx version 1.8.0. here steps installing latest version: add nginx ppa sudo add-apt-repository ppa:...

Reading Binary Data in R -

Image
i trying read binary data r since it's first time doing this, having problems. this how binary data looks - and structure of data - i started playing readbin function in r - data <- readbin(file(file_to_read,"rb"),integer(), n = 1, endian = "little") this gives me data 3 , looks encouraging. now, since id1 integer , rest of variables real, readbin function - data <- readbin(file(file_to_read,"rb"),integer(), n = 4, size = 4, endian = "little") should (i may wrong here) give me first 4 values of id1, 3 -2147483647 464465287 1082846778 how can correctly read data given structure? want create new data frame 2 columns "id1" , "ab_time" data. thanks much!

redirect - What is the best and most secure way to forward http to https or port 80 to 443 Apache? -

so looking best way setup https ssl website. show current configuration. 000-default.conf - http://i.stack.imgur.com/hc3qd.png ports.conf - http://i.stack.imgur.com/i7umh.png i want if types website.com or www.website.com goes https ://www.website.com i have setup this. secure , effective way of doing it? need port 80 @ , have people not need type https manually? i hope explained situation enough. , advise appreciated! your simple redirect in port 80 virtualhost port 443 vhost normal/fine. it's secure , effective , not dwell on.

java - Latin Character Inbetween String -

i have program read in file contain latin words such "\xed". these latin words can appear anywhere in between line, such have program parsing these character. there library can so? the simple way inputstreamreader "utf8" format. example: try { file filedir = new file("c:/temp/sample.txt"); bufferedreader in = new bufferedreader( new inputstreamreader( new fileinputstream(filedir), "utf8")); string str; while ((str = in.readline()) != null) { system.out.println(str); } in.close(); } catch (unsupportedencodingexception e) { system.out.println(e.getmessage()); } catch (ioexception e) { system.out.println(e.getmessage()); } catch (exception e) { system.out.println(e.getmessage())...

javascript - JSONP Query and AngularJS -

i trying iterate through array of usernames , add resulting jsonp requests array can displayed using angularjs. follows: html section <div id = "displayul" ng-controller="usercontroller"> <ul> <li ng-repeat="user in results">{{user.user}}<img ng-src="{{user.logo}}">{{user.etcetera}}</li> </ul> </div> javascript section var app = angular.module('userapi', []); app.controller('usercontroller', function($scope,$http){ //our user name array $scope.inputusers= ["usera", "userb", "userc"]; $scope.results = []; //loop through each user $.each($scope.inputusers,function(key,value){ var currentuserdata = {}; currentuserdata.user = value; //url request - defined elsewhere callback jsonp var currenturl = streamurl + value + callbackpostfix...

core foundation - Swift 2 CFType conversion -

in swift 1.2 had c function following signature: __nonnull cfarrayref fdcreatesupportedaudiofileextensions() cf_returns_retained; i know function returns array of cfstringref instances, called swift this: let supportedaudiotypes = fdcreatesupportedaudiofileextensions() as! [string] and worked expected. however, in swift 2 code fails @ runtime due forced cast ( exc_bad_instruction ). i'm able things working following: let supportedaudiotypes = fdcreatesupportedaudiofileextensions() nsarray as! [string] i'm unsure changed swift 1.2 2.0. bug in current version of swift or have missed something? i've read implies cftypes toll-free bridged swift counterparts i'm not sure why used work failing.

How can I configure Visual Studio Code to recognize files with extensions other than .js as Javascript -

we have qa tool (smartbear's testcomplete) uses javascript scripting language, names file ".sj" extension instead of ".js". use visual studio code edit files, nice intellisense , other tooling comes it, can't figure out how configure recognize .sj files javascript files. ideas? answering own question, future readers may searching same thing. according tweet @code , not yet possible, coming "soon".

python - Is it possible to keep the same amount of x axis tick labels visible as the zoom level changes on a bokeh bar plot? -

Image
i'm using django , generating bokeh bar plot using data database. i've put basic code example below. i'm generating x axis tick labels datetime variable tick @ every hour datetime formatted string. causes tick label visible time. it's fine when zoomed in not pretty when zoomed out because labels on top of each other. is there way make bokeh automatically adjust tick labels visible zoom level changes keep constant amount of ticks labels visible ? views.py : # -*- coding: utf-8 -*- django.shortcuts import render bokeh.plotting import * bokeh.resources import cdn bokeh.embed import components bokeh.charts import bar bokeh.models import range1d collections import ordereddict import datetime def plot_1_bar(data, y, y_lab, title, xlab, ylab, yrange, palette): x0_list_str = [] y_list = [] # x_axis_type == "datetime": i_x = 'x1' i_y = y[0] idx, val in enumerate(data): x0_list_str.append(val[i_x].strftime("%y-...

twitter bootstrap - How to add responsive media query -

this sample code , cant add responsive .how add code responsive media query ? <form action="action_page.php"> first name:<br> <input type="text" name="firstname" value="mickey"> <br> last name:<br> <input type="text" name="lastname" value="mouse"> <br><br> <input type="submit" value="submit"> </form> if talking css3 responsive media query have add <head> <meta name="viewport" content="width=device-width, initial-scale=1.0"/> <style> body { background-color:lightgreen; } @media screen , (max-width: 500px) { body { background-color:lightblue; } } </style> </head>

dictionary - Python - Switch/Case using a Dictionnary implies the interpretation of each case -

in aim of emulating switch/case block using dictionary , noticed isn't supposed occur: print { 'a': 1, 'b': 2 + '', 'c': 3, }['a'] i'm expecting that, since key given 'a' => second line (key b ) shouldn't interpreted. but is: 'b': 2 + '', typeerror: unsupported operand type(s) +: 'int' , 'str' which means second line has been interpreted anyway. somebody has explanation phenomenon? or way emulate switch without implying python interprets each case ? python doesn't use lazy evaluation, has create entire dictionary before can access element of ['a'] . if part of dictionary creation gets error, fail @ part. if want emulate switch/case , including fact doesn't execute bodies of unselected cases, can put functions dictionary. print { 'a': lambda: 1, 'b': lambda: 2 + '', 'c': lambda: 3 }['a...

A lot of requests android -

i have android , activity need checking whether database record has changed, has something, not continue checking. i checked several ways this, 1 creating service , make requests volley in restful server, example, every 5 minutes. impossible since server receive thousands of requests per minute. it can done backend, believe. using push notification (gcm) or http pulling, whenever data has been changed on database, send message client, client respond based on that.waiting hear master on things. , best of luck

ios - deep links not working on chrome browser for Iphone -

i trying open mobile app when clicking on link ( web ). want open instagram profile. i tried this instagram://user?username=kamal it working on safari browser not in chrome browser iphone. i tried 1 :- intent://#intent;scheme=user?username=maliamanuel;package=com.instagram.android;s.browser_fallback_url=http%3a%2f%2fmockup.in/;end" but not working on browser.

ios - How to resolve App Transport Security has blocked a cleartext HTTP? -

i facing below unwanted console messages while running app using xcode 7 beta ios 9 . please me how resolve below one. console message: app transport security has blocked cleartext http (http://) resource load since insecure. temporary exceptions can configured via app's info.plist file.

php - how to select data that have the same value with sql? -

i have table 3 columns, id , name , , value , shown below. want count average id , value columns same, how can this? +----+--------+-------+ | id | name | value | +----+--------+-------+ | 2 | rahmat | 3 | | 2 | olive | 5 | | 3 | sari | 3 | | 3 | ryan | 2 | | 1 | zaki | 1 | +----+--------+-------+ try using query: select avg(value) table id = value the output sample table gave in op 1.5 , since sari , zaki 2 users records have id , value columns equal.

ruby - Append multiple attribute values inside csv -

i have stored data in following json/xml. please find below link. looking store values of des_facet , org_facet , per_facet , geo_facet in csv in array. @ moment values stored in hash map stores these values in separate column. hash = article.attributes.select {|k,v| !["author","images","guid","link"].include?(k) } hash_new = [] hash.values.map |v| hash_new.push("\""+v.to_s+"\"") end hash_new.map(&:to_s).join(", ") sample json: { "articles": [{ "results": [{ "title": "ad blockers , nuisance @ heart of modern web", "summary": "the adoption of ad-blocking technology rising steeply. see existential threat online content know it, others see new business niche.", "source": "http://www.nytimes.com/2015/08/20/technology/personaltech/ad-blockers-and-the-nuisance-at-the-heart-...

css - Change color of geomicons -

Image
i'm using geomicons , need change colors. for example, <span class='geomicon-info-alt'/> , black circle black letter i in on white background. i want change white letter i on black circle background this: however, if color: white; background-color: black , i'll square black background below. can 1 give me suggestion on how fix it? thanks, updated tried border-radius: 50% suggested in comment below. it's better there's still little black in left edge. applying css can output. .geomicon-info-alt { color:#ffffff; background:black; border-radius:50%; border:0; } note : if height , width same use border-radius:50% otherwise manually change border-radius value desired output..

syntax - How to split long python expression in python -

this question has answer here: how break line of chained methods in python? 8 answers how should format following code per pep-8 guidelines? don't see examples this. or there no guideline this? questions on ask splitting long conditionals or line continuation. def send_notification(version, device_type): reg_ids = udr.objects.filter(device_type=device_type).values_list('id', 'device_type', 'registration_id') if not reg_ids: logger.debug("no notifications send") should formatted as: def send_notification(version, device_type): reg_ids = udr.objects.filter( device_type=device_type).values_list('id', 'device_type', 'registration_id') if not reg_ids: logger.debug("no notifications send") or this: def send_notification(version, device_ty...

jquery - How to disable div after check checkbox -

hi i'm new web designing.please me one. have 2 html pages. in first 1 contains 2 checkboxes , second contains 2 divs 1 left side , 1 right side. want in first page 1 checkbox checked , 1 automatically goes disable.now second page 1 div automatically goes disable mode means functionality in not work on div.i mean if lhs checkbox checked in first page lhs div work in second page. it possible or not? i'm using html,bootstrap , jquery. it better if you can share relevant code , here make illustration example purpose : assumed our html code : <!-- first page --> <input type="checkbox" class="mycheckbox" data-target="firstdiv" />first <br/> <input type="checkbox" class="mycheckbox" data-target="seconddiv" />second <hr/> <!-- second page --> <div id="firstdiv" class="mydiv">hello 1st div</div> <div id="seconddiv"...

Rails validation vs authorization -

i have scenario unsure of whether particular function should considered validation or authorization. can code either way. users can "like" articles. when user creates new "like" need ensure user has not liked article. front end limit functionality want backed end safeguards. should process of ensuring user has not liked article considered validation or authorization? further comments received: if auth determines if option available user, or not & validation determines if user selection valid then... auth make option click "like" available when user has "liked" , therefore inevitably fail validation. this thinking results in invalid option being presented user. is ensuring user can delete/edit own "likes" auth or validation? previous logic implies should validation user either authorised add/update or destroy within model or not , ensuring actions valid role of validation illogical present option delete user's...

How to get path of selected file while browsing from an import wizard in eclipse plug-in -

in plugin trying make menu named import . action directly open import wizard. in import wizard have choose path through browse button. want use path in plugin. how can path? like greg said, won't able info standard wizards. you have implement own wizard , save variable of path in performfinish() method somewhere preferences or in context.

php - Uni-Code not going well on database & interface at same time? -

this question has answer here: utf-8 way through 14 answers i have hindi , urdu writing stored in database xampp there set utf8_unicode_ci , firstly wrote line <meta http-equiv="content-type" content="text/html; charset=utf-8"> on webpage before <title> tag , replace uper line line <meta charset="utf-8"/> . when insert values in 'phpmyadmin' , show values on webpage shows ????? question marks on webpage in 'phpmyadmin' shows fine uni-code writing. and update uni-code columns through webpage after updating values they got nice view of writing on webpage time in database column shows آب Ùˆ Ûوا these type or charters. now m not getting happning correct 1 side, other side transformed in 'unicode-less'. this web page code , m using php 5.6.11 <!doctype html> <html> ...

php - Facebook SDK returned an error: Connection timed out after 10001 milliseconds -

i have integrated facebook login (php sdk version 5.0.0) website. working fine in localhost. shows following error when have hosted in server; facebook sdk returned error: connection timed out after 10001 milliseconds i have changed 'site url' , 'oauth redirect uri' when hosted in server. necessary change else in app? have checked curl enabled in server, showing 'enabled' in php ini. php version 5.5.28. my code given below; index.php: <?php session_start(); error_reporting(e_all); $path = realpath(dirname(__file__)); require $path .'/facebook-sdk-v5/autoload.php'; $fb = new facebook\facebook([ 'app_id' => 'xxxxxxx', 'app_secret' => 'xxxxxxxx', 'default_graph_version' => 'v2.4', ]); $helper = $fb->getcanvashelper(); // grab signed request entity $sr = $helper->getsignedrequest(); // user id if signed request exists $user = $sr ? $sr->getuseri...

jsf - How is an instance of composite component created and how can I get it -

i'm using mojarra 2.1. reading this answer when use custom tags , composite components, came across question internals of components. so, important difference between custom tags , composite components every composite component has single uicomponent instance, representing in component tree after view build time 's finshed. custom tag, in turn doesn't have single uicomponent instance representing in tree. so, class, representing composite component in tree? how created? anonymous class? let's consider example wiki -page: <ui:component xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:cc="http://java.sun.com/jsf/composite" > <cc:interface> <!-- define component attributes here --> </cc:interface> <cc:implementation> ...

c# - Windows Service not working on Development server -

i have windows service, optimization of image, once day, below steps performs optimization: 1. copies original files backup folder. 2. optimizes image , moves temp folder. 3. overrides actual files optimized version temp folder original folder. 4. deletes temp folder. below approach: 1. initiates process class , access command prompt .exe file 2. inputs jpeg .exe , it's argument. this concept works on local machine windows service, when same on server, not anything. can guide right path on this.

c++ - how to catch exception in cppunit -

we use cppunit test our test framework the tests organized in test fixtures (inherited cppunit_ns::testfixture) there new requirement - flush out application buffer @ end of test if has failed. i can in overloaded teardown() function in test fixture. how know if test has failed. the result of test checked using cppunit_assert. there around 12 test fixtures each fixture having around 10 tests. how achieve minimal code change? i think depends bit on how call tests first idea use testlistener , react testlistener::addfailure call. note teardown can in theory throw exception (possibly through cppunit_assert) call testlistener::addfailure. if not work obvious ugly solution set flag @ end of each test method signals test finished , call code when flag not set.

javascript - Angular: Render externalized strings containing scope variables in the controller -

is possible render externalized strings (passed server in case) in controller? my use case : i'm using angular-toastr alert service, , must pass message , title toastr object. tricky part when strings contain scope variables, e.g: stringfromserver = "something {{somevariable}} went wrong" . i know in http callback somevariable want render string before passing message alert service. is possible, , best way? assuming server can render string $scope.variable placeholder, $interpolate seems you're looking for. please see documentation

How to deploy Qt 5.5 C++11 application on MacOS X snow leopard (10.6) -

my qt 5.5 application crashed on macos x snow leopard (10.6) next callstack: 0 libc++.1.dylib 0x6d801002 0x6d801000 + 2 1 org.qt-project.qtcore 0x6c9440ea qregisterresourcedata(int, unsigned char const*, unsigned char const*, unsigned char const*) + 26 2 org.qt-project.qtcore 0x6ca9c577 qxmlutils::isncname(qstringref const&) + 711 3 dyld 0x8fe0ed69 imageloadermacho::domodinitfunctions(imageloader::linkcontext const&) + 235 4 dyld 0x8fe0d31a imageloader::recursiveinitialization(imageloader::linkcontext const&, unsigned int) + 246 5 dyld 0x8fe0d2be imageloader::recursiveinitialization(imageloader::linkcontext const&, unsigned int) + 154 6 dyld 0x8fe0d3cd imageloader::runinitializers(imageloader::linkcontext const&) + 61 7 dyld 0x8fe024a9 dyld::initializemainexecutable() + 134 8 dyld ...

maven - what is dependency for Sonar-plugins in POM -

we have upgraded sonarqube version 3.7.2 4.5.5. using maven build , deployment. there plugins need updated. but, not sure whether, not able find exact gav parameter them or find latest version using pom. e.g build-stability-plugin; not able find version 1.3 plugin on maven repository. kind of appreciated you mix maven plugins , sonarqube plugins. latter doesn't need deployed in maven repository nor defined in project poms.

javascript - SVG Image xlink:href is not working with knockout -

i trying render svg image knockout, not showing image after bound viewmodel. here svg <svg width="500" height="500" style="border: solid 1px black"> <image id="img1" width="500" height="500" data-bind="attr:{'xlink:href': image}"></image> </svg> here knockout bindings, <script> var viewmodel = function(data){ var self = this; self.image = ko.observable(data.image) }; var data = {image: "http://2.bp.blogspot.com/-cgevte2xewu/vueiqidijki/aaaaaaaacwu/uyzcrcnmmak/s1600/comic.png"}; var vm = new viewmodel(data); ko.applybindings(vm); </script> anyway checked page source after executing code. svg image element in page source is <image id="img1" width="500" height="500" data-bind="attr:{'xlink:href': image}" xlink:href="http://2.bp.blogspot.com/-cgevte2x...

mysql - Is there a `USING` clause in SQLAlchemy core? -

i'm using sqlalchemy on mysql database. there way can use mysql's using clause join tables? e.g. select * join b using(some_id, other_id); short answer no. longer answer you write compiler extension render statement, don't think worth effort. explanation below. in mysql don't have use using join tables. it's considered syntactic sugar on more general on construct. sqlalchemy not include handling special case join columns have same name (main use-case using using ). uses general approach ( on ). as sqlalchemy render on statements you, , in cases infer join-relationships table definitions , obviating need specify join condition at all , not more work. example t1 = table('a', metadata, column('id', integer)) t2 = table('b', metadata, column('id', integer), column('fk', integer, foreignkey('a.id'))) sel = select([ t1.c.id, t2.c.id, ]).se...

sql server - error in connecting to sql from C# windows form application -

i have form in c# user , pass , form shows informations of employees 2 tables in sql server want show in gridview. private void button1_click(object sender, eventargs e) { string userid = textbox1.text; string passwrd = textbox2.text; sqlconnection myconnection = new sqlconnection("server=.,sql2014;database=mytamrin;uid=sa;password=sa123;"); try { myconnection.open(); } catch (exception r) { messagebox.show(r.tostring()); console.writeline(r.tostring()); } sqlcommand sqlcomm = new sqlcommand(); sqlcomm.commandtext = "select count(*) dbo.empp fldusername = @snum , fldpassword = @pass"; sqlcomm.parameters.addwithvalue("@snum", userid); sqlcomm.parameters.addwithvalue("@pass", passwrd); if ((int16)sqlcomm.executescalar()==1) { userinfo mainform = new userinfo(); mainform.show(); } what problem? ...

c# - wpf form does not redraw -

i have made plugin autodesk navisworks wpf. have form should filled in after mouse down event. public override bool mousedown(...) { ... //wpf form wpfcontrol wpf = new wpfcontrol(); //getproperty - method cleares items //then creates tab control, tab items , fills gridview wpf.getproperty(); } first time after initialization wpf form fills, not redraw. however, tab control, tab items , grid view changes in debug mode. can't understand why not redraw. at same time programmatically added button getproperty method refreshes wpf form. private void btnchoosetemp_click(object sender, routedeventargs e) { getproperty(); }

php - Plugin could not be activated because it triggered a fatal error: unexpected 'require_once' -

i'm trying create custom table in mysql using plugin. here's code same: <?php /* plugin name: zenva user table plugin uri: http://www.getevangelized.com description: custom table storing user data version: 1.0 author: manas chaturvedi author uri: http:www.getevangelized.com license: gpl2 */ register_activation_hook(__file__, 'create_update_table'); function create_update_table() { global $wpdb; $tablename = $wpdb->prefix."twitteruser"; if($wpdb->get_var("show tables '$tablename'") != $tablename) { $sql = "create table `$tablename`( `user_id` int(20) not null auto_increment, `twitter_handle` varchar(100) not null, `oauth_token` varchar(200) not null, `oauth_token_secret` varchar(200) not null, `created` datetime, primary key (user_id) );" require_once(abspath . 'wp-admin/includes/upgrade.php...

python - How to split a sorted list into sub lists when two neighboring value difference is larger than a threshold -

input: a sorted list , this: [1,2,3,8,10,15,16,17,18,22,23,27,30,31] a threshold, this: max_diff = 2 expected output: a list of sub lists; each sub list contains values neighboring difference smaller max_diff, this: [[1, 2, 3], [8, 10], [15, 16, 17, 18], [22, 23], [27], [30, 31]] here's how did this, wondering if there better way this. test_list = [1,2,3,8,10,15,16,17,18,22,23,27,30,31] max_diff = 2 splited_list = [] temp_list = [test_list[0]] in xrange(1,len(test_list)): if test_list[i] - temp_list[-1] > max_diff: splited_list.append(temp_list) temp_list = [test_list[i]] else: temp_list.append(test_list[i]) if == len(test_list) -1: splited_list.append(temp_list) print splited_list you can use enumerate , zip function within list comprehension find indices of elements value difference larger 2, split list based on index list : >>> li =[1, 2, 3, 8, 10, 15, 16, 17, 18, 22, 23, 27, 30, 3...

testing - In Android, why do I need to use androidTestCompile for the "test" sourceSet? -

so have library module wraps api, , want write tests. want import things junit , mockwebserver, test sourceset, , not androidtest one, want use former because latter cause tests run in android device or avd, not want. therefore, have in gradle file: sourcesets { main { test { setroot('src/test') } } } ... dependencies { ... testcompile 'junit:junit:4.12' testcompile 'com.squareup.okhttp:mockwebserver:2.4.0' } however, not work, , instead have import dependencies androidtestcompile ones. why this? you should have structure this: root module src main test and need in build.gradle (without setting source sets): dependencies { // unit testing dependencies. testcompile 'junit:junit:4.12' testcompile 'com.squareup.okhttp:mockwebserver:2.4.0' } you can check in official repo google: a collection of samples demonstrating different frameworks ...

c# - Recognize sub image -

i have quite simple task: goal detect image pattern inside image. in particular, have identify correct side of cassette drug-of-abuse test picture acquired scanner lowest error rate possible. i’m using aforge.net library c#. doa test picture: link http://www.atbsrl.com/media/so/doa-test-sample.png test in progress picture: link http://www.atbsrl.com/media/so/schema03.png the cassette faces pretty similar, first (a side) has 3 adulteration strips (with colored areas) , other drug-of-abuse strips (b side). to pretty sure recognize side, tried mix different approaches, e.g. color matching , template matching, @ moment tests aforge.net didn’t produce expected results because of variability of input image. do have suggestions? use convolutional neural network. there nothing can classical image processing have low error rate. to apply this, collect many images possible (preferably thousand or more; hundred may not enough, ten thousand ideal) of each side, , make...

amazon web services - SSL/TLS impact on postfix using default ca-bundle.crt -

recently must have heard aws switch sha256 hash algorithm ssl certificates using postfix integration amazon ses, using default ca certificate mentioned in integrating amazon ses postfix documentation link using this ca certificate,can please verify cert uses sha256 algorithm not affected ssl/tls certificate changes i have found solution this, can verify ca certificate using following command curl -k https://www.amazonsha256.com --cacert ca-bundle.crt more info aws link , have @ shows using openssl how verify ssl certs link

sql server - SQL optimize inner join (Inner join with union and possible use of subquery) -

i'm having 2 tables -- test, child contains versioned data. description columns: test, child table id - record id (not unique due multiple versions) modstamp - timestamp @ record inserted deleteddate - timestamp @ record deleted; null value means record not deleted yet. composite key = {id, modstamp} child table data - foreign key references test(id) data2 - foreign key references test(id) i working on requirement records selected between 2 timestamps - $fromtime , $totime. able select records on test table running self-join. select v.id, v.modstamp test v inner join (select id, max(modstamp) maxdatetime test modstamp >= '2017-08-16 15:08:04 +00:00' , modstamp <= '2017-08-16 17:08:04 +00:00' group id) g on v.id = g.id , v.modstamp = g.maxdatetime v.deleteddate null i required select latest version of corresponding child records (without duplicate record id , group clause) parent records selected. application holds results above query , ...

ios - Clearing a context in Core Data: reset vs deleting registered objects? -

i looking posts regarding this, don't understand... difference between: [context reset]; and: for (nsmanagedobjectid *objid in objectids) { [context deleteobject:[context objectwithid:objid]]; } or equivalent? thanks using reset puts managed object context state in when first created it-- before had performed fetches, created new objects, etc. if have managed objects in memory fetched context, they're unusable. using reset does not affect persistent store file . instances still exist afterward, they're not in memory. can fetched again. using deleteobject removes object persistent store. not exist more. can't fetched anymore because doesn't exist.

vbscript - Controling volume based on the name of a tab in the taskbar -

i'm new programming , first exercise wanted write program mute volume when taskbar displays element name. full disclosure, mute out ads on spotify when come on. noticed name of tab changes "spotify - spotify". when happens, i'd program mute volume until name changes again. granted pay (quite low) monthly subscription, wouldn't learn programming standpoint. can point me in right direction started on this? i've found on not i'm looking (i think): how control windows system volume using jscript or vbscript? thanks all. if ok muting try tasks via word object (i know...) described here : set objword = createobject("word.application") set coltasks = objword.tasks each objtask in coltasks if objtask.visible wscript.echo objtask.name end if next objword.quit you put inner in loop , check objtask.name "spotify - spotify" every second , sleep in between. if find can use sendkeys solution post found var...

javascript - change image from path to embedded -

i have html image <img src="/path/to/my/image.png" /> i want same content, embedded image <img src="data:image/png:base64/xyzafasfasfafasfafasfasag"> can transformation javascript? html: <img src="/path/..." id="image"> js: document.getelementbyid('image').src = 'data:image/png:base64/qweqwe...';

MVVM WPF - ComboBox two way binding inside ItemsControl -

i working on problem day now. for reason unable twoway bind value combobox if inside itemscontrol. outside works fine. i have observablecollection of int? in viewmodel: private observablecollection<int?> _sorterexitssettings = new observablecollection<int?>(); public observablecollection<int?> sorterexitssettings { { return _sorterexitssettings; } set { if (_sorterexitssettings != value) { _sorterexitssettings = value; raisepropertychanged("sorterexitssettings"); } } } my xaml: <itemscontrol itemssource="{binding sorterexitssettings}"> <itemscontrol.itemtemplate> <datatemplate> <combobox itemssource="{binding relativesource={relativesource ancestortype=itemscontrol}, path=datacontext.scanrouter.stores}" selectedvalue="{binding path=., mode=twoway...

Add a second git remote repository and commit complete project -

on webserver there existing project folder versioned git. want add second repository [remote "second"] , push already versioned project newly added remote repository. how best practice? what looking called repository mirroring. (git mirroring, svn mirroring). see more info here

javascript - Three js Object 3D rotation -

hy! i'm facing strange problem in 3 js(r71) / threex (threex.laserbeam). i'm having problems rotation of object 3d. i'm calculating latitude, attitude points phi,theta this: (or other variables 50/-51) var phi = (90 - 50) * math.pi / 180; var theta = (-51) * math.pi / 180; after drop sphere on location following code: var geometry = new three.spheregeometry( 0.005, 15, 15 ); var material = new three.meshbasicmaterial( {color: 0x0000ff} ); var sphere = new three.mesh( geometry, material ); scene.add( sphere ); sphere.position.x = 0.5 * math.sin(phi) * math.cos(theta); sphere.position.y = 0.5 * math.cos(phi); sphere.position.z = 0.5 * math.sin(phi) * math.sin(theta); then rotate ray same position following code: laserbeam.rotation.y = -theta laserbeam.rotation.z = phi the laserbeam acts "line", in object3d. origin of ray @ (0,0). haven't got faintest idea why not going trough sphere (see screenshot ). any ideas? ---edit--- or here example...

php - Mysql join get multiple rows at right -

i have 2 tables: # products (id,name,value,time) # product_data (id,product_id,field_name,field_value) (1,1,color,red) (2,1,size,big) (3,1,whatever,value) i want make query takes field values products table , adds product_data rows have same product id, this: $row = array( id => 1, name => gloves, value => 15, color => red, size => big, ... ) maybe not way store data , should store fields in 1 table since there lot of different product types there lot of empty fields. queries lot simpler because have able sort products color example (by values products_data ). i have tried example lists field names, not values: select *, group_concat(product_data.fname) afield product_data left join products on products.id = product_data.pid just take @ solution , question, similar. involves firing 2 queries , using pdo::fetch_group. $product row similar one: $product = [ 'id' => 1, 'name' => 'somename',...

css - How prevent h2 content from breaking in :before content? -

http://i.imgur.com/wsfucxd.png yeah have little problem :before icon. what want h2 content on horizontal line , not after line break under :before content. any suggestions? use position:absolute;left:0; icon , add padding-left size of icon h2. note: don't forget set position of h2 relative. example: h2{ position: relative; padding-left: 60px; /* size of icon plus spacer */ } h2:before{ content:''; position:absolute; left:0; height: 50px; /* height of icon */ width:50px; /* width of icon */ background-image:url(img/icon.png); /* icon */ }

Crystal Report Loading Error in VS 2010 C# -

i'm doing project in c# 2010 generate reports. want use crytal report reporting on project getting following error - could not load file or assembly ‘file:///c:\program files (x86)\sap businessobjects\crystal reports .net framework 4.0\common\sap businessobjects enterprise xi 4.0\win32_x86\dotnet1\crdb_adoplus.dll’ or 1 of dependencies. system cannot find file specified. can me out error. to solve error.you have add following code app.config file. <startup uselegacyv2runtimeactivationpolicy="true"> <supportedruntime version="v4.0" sku=".netframework,version=v4.0"/> </startup>

hadoop - Apache Kylin installation without Sandbox -

i wondering if there resources regarding apache kylin installation without sandbox (like cloudera, hortonworks) support. have managed following: install hadoop 2.6 install hive install hbase then used binary kylin site , far been able run it. problem start when try build cube, map reduce job gets stuck in step 2. thinking if still assuming in sandbox mode , not submitting job hadoop @ (there no entry in hadoop jobtracker). so need solution regarding two: 1. possible configuration of kylin in pure hadoop setup (no sandbox) 2. somehow enable kylin setup submit job hadoop. there no such sandbox or non-sandbox configuration in kylin. make sure machine kylin runs has hadoop setup correctly , should fine. under scene, kylin.sh uses hbase classpath , hive -e set | grep 'env:classpath' detect hadoop settings. double check these commands work expect if not sure cluster kylin connects to. if kylin has problem submitting mr jobs, check 2 places. first hadoop ...

Setting default value for @Html.EditorFor in ASP.NET MVC -

hi i'm trying set value @html.editorfor in view razor engine. but value not displaying in browser when run application. issue? here editor: @html.editorfor(model => model.firstname, new { @value = "divaya sree" }) the best way initialize model in controller , pass model view model.firstname = "divaya sree"; return view(model); now can use @html.editorfor(model => model.firstname) or work @html.textboxfor(c => c.firstname, new { @value = "divaya sree" })

Set Filter Issue with Webmaster Service - Google API PHP V3 -

i'm working webmaster tools api v3 queries search console. script works great: login works , when request queries result correct. need set filters queries tablet devices. how can this? code is: $request = new google_service_webmasters_searchanalyticsqueryrequest; $request->setstartdate('2015-06-03'); $request->setenddate('2015-06-09'); $request->setdimensions(array('query')); $request->setrowlimit("5"); $filter = new google_service_webmasters_apidimensionfilter; $filter->setdimension("device"); $filter->setoperator("equals"); $filter->setexpression("tablet"); $filters = new google_service_webmasters_apidimensionfiltergroup; $filters->setfilters($filter); $request->setdimensionfiltergroups($filters); $request->setsearchtype("web"); $qsearch = $searchanalytics->query("http://www.****.**", $request); i've tried create 2 object (google_service_webmasters_ap...

javascript - How to handle this Firebase error -

i error seems should handled don't know how because error happening on firebase sdk app.js:35774 uncaught (in promise) error: disconnect @ repo_1.repo.reruntransactionqueue_ (app.js:35774) @ repo_1.repo.reruntransactions_ (app.js:35686) @ object.<anonymous> (chat.js:35666) @ persistentconnection.cancelsenttransactions_ (app.js:33032) @ persistentconnection.onrealtimedisconnect_ (app.js:32911) @ connection.close (app.js:32266) @ connection.onconnectionlost_ (app.js:32232) @ websocketconnection.<anonymous> (app.js:31964) @ websocketconnection.onclosed_ (app.js:31647) @ websocket.mysock.onclose (app.js:31504) it happens during disconnection event. have transaction code might connected error, although i'm not sure why might causing error: var timeupdate = 300 firebaseapp.ref.child('sessions') .child('sid') .child('time_on') .transaction((v) => { return v + timeupdate }) if need more info, let me know update post ...

javascript - regex Adding !important (if not exist) before semicolon -

i have html element string , have add "!important" before each ';' if still not exist. i'm using regex : /[^!important(\s*)];(?=[^<>]+:|\s*")/g lets slice regex, first part: [^!important(\s*)]; checking if there no "!important" before ';'. (\s*) inside allows add spaces between "!important" ';'. the second part of regex : (?=[^<>]+:|\s*") i don't sure it, believe finds ';' in string. finally, use javascript 'replace' make changes. var str3 = str.replace(/[^!important(\s*)];(?=[^<>]+:|\s*")/g, '!important;') i used question posed here : regex matching !important styles , changes, got following result : https://jsfiddle.net/7bhmjapl/19/ few problems : this regex finds ';' not follows after "!important", marks ';' , 1 character came before. example : "color:yellow;" -> marks : "w;" . furt...

winapi - Error while build cocos2d-x project win32 on Visual Studio 2013 Ultimate -

now have started learn cocos2d-x , have installed , initialized project finished, after re-build these bugs follows, hope me, have tried use dll files fixer fix because thought missing link library or error, have try on friend's computer, build , run soundly. (project here created , no editing of on that). how fix it? thank much. sorry can't upload image. link have image capture screen. https://app.box.com/s/aa7s9dty9xwh9v58ihts8s5kd8hsr9x8

android - Connection is not defined in cordova network information plugin -

i have followed article: to network information of device in ionic app android. it works fine on browser when install compiled apk in android phone, gives error says reference error : connection not defined. @ line use $cordovanetwork.isonline(); i have been banging head around , have done due research , tried uninstalling , installing in order suggested no help. help me fix issue. problem not issue code , may need clever fix working. this same issue being discussed here have not understood given piece of code coming from. index.html : <!doctype html> <html ng-app="starter" > <head> <meta charset="utf-8"> <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width"> <meta http-equiv="content-security-policy" content="default-src *; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inl...