Jul 24, 2021

Folding@Home - Contribute idle computer processing power to science research

Folding@Home

What is Folding at Home (or in shortform, fah)

It is a project that allow user to contribute their processing power during computer is in idle status. The contributed processing power will be used by fah program to help scientist finding cure for deceases, and processing power donor would get some compensation in return in crypto form (different options available too).

If you don't have any GPU, CPU alone is enough to get you started with the folding.


Kalium Wallet
What do you get in return?

Yes, contributing idle processing power will still consume electricity, contributor might think about getting compensated for the power consumption at home.

And here's the example of compensation I received so far. Meanwhile, I'm not into contributing to earn, that's not my purpose, and so shouldn't you. Otherwise, you'll be hunted by annoying inner voice which get you keep checking at the compensation figure every single day or worse every single hour.


Banano & Kalium Wallet

In the picture at the right, the transactions list is what I've received from contributing to FAH as a Banano team. 

How to do it?

  1. Get an address (a long text that as your ID) from any listed wallet on https://kalium.banano.cc/ (I picked kalium)
  2. visit bananominer site to get started with your address.
  3. enter required info into https://client.foldingathome.org/ (after FAH installation is completed)
  4. setup a passkey that let F@H know that the contribution is from you, this will earn you more bonus (they claim so, but i haven't able to check how much more bonus you'll get with passkey attached).


Lastly, I've seen topic about getting payout in dogecoin, but I haven't manage to find any reliable guide to try with. So I think it's still best to stick with banano team, as it's been number 1 ranked team until these days at the time of this writing.


Banano Team, the number 1 FAH contributor

To learn about available projects and the stats of their servers which you'll be contribute your processing power, please find the useful links below:
https://folding.lar.systems/projects/
https://foldingathome.org/statistics/

Accessibility (a18y) - Minimum Touch Target Size (48dp)

Udacity Course: Web Accessibility

https://classroom.udacity.com/courses/ud891/lessons/8085130355/concepts/80878907040923


Minimum touch size for mobile screen: 48dp



WCAG: https://webaim.org/standards/wcag/checklist#sc1.4.4

Jan 14, 2021

Troubleshooting: Could not initialize class org.codehaus.groovy.reflection.ReflectionCache

I am a Ionic Capacitor user, I didn’t know since when my android build keep failing and no clue what’s the cause.


And I keep getting these errors when I run “npx cap add android”:

	
Syncing GradleError running gradle sync Starting a Gradle Daemon, 1 stopped Daemon could not be reused, use --status for details

java.lang.NoClassDefFoundError: Could not initialize class org.codehaus.groovy.vmplugin.v7.Java7

… #skipped verbose error messages

FAILURE: Build failed with an exception.


* What went wrong:
Could not initialize class org.codehaus.groovy.reflection.ReflectionCache


* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org
BUILD FAILED in 21s

Unable to infer default Android SDK settings. This is fine, just run npx cap open android and import and sync gradle manually
	





The Solution

Firstly, you'll to know which java version is your android studio is using, find the info in "About Android Studio". 





Set environment variable to point JAVA_HOME to the path where openjdk version of "1.8.0_242-release” (or embedded jdk inside Android Studio app folder) located. On Mac, it's usually 

/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home


MacOS (Android Studio 4.1.1):

export JAVA_HOME="/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home"


jenv User:

You can add Android Studio embedded openjdk path to your jenv and then switch to your prefered java version with jenv local VERSION_NO for local or  jenv global VERSION_NO for system wide.
jenv add "/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home"

Window:

Add/update environment variable JAVA_HOME and point it to path where the correct version of openjdk extracted.

Jul 24, 2020

Troubleshooting Custom Capacitor Plugin: No such module 'PushNotifications'

As a Capacitor hybrid app developer, default plugins offered by Capacitor can be not enough to achieve what we want for our project.

For beginner like me, who hope to create a simple custom plugin, set aside Javascript related code, it can be a tough experience as we have to learn and put into practise for both Android and iOS build.

Building a custom plugin for Capacitor (Ionic)

Fortunately, Capacitor has built-in API we could use to build any custom plugin.

No such module 'PushNotifications' (iOS)

On one of my custom plugin, it has dependency on Pusher's client iOS SDK which is imported through cocoapod. Running app "build" on xcode on this plugin is successful.

On my ionic app project folder, when import the created custom plugin causes error, and I get 
"No such module 'PushNotifications'" 
for importing the custom plugin. Which it's weird as I've checked and certain PushNotifications plugin installed in pods folder on both the actual app project and in the custom plugin.

When I navigate inside xcode Pods project, I'm able to see PushNotifications library correctly placed under pods folder.



