Posts

Showing posts from May, 2015

eol - proper autocrlf setting for git -

we use sourcetree client. handles various line endings ok, diff tool uses not. sees lines ending in lf 1 line. as result, keep source in our repository crlf. i'm looking @ installing git client. can't find correct setting text or autocrlf. seems want "normalize" file on check in lf. i want convert crlf on checkout; , either convert crlf on checkin; or nothing on checkin; the best can find far -text: nothing on checkin or checkout; is there hope? thanks, brad. git's native end-of-line settings lf, , i'm not aware of way alter behavior aside recompiling source. however, can force checkouts use crlf, requires creation of .gitattributes file. example: # force c# source files checked out using crlf line endings, # ignoring "core.eol" setting. *.cs eol=crlf # don't apply crlf conversion pdf files, regardless of # user settings including "core.autocrlf". *.pdf -text # other files subjected usual algorithm determi

ggplot2 - problems with arrangeGrob under R version 3.2.2 -

Image
i 've updated r version including packages , function arrangegrob (package gridextra) has changed. on old version r version 3.1.3 used following make corner labels: loading r packages library(ggplot2) library(grid) library(gridextra) example data a <- 1:20 b <- sample(a, 20) c <- sample(b, 20) d <- sample(c, 20) create data frame mydata <- data.frame(a, b, c, d) create example plots myplot1 <- ggplot(mydata, aes(x=a, y=b)) + geom_point() myplot2 <- ggplot(mydata, aes(x=b, y=c)) + geom_point() myplot3 <- ggplot(mydata, aes(x=c, y=d)) + geom_point() myplot4 <- ggplot(mydata, aes(x=d, y=a)) + geom_point() set corner labels myplot1 <- arrangegrob(myplot1, main = textgrob("a", x = unit(0, "npc") , y = unit(1, "npc"), just=c("left","top"), gp=gpar(col="black", fontsize=18, fontfamily="times roman"))) myplot2 <- arrangegrob(myplot2, main = t

php - How to add points for users of my app and connect it to android? -

i have started working on 1 project, i'm stucked here need add points every users have stored in database. have created 1 database i'm storing username , password user , connected android. working, in case store points users when solved example in app, don't know how write methods , need little in php that. these php files: register.php <?php $con=mysqli_connect("localhost", "root", "", "geomondo"); $username = $_post["username"]; $password = $_post["password"]; //$username = "admin"; //$password = "admin"; $statement = mysqli_prepare($con, "insert user (username, password) values (?, ?)"); mysqli_stmt_bind_param($statement, "ss", $username, $password); mysqli_stmt_execute($statement); mysqli_stmt_close($statement); mysqli_close($con); ?> and 1 more: fetchuserdata.php <?php $con=mysqli_connect(&

angularjs - Using ui-router with Kendo TabStrip -

i trying implement kendo tab strip , applies ui-router display contents of tab. can tab strip display not contents using ui-view. have example of how make these items work together. sample of html. <div class="main-template"> <div class="row"> <h3>welcome dashboard</h3> <div ng-controller="navigation"> <div kendo-tab-strip k-content-urls="[ null, null]"> <!-- tab list --> <ul> <li class="k-state-active" url="#/invoice">invoice management</li> <li url="#/shipment">shipment management</li> </ul> </div> <div ui-view></div> </div> </div> </div> i not merging should. in li markup should have used ui-sref instead of url. <div class=&

ruby on rails - amazon beanstack policy issues when running eb create -

after running eb create projectname deploy rails project amazon beanstack keep getting errors these errors. have never used service before , thought give try.. here errors. 2015-10-02 17:23:50 utc-0400 warn environment health has transitioned pending degraded. command failed on instances. 2015-10-02 17:23:38 utc-0400 error create environment operation complete, errors. more information, see troubleshooting documentation. 2015-10-02 17:22:35 utc-0400 info command execution completed on instances. summary: [successful: 0, failed: 1]. 2015-10-02 17:22:35 utc-0400 error [instance: i-c2e7f417] command failed on instance. return code: 1 output: (truncated)...ndeck/config/environment.rb:5:in `<top (required)>' gem::loaderror: sqlite3 not part of bundle. add gemfile. /var/app/ondeck/config/environment.rb:5:in `<top (required)>' tasks: top => environment (see full trace running task --trace). hook /opt/elasticbeanstalk/hooks/appdeploy/pre/

