Posts

Showing posts from August, 2015

java - Android send SMS from code -

this question has answer here: send sms in android 14 answers in android there option make call code , there option move user caller app number , let him call himself. have code move user sms app content ready: uri smsuri = uri.parse("sms:0542158081"); intent intent = new intent(intent.action_view, smsuri); intent.putextra("sms_body", text); startactivity(intent); but want send sms code phone call instead of waiting user. how can it? user smsmanager so smsmanager smsmanager = smsmanager.getdefault(); smsmanager.sendtextmessage("phonenumber", null, "sms message", null, null);

java - Android Audio Recorder with pause and Resume functionality -

is there can me out developing flexible audio recorder play , pause functionality? noted: have used pauseresumeaudiorecorder . not flexible when stop recording file corrupting. have used mp4parser library taking lot of time merging 2 large files. here mp4wrapper class using merging 2 files. public final class mp4parserwrapper { public static final string tag = "mp4parserwrapper"; public static final int file_buffer_size = 1024; private mp4parserwrapper() { } /** * appends mp4 audios/videos: {@code anotherfilename} {@code mainfilename}. * * @param mainfilename first file path. * @param anotherfilename second file path. * * @return true if operation made successfully. */ public static boolean append(string mainfilename, string anotherfilename){ try { file targetfile = new file(mainfilename); file anotherfile = new file(anotherfilename); if (targetfile.exists() && targetfile.length() > 0) { string tmpfilenam

java - How to select a PDF file using startActivityForResult intent and return result in a second class -

i relatively new android programming, want create pdf reader calls inbuilt file manager select pdf file , display pdf file in second class. here code far still having issues, think second activity unable selected pdf file , unable fix error mainactivity package com.example.user.projectapp; import android.app.activity; import android.app.listactivity; import android.content.context; import android.content.intent; import android.database.cursor; import android.net.uri; import android.provider.openablecolumns; import android.support.v7.app.appcompatactivity; import android.os.bundle; import android.util.log; import android.view.view; import android.widget.arrayadapter; import android.widget.listview; import java.io.file; import java.io.ioexception; import java.io.inputstream; import java.net.uri; import java.net.urisyntaxexception; import java.util.arraylist; import java.

scala - Future not working in Slick 3.1.x -

this function in slick prints "before future", doesn't print within future.map ; seems future never executed, ideas problem? note: i'm running slick standalone, not within play def readmany = { val db = database.forurl("jdbc:mysql://localhost:3306/dddd", driver="com.mysql.jdbc.driver", user="root", password="xxx") val query = tablequery[tabledb] val action = query.sortby(_.name).result val future = db.run(action.astry) println("before future") future.map{ case success(s) => { s.map { row => somerow ( row.col1, row.col2 ) } println("s:" + s) } case failure(e) => throw new exception ("failure in readmany: " + e.getmessage) case _ => println("???") } } first of case _ => println("???") redundant, guess added debug stat

java - Does HIPAA require to log ALL queries to the database (including calls from JDBC)? -

we use postgres. after setting log_statement=all, it'll log queries psql, not application accessing via jdbc. i find bit counter-intuitive. isn't ~95% of data access in application done via jdbc (or similar in other languages)? in articles hipaa implementation, it's recommemded set log_statement=all. purpose serve if majority of data access wouldn't logged @ all? what queries should log (or should log them @ all?) should use log4jdbc? or log_statement=all enough?

ios - Cannot select version for internal testing after completed processing -

Image
after receiving mail build has completed processing: dear ***, the following build has completed processing: (...) you can use build testflight testing or submit app store. i wanted distribute via testflight internal testers. however, itunesconnect keeps telling me upload build: strange thing is, if wanted distribute external testers, available: what doing wrong?

php - How to fetch a video from db in codeigniter -

i'am trying code <video width="320" height="240" controls> <source src="<?php echo 'resource/video/'; echo $image; ?>" type="video/mp4"> <source src="<?php echo 'resource/video/'; echo $image; ?>" type="video/ogg"> </video> you can use base_url() this: <video width="320" height="240" controls> <source src="<?php echo base_url('resource/video/'.$image); ?>" type="video/mp4"> <source src="<?php echo base_url('resource/video/'.$image); ?>" type="video/ogg">

spring - java.security.InvalidAlgorithmParameterException: null -

i've run exception when trying run spring boot application ssl certificate. app running inside kubernetes docker container. the key issue description of excpetion null . has run such issue? update1 - i've based dockerfile on openjdk:8-jre-alpine . i've revert openjdk:8u111-jre-alpine , error disapear. still don't know cause of error. java.lang.runtimeexception: java.security.invalidalgorithmparameterexception @ sun.security.ssl.handshaker.checkthrown(handshaker.java:1476) ~[na:1.8.0_121] @ sun.security.ssl.sslengineimpl.checktaskthrown(sslengineimpl.java:535) ~[na:1.8.0_121] @ sun.security.ssl.sslengineimpl.readnetrecord(sslengineimpl.java:813) ~[na:1.8.0_121] @ sun.security.ssl.sslengineimpl.unwrap(sslengineimpl.java:781) ~[na:1.8.0_121] @ javax.net.ssl.sslengine.unwrap(sslengine.java:624) ~[na:1.8.0_121] @ org.apache.tomcat.util.net.secureniochannel.handshakeunwrap(secureniochannel.java:459) ~[tomcat-embed

Angular2/Angular seed http-proxy-middleware proxy api requests -

im using angular seed project , trying set proxy api requests backend service running on different port. my code far: /* add proxy middleware */ this.proxy_middleware = [ require('http-proxy-middleware')({ ws: false, target: 'http://localhost:5555', router: { // when request.headers.host == 'dev.localhost:3000', // override target 'http://www.example.org' 'http://localhost:8000' //'http://localhost:5555/basepath/api' : 'http://localhost:7000/api' } }) ]; basically need route api matching http://localhost:5555/basepath/api http://localhost:7000/api though cant seem working using http-proxy-middleware. had working using proxy-middleware have switched need modify request headers , seems can done http-proxy-middleware. spent bit of time trying work , ended adding project.config.ts within constructor. /* add proxy middleware */ this.proxy_middleware = [ require

Use Angular 2 in a multiple page website -

how angular 2 quickstart app using angular 2 in website? my main problem index.html in not in route folder of app. possible have many pages have angular 2 apps? i realise angular 2 designed spas html component system must useful in sorts of websites. good page here is angularjs single-page applications (spas)? no actual info on how it. i use or little angular 2 necessary in different pages across website project. a sample website using angular 2 in way great. to answer question (just in case interested), use little typescript load html templates. simple. public static getfilecontentasync = async (path: string): promise<string> => { return await new promise<string>((resolve, reject) => { // set xml http request object. let xhr: xmlhttprequest = new xmlhttprequest(); xhr.open("get", baseurl + path); xhr.send(); xhr.onload = () =>

lexer - Lexical Analyser In Java -

i have been trying write simple lexical analyzer in java . the file token.java looks follows : import java.util.regex.matcher; import java.util.regex.pattern; public enum token { tk_minus ("-"), tk_plus ("\\+"), tk_mul ("\\*"), tk_div ("/"), tk_not ("~"), tk_and ("&"), tk_or ("\\|"), tk_less ("<"), tk_leg ("<="), tk_gt (">"), tk_geq (">="), tk_eq ("=="), tk_assign ("="), tk_open ("\\("), tk_close ("\\)"), tk_semi (";"), tk_comma (","), tk_key_define ("define"), tk_key_as ("as"), tk_key_is ("is"), tk_key_if ("if"), tk_key_then ("then"), tk_key_else ("else"), tk_key_endif ("endif"), open_bracket ("\\{"

model view controller - Url problems in MVC C# -

i have problem in mvc project in url. in route config have following code: routes.maproute( name: "test", url: "{controller}/{action}/{id}/{selected}/{category}/{engineid}‌​", defaults: new { controller = "product", action = "subcategories"} ); the parameter category contains name of selected category. in database have category name: "packet / set". if in website choose category , in url appear categoryname subcategories/92/bertone-freeclimber-2.0/packet / set /33720‌%e2%80%8b. i got the server error in '/' application. resource cannot found. error. if the category name doesn't contain "/" character, evrything works fine: subcategories/94/bertone-freeclimber-2.0/air%20filter/33720%e2%80%8c%e2%80%8b could advise how should resolve this? you need encode slashes in url %2f . can use javascript encodeuricomponent() function. mvc automatically dec

Python 2.7 code for Replacing whole value of a column in a csv file -

i have data imported sql server in csv file headers. i want write **code in python2.7 ** can read csv file , re-write new csv file in have masked last 2 columns regex 'secret value'. sample input of csv: id,name,city,ssn,creditcardno 1,joy,london,123-465-456,123456789087645 2,sam,newyork,765-465-457,98765434567345 3,jhon,paris,678-365-654,765654542345677 4,eric,delhi,456-888-999,123456789087645 expected sample output: id,name,city,ssn,creditcardno 1,joy,london,secret value,secret value 2,sam,newyork,secret value,secret value 3,jhon,paris,secret value,secret value 4,eric,delhi,secret value,secret value my attempt: import sys import csv r = csv.reader(open('c:\\users\\praveen\\workspace\\samplefiles\\test1.csv')) lines = [l l in r] lines[2][2] = '30' writer = csv.writer(open('c:\\users\\praveen\\workspace\\samplefiles\\test4.csv', 'wb')) writer.writerows(lines) this changes 1 element only, want whole column masked. i

java - Run mvn install on a cloned repo using chef -

i've cloned small webapp onto client, next step me maven build war file can run it. i'm capable of installing maven , running command in executable block hoping on cleaner solution. the documentation maven cookbook isn't vast , can't seem find anywhere details how run maven build commands , using it. appears used more downloading dependencies rather building projects. any suggestions how might achieve without 'execute' block ? it's going execute resource or call shell_out @ point. build custom resource around make more resource-y @ heart maven install procedural step, not convergent step it's going bit awkward. if want background on procedural vs. convergent, wrote guide @ https://coderanger.net/thinking/ . that said, moving forward execute block fine. make sure consider idempotence rules, either notification or not_if / only_if guards.

Switching Hosting Company PHP GET Script Won't Work -

i switched hosting accounts dreamhost inmotion hosting... used use script worked fine on dreamhost since switch creates xml file empty. ideas? <?php $xml = file_get_contents('ftp://user:user@aphrodite.web.net/exports/xml/products.xml'); file_put_contents('./pro_data/products.xml', $xml); ?> i tried php version 5.5-7.0 same thing. in php.ini added following file , save. allow_url_fopen=on

r - Vegan: Number of significant axes in RDA -

i have data frame of phytocoenological relevés, rows sites , columns species. run rda on , want site scores on significant axes. how know, how many axis of rda.spe model significant? personally there no way. however, people have suggested ways find number of non-significant axes. of these discussed in vegan github issue . personal experience many of these ways work poorly: if generate data defined number of dimensions + random error, methods fail find known number of axes. many of these methods easy-ish implement (although have not implemented them in vegan ), though. see discussion linked above. your title asks pcoa, example uses rda. however, similar methods apply both (or fail both think).

python - googleapiclient/ apiclient youtube data api v3 -

i installed prerequisite libraries using googleapiclient python(youtube data api v3). while retrieving data, errors coming. code same youtube api website. kindly let me know possible solution traceback (most recent call last): file "/home/b/pycharmprojects/project/search_list_keyword.py", line 3, in googleapiclient.discovery import build file "/home/b/pycharmprojects/project/googleapiclient/discovery.py", line 75, in oauth2client.client import googlecredentials file "/usr/local/lib/python2.7/dist-packages/oauth2client/client.py", line 31, in import urllib.request, urllib.parse, urllib.error importerror: no module named request

r - reading graphml format file -

i have dataset of weighted network has graphml format. used below function read in r using "igraph" package, did not data's weight. idea help? net1<-read.graph("text.graphml", format = "graphml") based on http://igraph.org/r/doc/read_graph.html , might change net1<-read.graph("text.graphml", format = "gml")

recursion - mirroring a list in prolog -

my wanted output this: ?- mirror ([1,2], [] , x ). x= [1,2,2,1] what have far: mirror(l,r,x):- l r , [r| revertlist(l,x)] . i cant think of how works, please me it not different reversing list, how write not going work. googled "prolog is" , after maybe 10 seconds see is/2 arithmetic expressions. don't know how think can put predicate maybe not possible? if want append can use append append mirror reversed list end of original list final "mirror" result: mirror(x, y) :- reverse(x, r), append(x, r, y). but easy? wonder maybe there more question? don't know why have 3 arguments when need 2 arguments? maybe thought can use accumulator reverse list because reverse list use accumulator this? list_rev(l, r) :- list_rev(l, [], r). list_rev([], r, r). list_rev([x|xs], ys, r) :- list_rev(xs, [x|ys], r). but easy google, googled , found it, maybe googled , didn't it? "mirrored" need keep original list too, so: list_m

c# - multi-file itemtemplate should only add one of it's files once, even if the item is added many times -

i have solution holds vsix project , itemtemplate project. item template has multiple files added when used. looks this: <projectitem replaceparameters="true" targetfilename="commands\$fileinputname$command.cs">commands\templatecommand.txt</projectitem> <projectitem replaceparameters="true" targetfilename="descriptions\$fileinputname$.xml">descriptions\template.xml</projectitem> <projectitem replaceparameters="true" targetfilename="ui\$fileinputname$designer.cs">ui\templatedesigner.txt</projectitem> <projectitem replaceparameters="true" targetfilename="ui\$fileinputname$designerdialog.cs">ui\templatedesignerdialog.txt</projectitem> <projectitem replaceparameters="true" targetfilename="ui\$fileinputname$designerdialog.designer.cs">ui\templatedesignerdialog.designer.cs</projectitem> <projectitem replaceparameters="

php - Polymer loads in a choppy fashion on mobile and other browsers -

i building web application using polymer (web components) , seems work fine on chrome, when try load page on mobile, gets choppy loading 1 element @ time , page looks bare-bones second or 2 before snapping place. i have vulcanized of elements needed vulcanized file 1 mb , takes chrome 382 ms load. what can speed loading? <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="theme-color" content="#0097a7"> <link rel="icon" href="logos/tab%20icon.png"> <!-- polymer javascript --> <script src="polymer1.0/components/bower_components/webcomponentsjs/webcomponents-lite.min.js"></script> <link rel="import" href="uptikcss/vulcanized/imports.vulcanized.html"> <link rel="import" href="materialdesignelements/vulcanized/elements.vulcanized.html"> <title>

sql - Why does an int column values defaults to '0' when passed empty? -

i have table integer column. create table [dbo].[tble1]( [id] [int] not null, [test] [nchar](10) null ) when try insert values , pass empty string id column below, gets inserted , value of id column 0 default. insert [dbo].[tble1] ([id],[test]) values ('','a') i couldn't find satisfying reasoning behind it. 1 please share thoughts on this? what happening '' being converted integer. rules string can converted, based on digit characters in string. if string empty, gets converted 0. so, conversion happening @ "top" level. types don't match sql server attempts implicit conversion. unfortunately, documentation not clear on topic: character expressions being converted exact numeric data type must consist of digits, decimal point, , optional plus (+) or minus (-). leading blanks ignored. comma separators, such thousands separator in 123,456.00, not allowed in string. to honest, inte

python - Single legend at changing categories (!) in subplots from pandas df -

roughly speaking need create 1 legend several subplots, have changing number of categories = legend entries . let me clarify bit deeper: i have figure 20 subplots, 1 each country within spatial scope: fig, ax = plt.subplots(nrows=4, ncols=5, sharex=true, sharey=false, figsize = (32,18)) within loop, logic group data need normal 2-dimensional pandas dataframe stats , plot each of these 20 axes: colors = stats.index.to_series().map(type_to_color()).tolist() stats.t.plot.bar(ax=ax[i,j], stacked=true, legend=false, color=colors) however, stats dataframe changing size loop loop, since not every category applies each of these countries (i.e. in 1 country there can 2 types, in there more 10). reason pre-defined specific color each type. far, creating 1 legend every subplot within loop: ax[i,j].legend(fontsize=9, loc='upper right') this works, blows subplots unnecessarily. how can plot 1 big legend above/below/beside these plots, since have defined according color.

Purpose of ?? in Swift -

this question has answer here: ?? operator in swift 4 answers can explain advantage of writing ?? .would great if possible explain below code snippet how improve code? import foundation var samplestring:string? print(samplestring ?? "nil") thanks in advance. from apple documentation: the nil-coalescing operator (a ?? b) unwraps optional if contains value, or returns default value b if nil. expression of optional type. expression b must match type stored inside a. in case if samplestring nil return default string containing text "nil".

passwords - Using php.net's password_verify" script as offered works, but fails if hash is read back from DB -

php.net script: http://php.net/manual/en/function.password-hash.php and: http://php.net/manual/en/function.password-verify.php the apparent simplicity of password verification routine appealing, after day of reading @ stackoverflow , innumerable hacks, here simple, not-at-all-secure, testing version: <?php $p = "bumblebee"; $hash = (password_hash($p, password_default)); echo ($p); echo ($hash); if (password_verify('bumblebee', $hash)) { echo 'password valid!'; } else { echo 'invalid password.'; } ?> above returns 'password valid!' (this 2 scripts php.net combined) below not work (only diff hash written db , read back, converted string) <?php $username = $_request["username"]; $password = $_request["password"]; // $p = "$password"; // $hash = (password_hash($p, password_default)); //set db access variables require_once('./php/hs_dblogin.php'); //

objective c - Why atomic is not sufficient in thread safety for complex objects -

atomic keyword applied properties of class, thread safety. usage of atomic thread safe primitive data types not complex objects (modal objects). why ? thanks in advance kind reply! update if person class having properties name , age , address . consider @property(atomic, strong) person *adam; how far object adam thread safe ? this dupe of what's difference between atomic , nonatomic attributes? prior edit, though wasn't obvious. since answer referred often, added following underscore thread safety having kind of transactional model reads , writes controlled such system in known, integral, state when read or write happens. atomicity of single property cannot guarantee thread safety when multiple dependent properties in play. consider: @property(atomic, copy) nsstring *firstname; @property(atomic, copy) nsstring *lastname; @property(readonly, atomic, copy) nsstring *fullname; in case, thread renaming object calling setfirstname: , c

Creating a movie of histograms in matlab -

i used below code create 2 movies of histographs in matlab: h1 = figure hold on vid = videowriter('graph.avi');open(vid); t=1:time figure(h1); cla hist(eighsum(t,:),40) currframe = getframe(h1); writevideo(vid,currframe); end close(vid); and h2 = figure hold on video = videowriter('graphh.avi');open(video); sizeclu = cell(1,size(clustersize,2)); = 1:numel(sizeclu) sizeclu{i} = [clustersize{:,i}]; figure(h2); cla hist(sizeclu{i}) currframe = getframe(h2); % gets figure 2 writevideo(video,currframe); end close(video); i want numbers below 1 don't shown in histogram. how can that? do: [counts,centers] = hist(eighsum(t,:),40); centers(counts < 1) = []; counts(counts < 1) = []; bar(centers,counts);

reactjs - How to compile only JSX and imports and not ES6 code? -

i using react-scripts, , i'd leave es6 code is, debugging purpose. example, browser understand arrow functions, generators, async await , classes (we use these features lot), need jsx compilation. besides, when code packed bundle.js, there "uncaught syntaxerror: unexpected token import", need compile "import" , "export" statements, because use that: import {func} "module"; export * "module"; i know there source maps, , help, after gets hard execute code step step in debugger , play around in console, while on breakpoint.

algorithm - Find largest rectangle containing only zeros in an N×N binary matrix -

given nxn binary matrix (containing 0's or 1's), how can go finding largest rectangle containing 0's? example: 0 0 0 0 1 0 0 0 1 0 0 1 ii->0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 <--iv 0 0 1 0 0 0 iv for above example, 6×6 binary matrix. return value in case cell 1:(2, 1) , cell 2:(4, 4). resulting sub-matrix can square or rectangular. return value can size of largest sub-matrix of 0's, in example 3 × 4. here's solution based on "largest rectangle in histogram" problem suggested @j_random_hacker in comments: [algorithm] works iterating through rows top bottom, each row solving this problem , "bars" in "histogram" consist of unbroken upward trails of zeros start @ current row (a column has height 0 if has 1 in current row). the input matrix mat may arbitrary iterable e.g., file or network stream. 1 row required available @ time. #!/usr/bin/env python c

Why Erlang Dialyzer cannot find type error in the following code? -

free_vars_in_dterm({var, v}) -> {var, v}; cannot type check, however, dialyzer says ok. $ dialyzer *erl checking whether plt ~/.dialyzer_plt up-to-date... yes proceeding analysis... done in 0m0.66s done (passed successfully) code below: -module(formulas). -type formulas() :: {predicate(), [dterm()]} | {'~', formulas()} | {'&', formulas(), formulas()} | {'|', formulas(), formulas()} | {'->', formulas(), formulas()} | {'<->', formulas(), formulas()} | {'exist', variable(), formulas()} | {'any', variable(), formulas()}. -type dterm() :: constant() | variable() | {func(), [dterm()]}. -type constant() :: {const, atom()} | {const, integer()}. -type variable() :: {var, atom()}. -type func() :: {function, function_na

spring - Difference between AuthenticationManagerBuilder and HttpSecurity.authenticationProvider -

to provide custom authentication provider in spring boot, need both of following? , difference? authenticationmanagerbuilder httpsecurity.authenticationprovider(...) @configuration @enablewebsecurity public class securityconfig extends websecurityconfigureradapter{ @autowired private myauthenticationprovider myauthenticationprovider; @autowired @override protected void configure(authenticationmanagerbuilder auth) throws exception { auth.authenticationprovider(myauthenticationprovider); } // --------------- or/and ? ---------------- @override protected void configure(httpsecurity http) throws exception { http .authenticationprovider(myauthenticationprovider) // ... } } you need use 1 of 2 options. internally, http.authenticationprovider making call authenticationmanagerbuilder.authenticationprovider.

java - How to insert foreign key references into database with JPA? -

in company model there employee superclass (it has public setter & getter methods): @entity @inheritance @discriminatorcolumn(name="emp_type") @table(name="employees") public abstract class employee implements printable, serializable { @id @generatedvalue @column(name = "employee_id", unique = true) private int id; @column(name = "position") @enumerated(enumtype.string) private position position; @column(name = "name") private string name; @column(name = "salary") private double salary; @transient public list<project> projectsworkingon = new arraylist<>(); public employee() { } } there 2 subclasses worker, leader extending employee , , 5 other classes extending this, e.g.: developerleader : @entity @discriminatorvalue("dl") public class developerleader extends leader { public developerleader() { } } i have proj

php - How to execute laravel artisan commands in linux server -

i have uploaded project on linux server, don't know how execute laravel commands on server. commands: php artisan migrate php artisan migrate:rollback php artisan migrate:reset php artisan migrate:refresh php artisan db:seed if lemp stack installed along composer. run composer install command should available. https://www.digitalocean.com/community/tutorials/how-to-install-laravel-with-an-nginx-web-server-on-ubuntu-14-04

media player - Android ExoPlayer becomes Green and Pixelated onResume() -

Image
in android app, have media player implements exoplayer interface. when home button pressed, player supposed pause. then, when app relaunched recent apps, player should continue playing left off. originally, called player.release() in onpause() , got rid of entire player instance. then, when app resumed, created new instance of player , used seekto() jump correct position. @override public void onpause() { if (player != null) { saveplayerposition(); player.release(); player = null; } super.onpause(); } @override public void onresume() { super.onresume(); if (!player.isplaying()) { player = exoplayerfactory.newsimpleinstance(context, trackselector, new defaultloadcontrol(), drmsessionmanager); setplayerlisteners(); exoplayerview.setplayer(player); player.setplaywhenready(false); player.seekto(playerwindow, playerposition); } } the problem above code every time loaded app

sqoop import changes ownership : hive table displays NULL values in columns -

Image
i have table orders_1 300 records , want load data hive table. when ran sqoop hive-import command, table data loaded in /hive/warehouse/ location.but user ownership has changed , i'm facing issue when querying hive table view loaded table data.it displays columns null values. sqoop-import --connect jdbc:mysql://localhost/retail_db --username root --password cloudera --table orders_1 --hive-import --hive-database my_sqoop_db --hive-table hive_orders1 --hive-overwrite --fields-terminated-by '\t' --lines-terminated-by '\n' -m 1; output : info hive.hiveimport: loading uploaded data hive logging initialized using configuration in jar:file:/usr/lib/hive/lib/hive-common-0.13.1-cdh5.3.0.jar!/hive-log4j.properties ok time taken: 1.039 seconds loading data table my_sqoop_db.hive_orders1 chgrp: **changing ownership** of 'hdfs://quickstart.cloudera:8020/user/hive/warehouse/my_sqoop_db.db/hive_orders1/part-m-00000': user not belong hive table my_sqoop_db.

javascript - Lazy load oembed ($.ajax) with lazysizes -

i have modal loads (more 50 sometimes) third party embeds different sources (twitter, instagram, facebook posts, facebook videos, ...). all of them launched using oembed (standardized embed format) <div id="embeds-list"> <div> <div id="item1" class="list-item"> <figure class="instagram-embed"> <script> var url = « https://api.instagram.com/oembed?url=https://www.instagram.com/p/5456544654565/"; embed_request = { url: url, datatype: "jsonp", cache: false, success: function (data) { try { var embed_html = data.html; $( "div#item1 > figure").html(embed_html); } catch (err) { console.log(err); } } }; $.ajax(embed_request); </script> </figure class="instagram-embed"> </div> <div id="item2" class="list-item"> <figure cla

AEM classic UI how to and good readings -

i working on aem 6.2 , interested there blogs, tutorials or else can recommend read it. in more detail, looking more detailed using listeners in dialog files, , cant find read it. thanks 1) classicui if looking classic ui, you'll need focus on tutorials around cq tutorials give 101. 2) general reading here links, started: quick video https://www.youtube.com/watch?v=1jqb5y6wupa 101s http://www.aemcq5tutorials.com/tutorials/aem-cq5-tutorial/ http://help-forums.adobe.com/content/adobeforums/en/experience-manager-forum/adobe-experience-manager.topic.html/forum__zjpb-hello_communitymemb.html aem learning tech up https://8bitplatoon.blogspot.co.za/2016_01_01_archive.html adobe's master reference https://docs.adobe.com/docs/en/aem/6-2/deploy.html#what%20is%20aem ? find super useful , structured. best of luck.. , enjoy journey.

How to stop setEmptyView displaying a TextView while populating a ListView with Android? -

in mainactivty i'm displaying list of items, firebase database using firebaselistadapter this: firebaselistadapter = new firebaselistadapter<string>(mainactivity.this, string.class, r.layout.list, ref) { @override protected void populateview(final view v, final string listname, int position) { ((textview )v.findviewbyid(r.id.list_name)).settext(listname); } }; listview = (listview) findviewbyid(r.id.list_view); listview.setadapter(firebaselistadapter); textview emptyview = (textview) findviewbyid(r.id.empty_view); listview.setemptyview(emptyview); the problem is, when activity starts, emptyview displayed if have data in adapter. happening short time, while listview populated , disappears. how can stop happening? you can see, have set listview.setemptyview(emptyview); after have set firebaselistadapter no luck. how .xml file looks like: <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.coordinatorlayout

linked list - Java Print Everything in Queue Using LinkedList and The Deque Interfaces -

i'm little stuck here, need helpm here's code: import java.util.*; import java.util.iterator; class customer { public string lastname; public string firstname; public customer() { } public customer(string last, string first) { this.lastname = last; this.firstname = first; } public string tostring() { return firstname + " " + lastname; } } class hourlycustomer extends customer { public double hourlyrate; public hourlycustomer(string last, string first) { super(last, first); } } class genqueue<e> { private linkedlist<e> list = new linkedlist<e>(); public listiterator<e> iterator = list.listiterator(); public void enqueue(e item) { list.addlast(item); } public e dequeue() { return list.poll(); } public e show(){ return list.peek(); } public void printqueueelements

Git trying use proxy while operations with remote repository -

i getting error fatal: unable access http://some_repo_addr : failed connect some.proxy.addr.lan port 1080: timed out pushing http://some_repo_addr why git trying use proxy server while different operations remote repository? git got them? mean proxy settings. cause delete git options related using proxy. from, git take proxy server host, port , on if not specified in git options? how force git not use proxy options? finally found problem, maybe somebody so if have environment variable %http_proxy% in windows git trying use it, no matter http.proxy setting in git set.

Paypal IPN - detect if payment was unsuccessful due to insufficient funds -

is there way in ipn detect if transaction unsuccessful due insufficient funds? can't work on sandbox somehow. still continues accept payment if buyer has not enough funds. think related credit card can't seem remove last credit attached account. want test app using buyer insufficient funds can sure can trap transactions that. using paypal rest api in php , ipn this. as possible, don't want add or sorts achieve because paypal hard understand. best place check 'listener' ipn simulator here https://developer.paypal.com/developer/ipnsimulator/ (after log paypal sandbox account). you can test sorts of payments there.

sql - How to run a SSIS Package which has a file based source automatically -

Image
i have similar issue question: how run ssis package has file based source , target . @ first, there no known program open dtsx package (my package grabs table 1 server , places on another). did digging , found dtexecui program file, , open execute package utility, doesn't populate package source (file) or package name (desktop\xxx.dtsx). how can double-clicking file executes ssis package - or @ least populates names file clicked on? in advance. i'm guessing since windows didn't automatically create association you, default missing parameters executable (because program should open fields populated). try this: download default programs editor , run it click file type settings click context menu locate .dtsx in list , click next click open list item , edit selected command the path should "c:\program files (x86)\microsoft sql server\130\tools\binn\managementstudio\dtexecui.exe" /f "%l" - path dtexecui may different, of s

javascript - How to dinamically configure Passportjs strategies? -

i playing around passport, , configuring twitter login way: passport.use(new twitterstrategy({ consumerkey: '*****', consumersecret: '*****', callbackurl: "http://blabla/callback" }, function(token, tokensecret, profile, done) { done(null, profile) } )); i want able configure values: (consumerkey, consumersecret, callbackurl) on runtime, based on logged user. advice? you need use your consumer key , consumer secret, not ones of users. application able authenticate your users using twitter. keys , secrets used authenticate app twitter api. see example project: https://github.com/passport/express-4.x-twitter-example

typescript - How to import styles for ui custom library in angular 2? -

i working in ui library , have imported scss styles in components (button example). if instantiate component button twice in client app (my ui library dependency), scss calls twice too. there way, app client calls once button's scss? now import scss in component example: have component "my-custom-button" my-custom-button.html, my-custom-button.scss , my-custom-button.ts . import scss file in my-custom-button.ts stylesurl. what happening here ? angular uses component metaphore, each component has own view encapsulation. emulated default (see below meaning). you can switch viewencapsulation mode setting encapsulation property 1 of these values : viewencapsulation.none : no encapsulation done, component style apply element matching selector used in css. viewencapsulation.emulated : angular rewrite components styles (adding custom attributes selectors) match related component , append inline <style> tag n head . viewencapsulation.native : angula

java - Add headers to ImageLoader android volley -

in app have used imageloader load image networkview. mrequestqueue = volley.newrequestqueue(getapplicationcontext()); mimageloader = new imageloader(mrequestqueue, new imageloader.imagecache() { private final lrucache<string, bitmap> mcache = new lrucache<string, bitmap>(10); public void putbitmap(string url, bitmap bitmap) { mcache.put(url, bitmap); } public bitmap getbitmap(string url) { return mcache.get(url); } }); my question is, how can add http headers ?

machine learning - Python's Sklearn ngram accuracy decreases as ngram length increases -

i've got hate speech dataset containining 10k marked tweets: looks this tweet | class hi | not offensive ugly muppet | offensive not hate speech **** jew | hate speech now i'm trying use multinomialnb classifier in python sklearn library, , heres code. import pandas pd import numpy np sklearn.feature_extraction.text import countvectorizer sklearn.naive_bayes import multinomialnb data = pd.read_excel('myfile', encoding = "utf-8") data = data.sample(frac=1) training_base = 0; training_bounds = 10000; test_base = training_bounds+1; test_bounds = 12000; tweets_train = data['tweet'][training_base:training_bounds] tweets_test = data['tweet'][test_base:test_bounds] class_train = data['class'][training_base:training_bounds] class_test = data['class'][test_base:test_bounds] vectorizer = countvectorizer(analyzer='word', ngram_range=(1,1)) train_counts = vectorizer.fit_t

node.js - Streaming vs linking static files -

i'm looking advantages of streaming on linking static files, eg images, pdf. to make question more clear, using node can stream files using fs.createreadstream i can understand streaming videos etc why should stream static files. can provide href? if static files available on url there's no need stream them using node. if node app wants return contents of static file hosted , served somewhere instead of streaming contents can return redirect file's url.