René's URL Explorer Experiment


Title: Convert Python function to Java Function · Issue #17 · scijava/scyjava · GitHub

Open Graph Title: Convert Python function to Java Function · Issue #17 · scijava/scyjava

X Title: Convert Python function to Java Function · Issue #17 · scijava/scyjava

Description: It would be nice to support something like this: >>> def fib(n): ... if n == 0 or n == 1: ... return 1; ... return fib(n - 1) + fib(n - 2) ... >>> import scyjava >>> jfib = scyjava.convert.to_java(fib) >>> print(type(jfib))

Open Graph Description: It would be nice to support something like this: >>> def fib(n): ... if n == 0 or n == 1: ... return 1; ... return fib(n - 1) + fib(n - 2) ... >>> import scyjava >>> jfib = scyjava.convert.to_java(...

X Description: It would be nice to support something like this: >>> def fib(n): ... if n == 0 or n == 1: ... return 1; ... return fib(n - 1) + fib(n - 2) ... >>> import scyjava >>> jfib...

Opengraph URL: https://github.com/scijava/scyjava/issues/17

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Convert Python function to Java Function","articleBody":"It would be nice to support something like this:\r\n```python\r\n\u003e\u003e\u003e def fib(n):\r\n...     if n == 0 or n == 1:\r\n...         return 1;\r\n...     return fib(n - 1) + fib(n - 2)\r\n...\r\n\u003e\u003e\u003e import scyjava\r\n\u003e\u003e\u003e jfib = scyjava.convert.to_java(fib)\r\n\u003e\u003e\u003e print(type(jfib))\r\n\u003cclass 'scyjava.convert._convert.FunctionFromPython'\u003e\r\n\u003e\u003e\u003e\r\n```\r\n\r\nWhere `FunctionFromPython` is:\r\n```python\r\nfrom jnius import PythonJavaClass, java_method\r\n\r\nclass FunctionFromPython(PythonJavaClass):\r\n    __javainterfaces__ = ['java/util/function/Function']\r\n\r\n    def __init__(self, function):\r\n        self.function = function\r\n\r\n    @java_method('(Ljava/lang/Object;)Ljava/lang/Object;')\r\n    def apply(self, t):\r\n        return self.function(t)\r\n```\r\n\r\nThen anything operating on a Java `Function` can accept a Python `function` with appropriate conversion. For example:\r\n\r\n```python\r\njlist = ij.py.to_java([5, 4, 3, 2, 1])\r\nfibList = jlist.stream().map(jfib).toArray()\r\nprint(f'{type(fibList)}')\r\nprint(fibList)\r\n```\r\nPrints:\r\n```\r\n\u003cclass 'list'\u003e\r\n[8, 5, 3, 2, 1]\r\n```\r\n\r\n😎 ","author":{"url":"https://github.com/ctrueden","@type":"Person","name":"ctrueden"},"datePublished":"2020-06-18T18:10:15.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/17/scyjava/issues/17"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:bb4572a8-f1a7-fd58-a86a-0f2fbb8b3cf0
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idB0AE:166D49:300BBC:43807A:696A6751
html-safe-nonced55f9b2cb5ce2e7c917afa5b9c4adc2cefbb320d6173fc7ee7f5a884fc89ccf5
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMEFFOjE2NkQ0OTozMDBCQkM6NDM4MDdBOjY5NkE2NzUxIiwidmlzaXRvcl9pZCI6IjIwNTU1Mjc3OTAwNzU4NjQ5MTMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac33a441307a1e8e700c34d712b34b7b83dee739ce093e97b50e898592ec4fff4c
hovercard-subject-tagissue:641451680
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/scijava/scyjava/17/issue_layout
twitter:imagehttps://opengraph.githubassets.com/a5a0e4278e2b249a31aaf649d4ebcc690627f3aeffd91cf31e64986674864eba/scijava/scyjava/issues/17
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/a5a0e4278e2b249a31aaf649d4ebcc690627f3aeffd91cf31e64986674864eba/scijava/scyjava/issues/17
og:image:altIt would be nice to support something like this: >>> def fib(n): ... if n == 0 or n == 1: ... return 1; ... return fib(n - 1) + fib(n - 2) ... >>> import scyjava >>> jfib = scyjava.convert.to_java(...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamectrueden
hostnamegithub.com
expected-hostnamegithub.com
None6fea32d5b7276b841b7a803796d9715bc6cfb31ed549fdf9de2948ac25d12ba6
turbo-cache-controlno-preview
go-importgithub.com/scijava/scyjava git https://github.com/scijava/scyjava.git
octolytics-dimension-user_id1262770
octolytics-dimension-user_loginscijava
octolytics-dimension-repository_id113442144
octolytics-dimension-repository_nwoscijava/scyjava
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id113442144
octolytics-dimension-repository_network_root_nwoscijava/scyjava
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasef2d9f6432a5a115ec709295ae70623f33bb80aee
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/scijava/scyjava/issues/17#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fscijava%2Fscyjava%2Fissues%2F17
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fscijava%2Fscyjava%2Fissues%2F17
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=scijava%2Fscyjava
Reloadhttps://github.com/scijava/scyjava/issues/17
Reloadhttps://github.com/scijava/scyjava/issues/17
Reloadhttps://github.com/scijava/scyjava/issues/17
scijava https://github.com/scijava
scyjavahttps://github.com/scijava/scyjava
Notifications https://github.com/login?return_to=%2Fscijava%2Fscyjava
Fork 15 https://github.com/login?return_to=%2Fscijava%2Fscyjava
Star 54 https://github.com/login?return_to=%2Fscijava%2Fscyjava
Code https://github.com/scijava/scyjava
Issues 16 https://github.com/scijava/scyjava/issues
Pull requests 2 https://github.com/scijava/scyjava/pulls
Actions https://github.com/scijava/scyjava/actions
Projects 0 https://github.com/scijava/scyjava/projects
Security Uh oh! There was an error while loading. Please reload this page. https://github.com/scijava/scyjava/security
Please reload this pagehttps://github.com/scijava/scyjava/issues/17
Insights https://github.com/scijava/scyjava/pulse
Code https://github.com/scijava/scyjava
Issues https://github.com/scijava/scyjava/issues
Pull requests https://github.com/scijava/scyjava/pulls
Actions https://github.com/scijava/scyjava/actions
Projects https://github.com/scijava/scyjava/projects
Security https://github.com/scijava/scyjava/security
Insights https://github.com/scijava/scyjava/pulse
New issuehttps://github.com/login?return_to=https://github.com/scijava/scyjava/issues/17
New issuehttps://github.com/login?return_to=https://github.com/scijava/scyjava/issues/17
Convert Python function to Java Functionhttps://github.com/scijava/scyjava/issues/17#top
unscheduledhttps://github.com/scijava/scyjava/milestone/2
https://github.com/ctrueden
https://github.com/ctrueden
ctruedenhttps://github.com/ctrueden
on Jun 18, 2020https://github.com/scijava/scyjava/issues/17#issue-641451680
unscheduledNo due datehttps://github.com/scijava/scyjava/milestone/2
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.