javascript - angular common service DRY code -

lets consider following "projects" module. the service angular.module('srvc.projects',[]).factory('projects_fctr',function($resource){ return $resource('api/projects/:id',{id:'@_id'},{ update: { method: 'put' }, query: { method: 'get', isarray: true }, create: { method: 'post'} }); }); and following controller projects_fctr.query( function (data) { if (!data.error) { $scope.projects = data; notify({ messagetemplate: $scope.notifymsg.res, classes: 'alert-success', duration: 3000}); } else { notify({ messagetemplate: $scope.notifymsg.ree, classes: 'alert-warning'}); } }); which both work fine. i noticing if want create "clients" module, have duplicate above code , change references "projects" "clients". the results having multiple "versions" of same services/controllers, 1 each module. is t

Zurb Foundation 5.5.2 range slider clicking on bar to advance handle to position does not work -

i using zurb foundation 5.5.2 , trying range slider work on foundation web site documentation page range sliders . desired functionality click on location on bar, , handle advances location. on foundation web site kitchen sink page , clicking on range slider bar nothing. on this codepen use basic range slider code, cannot click on bar , handle advance. how work? here codepen code: <div class="range-slider" data-slider> <span class="range-slider-handle" role="slider" tabindex="0"></span> <span class="range-slider-active-segment"></span> <input type="hidden"> </div> foundation v5.x serie seems not trigger mousemove event when using slider. digging foudantion issues on github found this: slider: add support changing clicking on slider without having started drag handle it strikes me feature available future versions of foundation library such v5.5.3 or v5

f# - this construct causes code to be less generic... when applied to phantom type -

i trying implement dsl in f# small language. unfortunately compiler stops me dead in tracks when attempt constrain nodes hold additional type information (via phantom types). the following lines of code illustrate issue: type expr<'a> = | int of int | eq of expr<int> * expr<int> | not of expr<bool> let rec to_string (expr: expr<'a>) = match expr | int(n) -> string n | eq(x, y) -> sprintf "%s == %s" (to_string x) (to_string y) | not(b) -> sprintf "!%s" (to_string b) according compiler construct to_string x issues following warning: construct causes code less generic indicated type annotations. type variable 'a has been constrained type 'int'. following that, on next line, construct to_string b issues error: type mismatch. expecting expr<int> given expr<bool> type int not match type bool i can't seem find way circumvent behavior, , in fact can't

java - Why does my app keep crashing without any errors? -

