Title: plain old C, to be called via ctypes · Issue #4 · rochacbruno/rust-python-example · GitHub
Open Graph Title: plain old C, to be called via ctypes · Issue #4 · rochacbruno/rust-python-example
X Title: plain old C, to be called via ctypes · Issue #4 · rochacbruno/rust-python-example
Description: we can format this a sa pr later, but it is this thing: unsigned long long count_double(char *str) { char *i, c1, c2; unsigned long long count = 0; c1 = *str; c2 = *(str + 1); for(i = str+1; c2 = *i; i++) { count += (c1 == c2); c1 = c2; ...
Open Graph Description: we can format this a sa pr later, but it is this thing: unsigned long long count_double(char *str) { char *i, c1, c2; unsigned long long count = 0; c1 = *str; c2 = *(str + 1); for(i = str+1; c2 = *...
X Description: we can format this a sa pr later, but it is this thing: unsigned long long count_double(char *str) { char *i, c1, c2; unsigned long long count = 0; c1 = *str; c2 = *(str + 1); for(i = str+1; c2 = *...
Opengraph URL: https://github.com/rochacbruno/rust-python-example/issues/4
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"plain old C, to be called via ctypes","articleBody":"we can format this a sa pr later, but it is this thing:\r\n```\r\nunsigned long long count_double(char *str) {\r\n char *i, c1, c2;\r\n unsigned long long count = 0;\r\n\r\n c1 = *str;\r\n c2 = *(str + 1);\r\n for(i = str+1; c2 = *i; i++) {\r\n count += (c1 == c2);\r\n c1 = c2;\r\n }\r\n return count;\r\n}\r\n```\r\nBuild with:\r\ngcc -shared -o libblacount.so -fPIC blacount.c\r\n\r\nAnd prepare to use from Python with:\r\n \r\nimport ctypes\r\nblacount = ctypes.cdll.LoadLibrary(\"./libblacount.so\")\r\nblacount.count_double.argtypes = [ctypes.c_char_p]\r\nblacount.count_double.restype = ctypes.c_uint64\r\n\r\n(it counts byte-strings only)","author":{"url":"https://github.com/jsbueno","@type":"Person","name":"jsbueno"},"datePublished":"2017-11-17T05:01:59.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/4/rust-python-example/issues/4"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:abd3c55d-f942-1cd9-05c2-f7dcd42db90d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BC88:53D51:1C2F36A:288C18C:6A4CE3D1 |
| html-safe-nonce | 1615c741fa3278c178b836e938bdfcf7ae43b624cfd2944418b473eafc6b3dc0 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQzg4OjUzRDUxOjFDMkYzNkE6Mjg4QzE4Qzo2QTRDRTNEMSIsInZpc2l0b3JfaWQiOiIxNjU1NzEzMjI3Mjg2MDQ1NjQ5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 9b6a514f9593adbd0f2b97d024a4522c887f4f80769ffcdfd1b73cdd33669755 |
| hovercard-subject-tag | issue:274752550 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/rochacbruno/rust-python-example/4/issue_layout |
| twitter:image | https://opengraph.githubassets.com/21d042dd699a859da2a15bc00848d836babb54fa0b6894c68f4cf0f4bbbf3632/rochacbruno/rust-python-example/issues/4 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/21d042dd699a859da2a15bc00848d836babb54fa0b6894c68f4cf0f4bbbf3632/rochacbruno/rust-python-example/issues/4 |
| og:image:alt | we can format this a sa pr later, but it is this thing: unsigned long long count_double(char *str) { char *i, c1, c2; unsigned long long count = 0; c1 = *str; c2 = *(str + 1); for(i = str+1; c2 = *... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jsbueno |
| hostname | github.com |
| expected-hostname | github.com |
| None | 299b43bca6e02ad35197ffeba30d2466846d5fb02ab96fbced5b5e6cec589fb8 |
| turbo-cache-control | no-preview |
| go-import | github.com/rochacbruno/rust-python-example git https://github.com/rochacbruno/rust-python-example.git |
| octolytics-dimension-user_id | 458654 |
| octolytics-dimension-user_login | rochacbruno |
| octolytics-dimension-repository_id | 110371573 |
| octolytics-dimension-repository_nwo | rochacbruno/rust-python-example |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 110371573 |
| octolytics-dimension-repository_network_root_nwo | rochacbruno/rust-python-example |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | c5a57f04eeb310f57c73fd6d751d957e2ca27ed2 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width