Posts

Featured post

ssh - Vagrant Windows - ssh_exchange_identification: read: Connection reset by peer -

it seems can't ssh virtual box. i have virtual box running win7. host pc in win7. virtual box created through vagrant following vagrantfile. vagrant.configure("2") |config| config.vm.box = "http://aka.ms/vagrant-win7-ie11" end open cmd. go root folder of vagrantfile. execute following command: vagrant cmd displays: bringing machine 'default' 'virtualbox' provider... ==> default: clearing set forwarded ports... ==> default: clearing set network interfaces... ==> default: preparing network interfaces based on configuration... default: adapter 1: nat ==> default: forwarding ports... default: 22 (guest) => 2222 (host) (adapter 1) ==> default: booting vm... ==> default: waiting machine boot. may take few minutes... default: ssh address: 127.0.0.1:2222 default: ssh username: vagrant default: ssh auth method: private key timed out while waiting machine boot... time o

start chronometer from dialog box -

i chronometer start when click "ok" button dialogbox... can not. succeed start chronometer when dialog box open. when click "ok" button time has passed... thanks help... begin code. my code: import android.app.activity; import android.app.dialog; import android.os.bundle; import android.os.systemclock; import android.view.view; import android.view.view.onclicklistener; import android.widget.button; import android.widget.chronometer; import android.widget.textview; public class activityone extends activity implements onclicklistener { private chronometer mychronometer; @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.timerlayout); mychronometer = (chronometer) findviewbyid(r.id.chronometer); button buttonstart = (button) findviewbyid(r.id.startbutton); button buttonstop = (button) findviewbyid(r.id.pausebutton); button b

gcc - Neither ld wrap nor LD_PRELOAD working to intercept system call -

i trying use -wl,-wrap=sendto -wl,-wrap,sendto in final g++ link command links app replace standard sendto function own. i compile following source code gcc -c -o wrap.o wrap.c , include wrap.o in final g++ command links app (the rest of app c++ hence use of g++) #include <stdio.h> #include <sys/types.h> #include <sys/socket.h> ssize_t __real_sendto(int, const void *, size_t, int, const struct sockaddr *, socklen_t); ssize_t __wrap_sendto ( int sockfd, const void *buf, size_t len, int flags, const struct sockaddr *dest_addr, socklen_t addrlen ) { printf("my wrap sendto ...\n"); return __real_sendto(sockfd, buf, len, flags, dest_addr, addrlen); } when use sendto in own source code, wrapper in fact used ok 3rd party shared objects linked against in final g++ command use sendto still use system sendto i.e. not wrapper. how can sendto wrapper used throughout ? i have tried ld_preload approach sendto , dlsym(rtld_nex

I could not debug scala remote application on eclipse or IntelliJ IDEs -

i have scala server side application on eclipse ide, followed remote configuration server side application on eclipse nothing worked me. there suggestion debug scala application on eclipse, intellij or other ides? after 3 days, got way debug scala server side application on eclipse is, create test class scala class want debug. put break points on method in scala class , run created test class using "debug scala test file" on eclipse.

ruby on rails - Why does Time.zone get set to nil inside Thread -

here mean ... require 'rubygems' gem 'activesupport','4.2.6' require 'active_support/all' time.zone = 'est' puts "print current time zone -- [#{time.zone}]" thread.new puts "time zone(will nil) instead thread -- [#{time.zone}]" end sleep 1 o/p print current time zone -- ((gmt-05:00) est) time zone(will nil) instead thread -- () clearly rails doing magic on here time.zone inside thread. so question .. why rails doing magic? where in rails code that.(a link code great) if have @ time.zone can see set current thread, seems intended behaviour. you can either store in variable , call way or set time.zone 'est' every time in create thread , call time.zone subsequently. here's example of what's happening thread.current[:foo] = 'bar' thread.current[:foo] #=> "bar" thread.new { p thread.current[:foo] } #=> nil i'm not able answer why rails magic ma

maven - jacoco coverage per test setup -

i'm using jacoco in order gather code metrics , import them sonarqube missing details coverage per test. after searching came this tutorial failed make work on project. here pom.xml <properties> <sonarversion>2.4</sonarversion> <spring-framework.version>4.0.0.release</spring-framework.version> <spring-framework.security.version>3.2.5.release</spring-framework.security.version> <jackson.version>1.9.13</jackson.version> <jacoco.version>0.7.7.201606060606</jacoco.version> <aspectj.version>1.7.4</aspectj.version> <sonar.java.coverageplugin>jacoco</sonar.java.coverageplugin> <sonar.dynamicanalysis>reusereports</sonar.dynamicanalysis> <sonar.jacoco.reportpath>${project.basedir}/target/jacoco.exec</sonar.jacoco.reportpath> <sonar.jacoco.itreportpath>${project.basedir}/target/jacoco-it.exec</sonar.jacoco.itreportpath>

android - How to determine if a in-app subscription on Google Play has been renewed? -

the following documentation describes result querying google play api subscription: https://developers.google.com/android-publisher/api-ref/purchases/subscriptions#resource-representations however, if user cancels subscription when there still time left in current period, cancelreason empty or 0? in other words, cancelreason flag stay empty until there no time left in current period, or change on cancellation? in other words, cancelreason flag stay empty until there no time left in current period, or change on cancellation? i think, answer " it doesn't matter ", because documentation says : query subscription status only @ expiration — once server has retrieved expiration date of subscription tokens, should not query google play servers subscription status again until subscription reaching or has passed expiration date . typically, servers run batch query each day check status of expiring subscriptions, update database. in fact can change imm