so, trying implement qr scanner android application, , using android studio. user taps (clicks) button calls qr scanner onto screen. @ point, user can scan qr code embedded url , sent url. pretty simple. i using [zbar][1] library. used awesome [tutorial][1]. i pretty followed tutorial outlined it, copying , pasting. had no compilation errors , application built without problems; however, upon running it, emulator throws me following message: "unfortunately, application has stopped." if need anymore information please let me know. here logcat outputs after crashes: 10-02 16:56:26.732 18271-18271/v1.com.example.ggpcoding.myapplication e/androidruntime﹕ fatal exception: main process: v1.com.example.ggpcoding.myapplication, pid: 18271 java.lang.unsatisfiedlinkerror: dalvik.system.pathclassloader[dexpathlist[[zip file "/data/app/v1.com.example.ggpcoding.myapplication-2/base.apk"],nativelibrarydirectories=[/data/app/v1.com.example.ggpcoding.myapp

audio - Increasing the playback volume of SoundPlayer Class in VB.NET -

i have code given me while ago: storing .wav files in variable and works great, i'm wondering if there simple way boost volume in overall application. windows reports volume 100%, sound spikes super tiny, , sound clips super low in volume (compared other things have playing i.e music/movie etc) thanks!

python - "Not in list" error while using intersection -

i trying find match between 2 lists code: def matching(text, symples, half2): word in text: find = set(symples).intersection(word) indexnum = symples.index(find) print(indexnum) print(find) i succeeded in finding match between them. need find index number of matching word in list , when try error message word not found in list. i tried print matching word between 2 lists find , printed brackets ( {} or [] ). are brackets reason there no match found in list? there are couple reasons code isn't working , right on brackets being 1 reason. the line find = set(symples).intersection(word) returns , assigns set variable find . later, when try find index of find, not found because set not found in list. for example: symples = ['1','2','3'] word = '1' find = set(symples).intersection(word) # find = {'1'} indexnum = symples.index(find) # not found because {'1'} not in list to fix this, loo

PHP: make a sign out button in my sign out page -

i'm working on project in php , need sign out page. currently, page this so when click on sign out button, i'm no longer signed in , i'm redirected sign in page. create sign out page sign out button allow user have confirmation message sign out. sign out code: unset($_session["auth"]); header("location: sign-in.php"); so need when click on sign out button (header), i'm redirected sign out page sign out button (when clicked, want user no longer signed in). alright, promissed functional script. display button , ask user confirm if (s)he wants logout before doing so. can adept other functionality , layouts if want to. <?php session_start(); if(isset($_post['logout'])){ session_destroy(); #uncomment if wish redirect user somewhere //header("location: index.php"); } ?> <!doctype html> <html lang="en"> <head> <meta http-equiv="content-type" cont

sql - Not selecting duplicates rows -

my sql code below select country, region, count(country) [count], case when region null 0 else 1 end category games group grouping sets ( (country, region) ,(country) ) having grouping(region) = 0 or count(distinct region) > 0 order country, category, region result below country region count category ------- ------- --- ------- unknown unknown 3 0 unknown unknown 3 1 austria null 1 0 austria 1 1 belgium null 1 0 belgium 1 1 czech republic null 3 0 czech republic 1 1 czech republic b 1 1 czech republic c 1 1 opps opps 1 0 opps opps 1 1 turkey null 6 0 turkey 1 1 turkey

python - Django - order existing search results according to user choices -

i'm creating django (1.8) web application lets end-users search entries. i've managed let users search results according input. however, want users able order search results after results returned, according user's selection of choices (e.g. order distance, order rating, order price). i'm having trouble implementing because can't figure out logic behind this. could please tell me how implement such feature please? thank much! the simplest way .order_by('fieldname') . in template have links same page add parameters. in view check these parameters , decide how sort results. it'll this model.objects.filter(field='value').order_by('sort-criteria')

java - Maven3 can't find artifacts when switching repository settings -

i'm running think catch-22 situation way settings.xml file set up. currently, when i'm in office, use our nexus our principal source. repos mirrored nexus, , nexus, in turn, proxy central. works fine. able download artifacts central, , local nexus. however, when out of office, no longer have access nexus server. changed settings.xml file disable mirror central. however, maven complains unable find local artifacts hosted on nexus though exist in local m2 repo. i know maven 3 tracks location artifact downloaded _maven.repositories file (see this post other resources). however, not sure how supposed configure issue such can move around this. when out of office, don't have access nexus, want continue using local repo artifacts cached. not want turn maven offline altogether need d/l other artifacts central continue working. settings.xml when @ office <mirrors> <mirror> <id>nexus</id> <mirrorof&

c# - How to increase thickness of shape in WPF -

Image
i'm trying create paint application in wpf using canvas. want increase thickness of shape while drawing try increasing strokethickness. this how want be: and get: as can see outline extends inside boundary. how can make extends on both side? here code: in mousedown event: rectangle rect = new rectangle(); rect.stroke = _color; rect.strokethickness = _size; canvas.setleft(rect, _startpoint.x); canvas.settop(rect, _startpoint.y); cv_paintboard.children.add(rect); isdrawing = true; in mousemove event: if (isdrawing == true && e.leftbutton == mousebuttonstate.pressed) { canvas canvas = (canvas)sender; rectangle rect = canvas.children.oftype<rectangle>().lastordefault(); if (rect != null) { point endpoint = e.getposition((iinputelement)sender); point startpoint = new point( math.min(endpoint.x, _startpoint.x), math.min(endpoint.y, _startpoint.y) ); rect.width = mat

How to dynamically add to a List<Object> in C# -

i have collection class class puts list<ingredient> object, contents of ingredient object list displayed in checklistbox using binding. what i'm trying when user clicks on 1 of list items information in particular item copied list called list<pizza> mypizza , display on list. reason want data go because once in list<pizza> mypizza more things data. i have tried doesn't seem work, below collectionclass , windows form , ingredient class. didn't bother putting pizza class same ingredient class know how add listbox using item, want add list add list listbox. i hope make sense, kind of new programming. thanks. ingredient class . public partial class form1 : form { //list<ingredient> myingredient = new list<ingredient>(); list<pizza> mypizza = new list<pizza>(); collectionclass mycollections = new collectionclass(); public form1() { initializecomponent(); mycollections.createlist();

nest - Case insensitive fields in Elasticsearch -

i using nest elasticsearch , trying search allowing users type search phrases search box. working fine apart fact when user enters search phrase need make sure field name same case field name in elastic search. for example, 1 of fields called booktitle. if search below works booktitle:"a tale of 2 cities" if search example below not work booktitle:"a tale of 2 cities" booktitle:"a tale of 2 cities" the code using search below. have ideas on how can fix this. hoping there elasticsearch/nest setting allows me opposed doing somehthing ugly search text finding "booktitle" , replacing "booktitle". public list<elasticsearchrecord> search(string searchterm) { var results = _client.search<elasticsearchrecord>(s => s .query(q => q .querystring(qs => qs .defaultfield("content")

java - Why is my program rounding up wrong? -

here program calculate tax bill someone please explain me in program causing program round tip higher master output inputed program auto grader. cannot find cause of tips coming through higher. ive tried several different things have been unsuccessful. import java.util.scanner; public class r8 { public static void main(string[] args) { // todo auto-generated method stub // read steps before beginning. understand larger picture. // create new java project named r8, , make class named r8. // copy following code , paste inside the curly braces of main method: // // declare variables string restaurantname; string servername; double subtotal; double tax = 0; double total = 0; double taxrate = 0.05; double tiprate1 = 0.10; double tiprate2 = 0.15; double tiprate3 = 0.20; // // ask , receive input user // create scanner

html - Integrate NotifyVisitors Javascript Code OPencart -

i want add following javascript code footer of opencart (2.0.3) integrate notifyvisitors app website. but don't know how , add javascript code enable notifyvisitors app. <div id='notifyvisitorstag'></div> <script> var notify_visitors = window.notify_visitors || {}; (function() { notify_visitors.auth = { bid_e : '7e8xxxxxxxxxxxx561', bid : '0000`enter code here`', t : '420'}; var script = document.createelement('script');script.async = true; script.src = (document.location.protocol == 'https:' ? "//d2933uxo1uhve4.cloudfront.net" : "//cdn.notifyvisitors.com") + '/js/notify-visitors-1.0.js'; var entry = document.getelementsbytagname('script')[0]; entry.parentnode.insertbefore(script, entry); })(); </script> please guide. thanks. notifyvisitors updated plugin available @ official opencart extension st

html - Background Image Stretch On Homepage -

i'm trying make background image on homepage stretch across whole page, i'm having difficulties doing because when try , re-size window becomes smaller? this code: <style type="text/css"> body{ background: url(img/phantom410.jpg); repeat-y; background-size:cover; background-color:black; } </style> is there way can image website homepage , stretch across whole page twitter background image; not have shrink once starts getting smaller? thanks! body { background: url(https://css-tricks.com/examples/fullpagebackgroundimage/images/bg.jpg) no-repeat center center fixed; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover; } h1{ color:#fff; } <html> <head> <title>full background</title> </head> <body> <center><h1>

android - How to find Robolectric version at runtime? -

is there way retrieve robolectric's version @ runtime? environment under controlled library versioning , make sure run test if robolectric has specific version (for example, avoid runtime known issues it). example: @test public void should_do_x() { if (robolectric.version >= supported_version) { //do //validate } }

There's no console output for some reason (double and float data types C#)? -

namespace floatandouble { class program { static void main string[] args) { float floatpi = 3.141592653589793238f; double doublepi = 3.141592653589793238; console.writeline("float pi is: " + floatpi); console.writeline("double pi is: " + doublepi); } console.readline(); } } i'm trying work on basics (real floating point types) c# i'm new language. i'm pretty sure code correct, however, there many errors. appreciated! the prroblem code has putting console.readline() inside class, should put inside main function. namespace consoleapplication5 { public class program { static void main(string[] args) { float floatpi = 3.141592653589793238f; double doublepi = 3.141592653589793238; console.writeline("float pi is: " + floatpi); console.writeline("double pi is: " + doublepi); conso

c++ - What is cause of segmentation fault here? -

i have written small array merge procedure. on running getting segmentation fault. can point out me have gone wrong here? #include <iostream> using namespace std; void merge(int arr[], int p, int q, int r) { int l[q-p+1]; int r[r-q]; for(int = p; < r;i++) { if(i<q+1) { l[i] = arr[i]; } else { r[i-q+1] = arr[i]; } } int = 0, j = 0,k = p; while(i<q-p+1 || j<r-q) { if(l[i]>r[j]) { arr[k] = r[j]; j++; } else { arr[k] = l[i]; i++; } k++; } if(i == q-p+1) { for(;j<r-q;j++,k++) { arr[k] = r[j]; } } if(j == r-q) { for(;i<q-p+1;i++,k++) { arr[k] = l[i]; } } } int main() { cout << "hello world!" << endl; int a[] = {2,4,6,8

What are the effects of disabling BitCode in Xcode project settings? -

Image
bid code default enabled on xcode project settings. dependent on few third party libraries compilation error sdk not support bitcode? if disable error gone. not know after effects of change? turning off means app live on app store same way did before xcode 7 & bitcode. when it's downloaded, binary code supported architectures downloaded app store. if turn bitcode on, intermediate representation of compiled program gets uploaded , apple able recompile and/or optimize apps future architectures ( as described here ). turning off safe time being. more information can found in related question . and you, i'm waiting third party libraries updated bitcode support (in case, it's google analytics library ).

Docker base image filesystem -

Image
docker can't modify base image's filesystem, can't copy it. how can store changes during container usage? see stores files under /var/lib/docker , how can store filesys' changes without modifying it? methodology? it store changes through new filesystem layer, because of copy-on-write mechanism: those changes disappear after docker rm (unless docker commit right after docker stop ) if want persistence, need use a volume or use data volume container . when doing docker run , can mount volume host or mount 1 data container.

android - Sorting a JSONArray in java -

Image
i'm working on api i'm getting jsonarray in there reside numerous jsonobjects containing around 10 keyvalue pairs. 1 of them date: 10-3-2015 . want use jsonarray in sorted manner according date value. i've tried various ways including treemap no success yet. a short piece of code or thorough idea work me. thanks. edit: you can sorting if use model hold element in jsonarray.let's have have model person , json array contains list of persons can traverse jsonarray , make list of persons follows: list<person> persons=new arraylist<>(); if(jsonarray!=null){ for(jsonobject person:jsonarray){ person p=new person(); //set properties //............. //add persons persons.add(p); } } now can sort list of persons follows: collections.sort(persons, new comparator() { public int compare(object obj1, object obj2) { if (!(obj1 instanceof person) || !(obj2 instanceof person)) {

sql - SqlDbType.Time overflow. Value is out of range -

i want store time in table , take time(7) datatype storing time. when subtract 2 datetime, got "1.18:36:36.7484253" value in timespan variable. but problem when insert value in table got error. sqldbtype.time overflow. value '1.18:36:36.7484253' out of range. must between 00:00:00.0000000 , 23:59:59.9999999 i knew error , question type of datatype use type of value storing time. i using sql server 2008 , c#. to resolve problem, need following: hi, need create new timespan variable. //////// calculation timestamp ////////// datetime fechaaux = datetime.now; datetime fechaingresoam = new datetime(fechaaux.year, fechaaux.month, fechaaux.day, 8, 30, 00); timespan auxingresoam = ingresoam.subtract(fechaingresoam); timespan resultadoretrasoingresoam = new timespan(auxingresoam.hours, auxingresoam.minutes, auxingresoam.milliseconds); command.parameters.

Jquery autocomplete with JSONP not working -

i using below code autocomplete: jquery('#id') .autocomplete({ "select":function (event, ui) { return false; }, "focus":function(event, ui) { return false; }, "minlength":"3", "source":function( request, response ) { jquery.ajax({ type: 'get', url: 'http://localhost/autocompleteex', datatype: 'jsonp', jsonp: "jsonp-callback", contenttype: 'application/json; charset=utf-8', data: { search:request.term, }, success: function(data) { response($.map( data, function( item ) { return {

openstreetmap - Html5 shows offline mapsforge openstreepmap tiles -

how can show offline mapsforge openstreetmap in html5? the mapsforge files *.map files. there javascript library access mapsforge tiles? mapsforge supports java (on desktop , android). and unofficially (ios)[ mapsforge analog iphone written medvednick. i have never seen javascript implementation... guess till people classical osm tiles sufficient html.

java - Multiple Applications in android manifest -

am developing app , using 2 libraries 1 sugarorm handling databases , other 1 acra bugs tracking. my problem came when needed implement acra , found need declare manifest.xml in application tag. sugarorm requires declared application in manifest , acra, after searching found proposed solution have multilevel inheritance not figure how, since need build 1 class extending application class , it's acra , sugarorm has application class ready built. any help? update : after research found how handle multiple application classes in android which used multilevel inheritance so made acra application extend existing sugarapp class am still not sure if works after reading setup instructions both of them, acra seems need internet permission set in manifest. name should package/name app using

php - CakePHP: where to keep a list of all admin actions? -

i can admin_edit , admin_delete , admin_print , admin_manage_tags actions on articlescontroller , actions require $id passed. can admin_create or admin_sort without $id . finally, admin_delete require post , others should use get . how , store rules in cakephp in way can access or update them , have corresponding action links renderd on items list page, edit page, or anywhere else automatically? for example, have list page of articles ( admin_index ), , render direct links editing or printing pages. know can hardcode them, if add new functionality, such admin_render_pdf , i'd have go through views , put there manually. same if rename or remove action. furthermore, having common source of admin actions allow me render admin navigation automatically. do define array somewhere manually, or cakephp have magic that'd retrieve me? commonly used / best practice in case? the closest find list-all-controllers-actions-in-cakephp-3 looks it's acl-related.

python - pyqt5: passing extra arguments to pyqt slots when connecting in a loop -

can't understand why code shows me same result: i=4 for in range(0,5): self.close_deal[i].clicked.connect(lambda:self.printme(i)) def printme(self,i): print('i=',i) but when write as: self.close_deal[0].clicked.connect(lambda:self.printme(0)) self.close_deal[1].clicked.connect(lambda:self.printme(1)) self.close_deal[2].clicked.connect(lambda:self.printme(2)) self.close_deal[3].clicked.connect(lambda:self.printme(3)) self.close_deal[4].clicked.connect(lambda:self.printme(4)) i receive different results

http status code 404 - Symfony: 404 error on production -

here's example of page works fine on dev env , returns 404 error on prod env not found the requested url /app/reporter/ not found on server. apache/2.4.7 (ubuntu) server @ symfony.dev port 80 don't let confuse /app/ route, in real route , has nothing app.php running php app/console router:debug --env=prod confirm there's no problem router : [router] current routes name method scheme host path reporter /app/reporter/ of course, before posting message, : cleared cache, console cache:clear --env=prod, directly deleting cache files didnt change anything. double-checked mod_rewrite on in phpinfo anyway, guess error comes more apache here's conf: <virtualhost *:80> serveradmin webmaster@localhost servername symfony.dev setenv symfony__tenant__id "123" documentroot /var/www/html/symfony/web #

custom component - Passing data to javascript template literals inside WebComponent without using attributes. (Like in React) -

hi trying find best practice path long complex data javascript template literals inside custom webcomponent. not want pass using attributes because long text , break html. with react , jsx easy because passing data elements object. when using javascript template literals can pass strings. i have added example doing trying achieve want know if there better ways of doing class page extends htmlelement { update(data) { this.innerhtml = `<div> <p>id: ${data.id}</p> <p>content: ${data.content}</p> </div>` } } customelements.define('x-page', page); class book extends htmlelement { connectedcallback() { let pagesdata = [{ id: 1, content: 'some long text' }, { id: 2, content: 'other long text' }]; this.innerhtml = `${pagesdata.map( data => `<

android - How to launch instantapp from web pages in Chrome? -

i developed first android instant app available on google play. want invoke app web page in chrome, doesn't work. taking wish (www.wish.com) example, tried following links on chrome android. 1: <a href="https://www.wish.com/">link1</a> 2: <a href="intent://www.wish.com/#intent;action=com.google.android.instantapps.start;scheme=https;package=com.google.android.instantapps.supervisor;s.browser_fallback_url=https%3a%2f%2fwww.wish.com%2f;s.android.intent.extra.referrer_name=https%3a%2f%2fwww.google.co.jp;launchflags=0x8080000;end">link2</a> but neither link above work (clicking them navigates web page of wish, no instant app shows up), although second 1 seems google using in search result page. i confirmed app can launched via am command like: am start -a com.google.android.instantapps.start -c android.intent.category.browsable -d https://www.wish.com/ does know how launch instant apps web page? android 7.0 on galaxy s8

Tumblr API for java (Jumblr), How to use the tagged and get an nsfw result -

it looks if use tagged jumblr nsfw won't included in results. tumblrbot bot = new tumblrbot(); jumblrclient jclient = bot.getjclient(); map<string, object>options = new hashmap<>(); options.put("limit", 20); options.put("offset", 0); list<post> posts = jclient.tagged(tag, options); (int = 0; < posts.size(); i++) { post post = posts.get(i); system.out.println((i + 1) + " - post: " + post.getblogname()); system.out.println("\tnotes: " + post.getnotecount()); } are there can put in options pull nsfw tagged results?

ruby on rails - ActiveRecord Polymorphic association -

i have project allows users have conversations other users. conversations can contain multiple users via userconversations modal. userconversations need polymorphic can belong chatrooms . however, when add polymorphic association relationships break. class user < applicationrecord has_many :user_conversations, dependent: :destroy has_many :conversations, through: :user_conversations end class userconversation < applicationrecord belongs_to :user belongs_to :parent, polymorphic: true has_many :conversations, through: :user_conversations end class conversation < applicationrecord has_many :messages, as: :context, dependent: :destroy has_many :user_conversations, as: :parent, dependent: :destroy has_many :users, through: :user_conversations end class chatroom < applicationrecord belongs_to :venue has_many :messages, as: :context, dependent: :destroy has_many :user_conversations, as: :parent, dependent: :destroy has_many :users, through: :use

Crash on curl_easy_perform() when uploading a file on CURL in C++ -

i'm having issue crash when uploading file via curl library in c++. i'm using exact demo code location: https://curl.haxx.se/libcurl/c/fileupload.html the thing change in code upload location, upload local wamp server on windows, , file upload, i've verified opening ok. i'm running through visual studio 2014, , building curl through dll the output program is: * trying 127.0.0.1... * tcp_nodelay set * connected 127.0.0.1 (127.0.0.1) port 80 (#0) > put /replayupload.php http/1.1 host: 127.0.0.1 accept: */* content-length: 43 expect: 100-continue < http/1.1 100 continue *then crash @ line 66 in program. seems line: res = curl_easy_perform(curl); is causing problem invalid parameter. have verified curl variable not null, i'm finding difficult more debug info that, call stack references memory address within dll. i'm able run demo upload post variables , page, runs fine without crash. crash occurs when uploading file. my exact c

android - TWRP flash error FAILED (remote: size too large) -

when try flash twrp recovery fastboot error: >>fastboot flash recovery twrp.img sending 'recovery' (19040 kb)... okay [ 0.753s] writing 'recovery'... failed (remote: size large) finished. total time: 0.753s i have xiaomi redmi note 4, miui 8 , fastboot 1.4.2... thanks you

foreign keys - Check constraints on two tables in Oracle -

i have 2 tables one-to-one relationship (and relationship mandatory 1 side only). follows: create table prs ( id number(18) not null, common_code varchar2(10), constraint pk_prs primary key (id)); create table rlp { id number(18), spec_code varchar2(20), constraint pk_rlp primary key (id), constraint fk_rlp_prs foreign key (id) references prs(id) on delete cascade); so problem when inserting record in rlp @ least 1 of common_code or spec_code must have value. is possible enforce constraint using constraint or solution having trigger?

google analytics - Need to remove 'test' products in Ecommerce Overview of products -

i have used google analytics hit builder remove test purchases on ecommerce sites analytics, has removed revenue ok! but still display on homepage view of analytics under: 'what top selling products?' my question; there way remove product/text 'ecommerce overview'?? regards! chris h please see example image here of problem you can remove of data deleting view , starting over, cannot selectively remove data. even sending negative revenue existing transaction id not remove anything; internally still stored 2 transactions, affects e-commerce-conversionrate, possibly channel performance (unless sent correct channel information in second transaction) , might displayed separate transactions depending on timeframe selected.

mysql - PHP : Not able to call connection object -

i newbie in php programming. have created config , script prints mysql database information. here config : class dbmanager{ protected $dbh; public $dbhost = '127.0.0.1'; public $dbname = 'bookstore'; public $dbuser = 'root'; public $dbpass = ''; public function getconnection(){ try{ $dbh = new pdo("mysql:host=$this->dbhost;dbname=$this->dbname", $this->dbuser, $this->dbpass); $dbh->setattribute(pdo::attr_errmode, pdo::errmode_exception); return $dbh; } catch(pdoexception $e){ echo "error : " . $e; } } } and, script database information : require_once('config.php'); class showdata extends dbmanager{ public function getinfo(){ $dbh= getconnection(); $smt = $dbh->prepare("select * books"); $smt->execute(); $result = $smt->fetchall(); echo "<pre>"; print_r($result); } } i getting error :

abstract syntax tree - Adding an import statement to Typescript source using the Compiler API -

i'm looking way insert import statement using typescript compiler api. here's i'd do before: class simple extends component<{}, {}> { render() { return ( <div> <style jsx>{` div { background: green; } `}</style> </div> ) } } after: import { component } 'react' // inserted class simple extends component<{}, {}> { render() { return ( <div> <style jsx>{` div { background: green; } `}</style> </div> ) } } i'm using: typescript 2.4.1.

Excel vba: Is it possible to initialise an array of dates in one-line with brackets? -

i'm new excel vba , having trouble initialising array of dates on single line using brackets. i know how variant data types: arrayvariant = array("hello", "world") , string data types: arraystring = split("hello,world",",") , can initialise array of dates initialising each item individually: arraydates(0) = #01/01/1900# etc can't find way initalise date array on single line. possible in vba? you can use same approach string type, converting each value date type, using cdate() : arraydates = array(cdate("1/1/2000"), cdate("2/2/2000"), cdate("2/3/2004")) by using approach manage fill array in 1 line.

image - Random product thumbnails -

the shop page on website displays "full-length" image of product, , then, on hover, "close-up" image. i wish randomise this, products, "close-up" displayed on load, , others, "full-length". , have random every page load. "full-length" images named xxx1.jpg, , "close-up" images xxx2.jpg, e.g. <li> <div id="product"> <img class="full-length" src="/image-1.jpg"/> <img class="close-up" src="/image-2.jpg"/> </div> </li> i guess need random number generator, between 1 , 2, , second image first image not . any help, sincerely , obliged. i think can you.java script code is: function getrandomarbitrary(min, max) { return math.random() * (max - min) + min; } function onloadsetimage() { document.getelementbyid('product1').src='image-'+getrandomarbitrary(1,5); } html ( onload can check

c++ - How to compare time ranges in text file with time ranges that entered by user in qt? -

Image
i have text file follows: 05:59:57 - [0x1010001]05:59:57 - (2576) writing non-volatile memory done 06:00:00 - [0x1010001]06:00:00 - (23371) t_check_buddy !!! 06:00:00 - dma:310127952,01,req:brdtim 82 07 83 29 05 0f 04 12 06 00 06:00:00 - 06:00:00 - evmtbl............ 06:00:00 - maintenancing & filling vboxtbl...done 06:00:01 - dma:310128070,01,ind:ktsper 96 10 85 fc 00 28 58 06:00:01 - dma:310128071,01,req:ktsidk 82 10 85 fc 81 00 47 02 06:00:01 - dma:310128091,01,ind:ktsper 96 10 86 fc 00 28 58 06:00:01 - dma:310128091,01,req:ktsidk 82 10 86 fc 81 00 47 02 06:00:02 - sip:310129384, req: kinfo to:1800 to-host:192.168.178.230 ktext: 02 78 0e 06:00:30 - [0x1010001]06:00:30 - (23371) t_check_buddy !!! 06:00:32 - sip:310159385, req: kinfo to:1800 to-host:192.168.178.230 ktext: 02 78 0e 06:00:46 - ipt:310173571,255,ind: config 87 03 4c 43 4e the code follows: #include "mainwindow.h" #include "ui_mainwindow.h" #include <fstrea