Solution:

1. In the Capacitor custom plugin folder, find the .podspec file (usually located at root folder of your Plugin project), and add s.xcconfig to your podspec file, it's added to tell xcode about where to look the PushNotifications framework required by this plugin in your main project.
	
		
  require 'json'

  package = JSON.parse(File.read(File.join(__dir__, 'package.json')))

  Pod::Spec.new do |s|
    s.name = 'CapacitorPusherBeams'
    s.version = package['version']
    s.summary = package['description']
    s.license = package['license']
    s.homepage = package['repository']['url']
    s.author = package['author']
    s.source = { :git => package['repository']['url'], :tag => s.version.to_s }
    s.source_files = 'ios/Plugin/**/*.{swift,h,m,c,cc,mm,cpp}'
    s.ios.deployment_target  = '11.0'
    s.dependency 'Capacitor'
    s.swift_version = '5.0'
    s.xcconfig = { 'FRAMEWORK_SEARCH_PATHS' => "${PODS_CONFIGURATION_BUILD_DIR}/PushNotifications" }
  end

	

2. Or, alternatively, you can add the PushNotification framework path manually as below (you'll have to do this every time when the plugin get updated or after you run npx cap update)
Steps
  1. Go to Pods project's Build settings, find "Framework Search Paths"
  2. Select your affected plugin (by the missing module error mentioned above)
  3. Add the missing path to both Debug and Release as needed.

May 25, 2020

WebdriverIO - Appium, The "Error: Failed to create session."

Working on a hybrid app built with Ionic4, I've been writing tests with Angular's e2e, cucumber and selenium, now I'm surprised by variety of features & supported services offered by webdriverio.

I first went into the list of boilerplate projects and try to get my hand dirty with first sample project made for hybrid app.

I git cloned this repo - appium-boilerplate, updated capabilities values based on the simulator config available on my dev environment (you have to provide exact to the capabilities based on your AVD Manager - Android Studio).

Next, by running the command "npm run android.app", I'd expected appium magic would works instantly, but if as a first-timer-of-all-stuff, I ran into a little issue (but cost all day to find out the causes).


Troubleshooting

If you run into similar error message as following:

Error: Failed to create session.
read ECONNRESET    
  
    npm run android.app

    appium-boilerplate@5.3.1 android.app ~/appium-boilerplate
    wdio ./config/wdio.android.app.conf.js


    Execution of 6 spec files started at 2020-05-24T05:09:03.689Z

    [0-0] RUNNING in Android - /tests/specs/app.forms.spec.js
    [0-0]  Error:  Failed to create session.
    read ECONNRESET
    [0-0] FAILED in Android - /tests/specs/app.forms.spec.js
    [0-1] RUNNING in Android - /tests/specs/app.login.spec.js
    [0-1]  Error:  Failed to create session.
    read ECONNRESET
    [0-1] FAILED in Android - /tests/specs/app.login.spec.js
    [0-2] RUNNING in Android - /tests/specs/app.navigation.spec.js
    [0-2]  Error:  Failed to create session.
    read ECONNRESET
    [0-2] FAILED in Android - /tests/specs/app.navigation.spec.js
    [0-3] RUNNING in Android - /tests/specs/app.swipe.spec.js
    [0-3]  Error:  Failed to create session.
    read ECONNRESET
    [0-3] FAILED in Android - /tests/specs/app.swipe.spec.js
    [0-4] RUNNING in Android - /tests/specs/app.webview.spec.js
    [0-4]  Error:  Failed to create session.
    read ECONNRESET
    [0-4] FAILED in Android - /tests/specs/app.webview.spec.js
    [0-5] RUNNING in Android - /tests/specs/app.webview.xpath.spec.js
    [0-5]  Error:  Failed to create session.
    read ECONNRESET
    [0-5] FAILED in Android - /tests/specs/app.webview.xpath.spec.js

    Spec Files:  0 passed, 6 failed, 6 total (100% completed) in 00:02:07 

    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! appium-boilerplate@5.3.1 android.app: `wdio ./config/wdio.android.app.conf.js`
    npm ERR! Exit status 1
    npm ERR! 
    npm ERR! Failed at the appium-boilerplate@5.3.1 android.app script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

    npm ERR! A complete log of this run can be found in:
    npm ERR!     ~/.npm/_logs/2020-05-24T05_11_11_738Z-debug.log
  

Solution

I couldn't believe it (that's reason it costed my days to resolve it) until I tried it.
Start and run your virtual device (simulator) first before the webdriverio's command (npm run android.app)

Futhermore, you can always add another logPath as appium services' option, so you can look into the error log for troubleshooting.