Skip to content

Instantly share code, notes, and snippets.

View pythonpaul's full-sized avatar
:octocat:

pythonpaul

:octocat:
View GitHub Profile
@pythonpaul
pythonpaul / HelloSceneformActivity.java
Created September 28, 2019 19:54
The ModelRenderable method generated the AR model, replace the default R.raw.andy with the previously generated .sfb file
ModelRenderable.builder()
.setSource(this, Uri.parse("taka.sfb")) //(this, R.raw.andy)
.build()
.thenAccept(renderable -> andyRenderable = renderable)
.exceptionally(
throwable -> {
Toast toast =
Toast.makeText(this, "Unable to load andy renderable", Toast.LENGTH_LONG);
toast.setGravity(Gravity.CENTER, 0, 0);
toast.show();
@pythonpaul
pythonpaul / HelloSceneformActivity.java
Created September 28, 2019 18:31
replace the "R.raw.andy" default Android code with Uri.parse( )
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (!checkIsSupportedDeviceOrFinish(this)) {
return;
}
setContentView(R.layout.activity_ux);
arFragment = (ArFragment) getSupportFragmentManager().findFragmentById(R.id.ux_fragment);
@pythonpaul
pythonpaul / open_browser.py
Last active September 28, 2019 18:05
"raw_input" "input" for on Python version
import requests
import webbrowser
sites = ["http://www.bing.com/images/search"]
def openPage(x):
w = " "
if x == 1:
w = "bing img"
@pythonpaul
pythonpaul / wiki_bing_search.py
Created September 28, 2019 16:28
Python requests + webbrowser app
import requests
import webbrowser
sites = ["https://en.wikipedia.org/wiki",
"http://www.bing.com/images/search"]
def openPage(x):
w = " "
if x == 0:
w = "wiki"