[v3][Android] Opening app through background notification doesn't trigger appropriate event

I'm using v3.1.1 of the library. When I receive background notification and tap on it, it opens my app, however Notifications.getInitialNotification() nor Notifications.events().registerNotificationReceivedBackground are triggered or have data.
Possibly related issue: https://github.com/wix/react-native-notifications/issues/445
Interestingly notifications that are received in foreground don't have this issue. If I receive notification in foreground, close my app and then click on such notification I am seeing correct behaviour in the app.
Foreground notifications come with problem of their own described here (they are empty) https://github.com/wix/react-native-notifications/issues/456

it's not triggered registerNotificationOpened on Android
version 3.1.1
RN: 0.60.4
android: 6.0.1

Experiencing the same issue. registerNotificationOpened is not triggered on Android. With iOS no problems occur.. https://github.com/wix/react-native-notifications/issues/498 Might be related

Any update on this issue?

Unfortunately not, still can’t figure out how to get it working on Android with the correct events.

Maybe this PR resolves the issue https://github.com/wix/react-native-notifications/pull/527/files

Experiencing the same issue :(

same issue here, and can't find a solution in any of the issue threads :(

Running into same issue

Hi, I too had faced the same kind of issue so I am posting my findings here.
First we need to understand when the notification is received and where it's sent from as the behavior depends on both these aspects.

Notification can be received by the App when it is either in Foreground/Background/Entirely Killed
Notification might be sent using:

FCM console
AdminSDK/ Using a HTTP protocol like postman

Now let's mix and match these cases and see from where we can get the payload:

Foreground + Admin SDK -> registerNotificationOpened
Foreground + FCM Console -> registerNotificationOpened
Killed/Background + Admin SDk -> getInitialNotification
Killed/Background + FCM -> This is where the issue lies

Now why does this occur:
As per Handling Messages, the notifications that are generated using Admin SDK are received by this library code, whereas the notifications that are sent by the FCM console are received by the Firebase SDK and the notification is generated by it. Now in this case the data payload is delivered in the extras of the intent of your launcher Activity.
You can get this data from your launcher activity's; This can be verified using:
By adding this in your launcher activity; For the sake of simplicity the code considers a random timer of 10 seconds to allow the listener to be set otherwise the event will be emitted before the listener is attached, but you can get the data using some native method which gets called from the JS instead of this timer
)
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Intent intent = getIntent();
    if (intent.getExtras() != null && intent.getExtras().keySet().contains("someparameterfromnotificationascheck")) {
        Log.d("Test", intent.getExtras().toString());
        JsIOHelper jsIOHelper = new JsIOHelper();
        new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {
                jsIOHelper.sendEventToJS("consolenotification", getIntent().getExtras(), getReactInstanceManager().getCurrentReactContext());
            }
        }, 10000);
    }
}

And by adding this in your JS where you want the notification
this.emitter = new NativeEventEmitter(NativeModules.RNEventEmitter);
    this.emitter.addListener("consolenotification", (data) => {
      alert("consolenotification" + JSON.stringify(data));
    });

So this is kind of a hacky solution, but it works

@vishalambre could you please clarify how your workaround should be implemented for the case Killed/Background + FCM. I'm suffering from the problem initial notification is always undefined.
I'm not very familiar with Java, sorry.
I tried to add a method you've mentioned in MainActivity and subscribed with the js code. See nothing in a console.

@anisimov74 Same
@vishalambre Could you please elaborate (with a little more code)?

I also see this issue. On Android, with the app in the background, and the notification sent through FCM, tapping the notification opens the app, but no event is raised. When the app is killed, it works, although getInitialNotification takes a long time before it runs.

I'm facing with the same issue.

Currently, I can't reproduce that issue. sometimes the issue happened, sometimes it's not happened the issue can't reproduce totally.

I have the same issue, app in background - no event has been called. App killed  - initial notification is getting called

If your sending the notification from console and the app is killed this might work, worked for me;
Although it does not work in one case:
App Killed/Background -> Notification Received from the console -> App Opened via launcher -> Clicked on the notification
This does not do anything as the OnCreate event has already passed.
Currently, I ended up having a "pushNotification" key against a blank value in the Firebase Console's Additional Options, until I find a better way to do this. The purpose of the key is that the library takes some decisions based on this key and it just needs to to be present to satisfy a condition which was failing

@vishalambre could you please clarify how your workaround should be implemented for the case Killed/Background + FCM. I'm suffering from the problem initial notification is always undefined.
I'm not very familiar with Java, sorry.
I tried to add a method you've mentioned in MainActivity and subscribed with the js code. See nothing in a console.

Updated the reply with a proper work around

facing the same issue, any updates on this?


ImportError: cannot import name 'ArxivScraper' from partially initialized module 'gpt_researcher.scraper.scraper'

Thank you for the great program.
An execution error occurred after the recent git pull.
Both pip and poetry have been updated.
Please help.
Ubuntu 22.04.4 LTS
python 3.11.8
'''
❯ python -m uvicorn main:app --reload
INFO:     Will watch for changes in these directories: ['/home/jspark/git/gpt-researcher']
INFO:     Uvicorn running on http://<IP_ADDRESS>:8000 (Press CTRL+C to quit)
INFO:     Started reloader process [154125] using WatchFiles
Process SpawnProcess-1:
Traceback (most recent call last):
File "/home/jspark/git/pyenv/versions/3.11.8/lib/python3.11/multiprocessing/process.py", line 314, in _bootstrap
self.run()
File "/home/jspark/git/pyenv/versions/3.11.8/lib/python3.11/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/home/jspark/git/pyenv/versions/3.11.8/envs/venv/lib/python3.11/site-packages/uvicorn/_subprocess.py", line 76, in subprocess_started
target(sockets=sockets)
File "/home/jspark/git/pyenv/versions/3.11.8/envs/venv/lib/python3.11/site-packages/uvicorn/server.py", line 61, in run
return asyncio.run(self.serve(sockets=sockets))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/jspark/git/pyenv/versions/3.11.8/lib/python3.11/asyncio/runners.py", line 190, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "/home/jspark/git/pyenv/versions/3.11.8/lib/python3.11/asyncio/runners.py", line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "uvloop/loop.pyx", line 1517, in uvloop.loop.Loop.run_until_complete
File "/home/jspark/git/pyenv/versions/3.11.8/envs/venv/lib/python3.11/site-packages/uvicorn/server.py", line 68, in serve
config.load()
File "/home/jspark/git/pyenv/versions/3.11.8/envs/venv/lib/python3.11/site-packages/uvicorn/config.py", line 467, in load
self.loaded_app = import_from_string(self.app)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/jspark/git/pyenv/versions/3.11.8/envs/venv/lib/python3.11/site-packages/uvicorn/importer.py", line 21, in import_from_string
module = importlib.import_module(module_str)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/jspark/git/pyenv/versions/3.11.8/lib/python3.11/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 1204, in _gcd_import
File "", line 1176, in _find_and_load
File "", line 1147, in _find_and_load_unlocked
File "", line 690, in _load_unlocked
File "", line 940, in exec_module
File "", line 241, in _call_with_frames_removed
File "/home/jspark/git/gpt-researcher/main.py", line 1, in
from backend.server import app
File "/home/jspark/git/gpt-researcher/backend/server.py", line 7, in
from gpt_researcher.utils.websocket_manager import WebSocketManager
File "/home/jspark/git/gpt-researcher/gpt_researcher/init.py", line 1, in
from .master import GPTResearcher
File "/home/jspark/git/gpt-researcher/gpt_researcher/master/init.py", line 1, in
from .agent import GPTResearcher
File "/home/jspark/git/gpt-researcher/gpt_researcher/master/agent.py", line 3, in
from gpt_researcher.master.functions import *
File "/home/jspark/git/gpt-researcher/gpt_researcher/master/functions.py", line 3, in
from gpt_researcher.scraper import Scraper
File "/home/jspark/git/gpt-researcher/gpt_researcher/scraper/init.py", line 1, in
from .scraper import Scraper
File "/home/jspark/git/gpt-researcher/gpt_researcher/scraper/scraper.py", line 6, in
from .scraper import (
ImportError: cannot import name 'ArxivScraper' from partially initialized module 'gpt_researcher.scraper.scraper' (most likely due to a circular import) (/home/jspark/git/gpt-researcher/gpt_researcher/scraper/scraper.py)
'''

I am facing this too with Python v3.12.1 (managed via asdf) and mac os.

Should be fixed now with latest PR: https://github.com/assafelovic/gpt-researcher/pull/392
Can you please help verify that it works now? @nileshtrivedi  @ParkJaeSeong

@assafelovic Yes, the app starts fine with the latest commit. 👍
Thanks for the quick fix! 👏

Great!


Configurability for X-POWERED-BY header

This will allow us to disable the X-POWERED-BY header, it will still be on by default.

Thanks for the PR!
Maybe we should just drop this header altogether? This is not the first PR touching it, and in my services I have a special middleware to hide it, which is annoying to be honest. @seanpianka what do you think?

..., and in my services I have a special middleware to hide it

Likewise, I have also disabled the header this way in the past.
I'd be in favor of either removal entirely, or gating this header behind a default-enabled feature flag. Then, we add a short section in the readme on how to disable this header for those interested.
This route avoids adding runtime complexity to router's initialization, maintains the promotion of Routerify, and idiomatically allows for its removal.

I'm not sure if a default-enabled feature flag is a good option, since if you guys wanna add a new default feature to the crate the developer will have to manually enable those default features just so that he could hide the X-POWERED-BY header, but if you aren't planning on going on a route like that then making it a default-enabled feature is fine in my opinion.

I think that the name expose() is a bit too ambiguous. Still, my preference is to completely get rid of this header.

Closing due to https://github.com/routerify/routerify/pull/95


chore(main): release uniform 0.9.3

:robot: I have created a release beep boop
0.9.3 (2024-10-07)
Bug Fixes

uniform: refactor select label style to tv slot (75353d1)

This PR was generated with Release Please. See documentation.

:robot: Created releases:

uniform-v0.9.3
:sunflower:


Play Services GcmTaskService schedule crashes sometimes

I am seeing a few crashes using GcmTaskService.
The error message show:
"There is no GcmTaskService component registered within this package. Have you extended GcmTaskService correctly?"
You can find the stacktrace, devices impacted and Android version here:
http://crashes.to/s/8f4a3a13a0c
Please find below more details on my setup:
Google Play services:
'com.google.android.gms:play-services-gcm:7.5.0'
AndroidManifest:
    <service
        android:name=".service.UploadAnalyticsService"
        android:exported="true"
        android:permission="com.google.android.gms.permission.BIND_NETWORK_TASK_SERVICE"
        >
      <intent-filter>
        <action android:name="com.google.android.gms.gcm.ACTION_TASK_READY"/>
      </intent-filter>
    </service>

Schedule code:
    OneoffTask myTask =
        new OneoffTask.Builder().setService(UploadAnalyticsService.class).setExecutionWindow(0,
            15 * 60)
            .setRequiredNetwork(Task.NETWORK_STATE_CONNECTED).setPersisted(
            true)
            .setUpdateCurrent(true).setTag(TASK_TAG).build();
    gcmNetworkManager.schedule(myTask);

And my Java class which obviously extends GcmTaskService
public class UploadAnalyticsService extends GcmTaskService

I have the same problem. It works correctly on all my devices, but sometimes user report this issue.

I run to the same problem exactly, and also checked that GoogleApiAvailability is available.

Any update on this? I've got the same exception on production lately.

Which version of the Googl play services are you using?

'com.google.android.gms:play-services:9.2.1' ?

I was using 9.0.0. I've updated to 9.2.1 just now, will see if this happens on this version as well.

I was getting the same crash with 8.4.0.
Is anyone able to reproduce this issue?
I have raised an issue for the same. Could you guys bump it up just in case.

Having the same problem here, using play services 8.4.0.
Can't find any way to reproduce nor find any common thing between all the crashes. It happened on pretty much any device and any OS version from what I can see.

updating to version 9.2.1 did not resolve this issue.

Any update on this issue? Still getting this in version 10.2.1
java.lang.IllegalArgumentException: There is no GcmTaskService component registered within this package. Have you extended GcmTaskService correctly?
       at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6324)
       at android.app.ActivityThread.access$1800(ActivityThread.java:222)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1861)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:158)
       at android.app.ActivityThread.main(ActivityThread.java:7229)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)

It seems i'm suffering from this as well occasionally, any updates?

Another one here ☝

I have crashes too in version 10.2.1

Hi everybody,
we are aware of this issue and we are actively investigating it.
Unfortunately it seems to be a problem within the Android Framework which leaves us few options available. We are still investigating and we will report if we can fix it.

I have crashes too
any update for the issue?

Also there is a crash, who ever fixed?

There is another similar bug (problem to find the service in the manifest) mentioned here: https://issuetracker.google.com/issues/37113668

I have the same bug in 12.0.0


It doesn't work.

I hit Ctrl + F1 and nothing happens.
Environment: VSCode latest version, installed as extension  flowmaker 1.2.0

I found out it's F1, not Ctrl+F1, then you have to write "flowmaker" on the field and choose "Flowmaker: Preview SVG".
 It should be called by typing FL for example and it should be on the menu and also as a toolbar button. More symbols, less text is the evolution, not the opposite!


How to monitor Intel GPU resources used by MediaSDK...

My company has asked me to create an application that can monitor Intel GPU resources that are used by the Intel Media SDK / MFX / QuickSync.  We run Intel QuickSync based transcoding software on our Intel E3 servers, and need to monitor how much of the system resources are currently being used on each server.
I have looked in the Media SDK for an API to get this information, but couldn't find one.  I then came across the Intel PAL / Intel Metrics Framework, and that seemed to have what I need.  I developed a metrics framework based application that monitored all of the "metrics" that seem to be related to MFX/QuickSync, and when I ran it on Windows 10, it seemed to work fine.  Unfortunately, when I ran it on one of our Intel E3 servers (which run Windows 2012 Server OS), it said that none of the "metrics" related to QuickSync were detected.
NOTE: I used to work at Intel, and sometimes interfaced with the Media SDK dev team.  I know that what I am trying to do is possible, because I saw one of the Media SDK developers running something like what I'm developing.
Anyone have any idea where I can go for help with this?  My company is willing to pay for support.

If there are no more questions here I will close it but feel free to open new one in case of new questions or troubles.


add a metric for the last time we appended metrics to local storage

@krasi-georgiev as discussed on https://github.com/prometheus/tsdb/pull/401
I don't know how we could solve https://github.com/prometheus/tsdb/issues/395 because we kind of have to get that metric from within TSDB itself. We have no information about Head/WAL truncation and what the oldest metric timestamp is from Prometheus itself.
Signed-off-by: Callum Styan<EMAIL_ADDRESS>

Just realised that you can use prometheus_tsdb_head_max_time (soon to be renamed to prometheus_tsdb_head_max_time_milliseconds)

ping @cstyan

@krasi-georgiev sorry I'm still in the middle of the remote write stuff and I haven't been keeping track of what metrics I've added there that I actually need. This can be closed for now and I'll either reopen or open a PR with the correct changes.


Custom sorting logic?

I prefer to group my changelog commits in the following example order: "breaking, new, fix, refactor, docs, deps, dev deps, tests, meta"
Is there any way I can provide a custom sorting function to the list of commits?

You should be able to use --handlebars-setup <file> to write your own helper (similar to commit-list), and use that helper in a custom --template <file> to achieve this. It's a pretty advanced use of auto-changelog, and might take a lot of trial and error, but can be done.


Fixes #11057 - Non-admin user can't join open teams

Describe your changes:
Fixes #11057

I worked on ... because ...

Type of change:

[x] Bug fix
[ ] Improvement
[ ] New feature
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
[ ] Documentation

Checklist:

[x] I have read the CONTRIBUTING document.
[x] My PR title is Fixes <issue-number>: <short explanation>
[x] I have commented on my code, particularly in hard-to-understand areas.
[ ] For JSON Schema changes: I updated the migration scripts or explained why it is not needed.

@chirag-madlani cypress test failures seem unrelated to this patch. Merging.


Resource Requirements for M-Series and Fallback Feature Request

Resource Requirements for M-Series and Fallback Feature Request
Hardware Configuration

M2 Max with 32GB RAM, 1TB Storage
Experiencing consistent training failures even with reduced parameters

Current Workaround
Implemented a fallback mechanism: if training fails, use the base model instead of the fine-tuned one. This maintains functionality while gracefully handling resource constraints.
Feature Request

Document minimum hardware requirements for M-series chips
Integrate fallback mechanism into main branch for better user experience

Questions

What are the minimum tested configurations for M-series Macs?
Are there recommended parameter settings for different hardware configs?

Thanks for creating this amazing project! The email automation concept is brilliant. I've implemented a fallback solution that might benefit others facing similar resource constraints. Happy to contribute more if this aligns with the project's vision.

Thank you for this thoughtful comment/suggestion! As of right now I don't have resources to test where's the boundary of being able to (efficiently) fine tune, and I haven't seen any specific documents about that. I'd truly appreciate it if you want to submit a PR for integrating the fallback you have -- seems like a great thing to add!

Hi Yicong,
Thank you for your prompt response and support! I really appreciate your openness to the fallback mechanism suggestion.
I've just submitted a pull request (#7) that implements this fallback feature. The PR includes:

Automatic fallback to base model when training fails
Clear error logging
Seamless continuation of email bot operation

Looking forward to your review and feedback. Happy to make any adjustments needed to align with the project's standards.
Thanks again for maintaining such a useful project!
Chen

Hi Chen,
I'm glad to see that you made a clear PR and sorry to not have responded sooner (was buried by other stuff). Could you please kindly see my comment for improvement?
Thanks,
Yicong


leetcode.cn cannot sign in

Hello there. I'm always getting this error, and i have already set cn as enabled.

Kinda weird and i don't know what to do rn...

Can you try Leet cookie delete?

It should work now without deleting the cookie. Can you confirm?

No, cannot work rn.

I updated plugin.
Sign in (By Cookie) -> session expired
Leet cookie delete
Sign in (By Cookie) -> session expired
re sign-in leetcode.cn
Sign in (By Cookie) -> session expired

oh i fixed. previously i modified cn in ~/nvim/lua/plugins/leetcode.lua, now i modified cn in ~/nvim-data/lazy/leetcode.nvim/lua/leetcode/config/template.lua, now it works.

Can I see your configuration file for leetcode.nvim? You only modified the source code, so when I update this plugin the tamplate.lua will get overridden.

just like the pic above, i only modified cn->enabled=true, and nothing else.
here's my template.lua: https://paste.ubuntu.com/p/75vgSCpCh2/
here's my leetcode.lua: https://paste.ubuntu.com/p/6rykmm3qwH/

 opts = {
            ---@type string
            arg = "leetcode.nvim",

            ---@type lc.lang
            lang = "cpp",

            cn = { -- leetcode.cn
                enabled = false, ---@type boolean
                translator = true, ---@type boolean
                translate_problems = true, ---@type boolean
            },

            ---@type string
            directory = vim.fn.stdpath("data") .. "/leetcode/",

            ---@type boolean
            logging = true,

            injector = {}, ---@type table<lc.lang, lc.inject>

            cache = {
                update_interval = 60 * 60 * 24 * 7, ---@type integer 7 days
            },

            console = {
                open_on_runcode = true, ---@type boolean

                dir = "row", ---@type lc.direction

                size = { ---@type lc.size
                    width = "90%",
                    height = "75%",
                },

                result = {
                    size = "60%", ---@type lc.size
                },

                testcase = {
                    virt_text = true, ---@type boolean

                    size = "40%", ---@type lc.size
                },
            },

            description = {
                position = "left", ---@type lc.position

                width = "40%", ---@type lc.size

                show_stats = true, ---@type boolean
            },

            hooks = {
                ---@type fun()[]
                LeetEnter = {},

                ---@type fun(question: lc.ui.Question)[]
                LeetQuestionNew = {},
            },

            keys = {
                toggle = { "q", "<Esc>" }, ---@type string|string[]
                confirm = { "<CR>" }, ---@type string|string[]

                reset_testcases = "r", ---@type string
                use_testcase = "U", ---@type string
                focus_testcases = "H", ---@type string
                focus_result = "L", ---@type string
            },

            ---@type boolean
            image_support = false, -- setting this to `true` will disable question description wrap
    },

opts don't apply because you have them nested in an additional table.

and set cn.enabled to true

yep it works. thx a lot!


Issue#18  Corrected misplaced brackets

Issue #18
Corrected misplaced bracket in java to kotlin example for type casting.

@ishaan1995 This is done intentionally, check the example below that.

Yeah I got that from the smart casting example, I thought the bracket was misplaced in above example as both are showcasing same thing.


Is necessary removeObserver in NSNotificationCenter for iOS 9.0 and later or macOS 10.11 and later ？

New Issue Checklist

[ ] I have read and understood the CONTRIBUTING guide
[ ] I have read the Documentation
[ ] I have searched for a similar issue in the project and found none

Issue Info

Info
Value

Platform Name
e.g. ios / macos

Platform Version
e.g. 11.0 / 10.13.0 / 11.0 / 4.0

SDWebImage Version
e.g. 4.2.0 / 4.1.0

Integration Method
e.g. carthage / cocoapods / manually

Xcode Version
e.g. Xcode 9 / Xcode 8

Repro rate
e.g. all the time (100%) / sometimes x% / only once

Repro with our demo prj
e.g. does it happen with our demo project?

Demo project link
e.g. link to a demo project that highlights the issue

Issue Description and Steps
Please fill in the detailed description of the issue (full output of any stack trace, compiler error, ...) and the steps to reproduce the issue.
According to apple's documentation,

If your app targets iOS 9.0 and later or macOS 10.11 and later, you don't need to unregister an observer in its dealloc method. Otherwise, you should call removeObserver:name:object: before observer or any object passed to this method is deallocated.

so, removeObserver is necessary with iOS 9.0 and later or macOS 10.11 and later ？
Thanks
kinarob

The comment answer your question:
you don't need to unregister an observer in its dealloc method
You can still call removeObserver any times , even you didn't register any observer for the target notification name. It does not cause any issue because Apple implementation check whether they have current object registered in the notification maps.

The table of observations contains weak pointers which are zeroed when the observers get garbage collected. so，The object will release quickly if you don't call removeObserver?

@kinarob If you target after iOS9.0, you don't need remove observer explicitly. otherwise, you still need it. The reason why it don't needed anymore I think is Apple remove the unsafe_unretained in Observer and uses weak instead. So no crash anymore, pointer is safe.

@zhongwuzw Hi brother，I'm testing on real device（iOS 8.1.3) today, and if you forget to removeObserver, it still won't cause crash.

@kinarob Yeah, definitely, it not uses weak, it uses unsafe_unretained. Like my comment said above, your App's minimun target should greater than iOS9.0.

I think this Issue can close. @kinarob Thanks for this discussion.

Thank you for your reply, I'm so dumb. What we can be sure is that iOS 9 or above devices don't cause crash. I'm curious why we don't remove observer and still don't cause crash on iOS 8 devices. I think if unsafe_unretained is on iOS 8 devices, it will cause crash, but in fact It didn't cause crash, so I created this issues, guessing that unsafe_unretained was not used on iOS 8 devices, and that there would be no need to remove the observer later. The following is the source of research
- postNotificationName:object:  GUN  Foundation (for reference only) .

/**
 * Private method to perform the actual posting of a notification.
 * Release the notification before returning, or before we raise
 * any exception ... to avoid leaks.
 */
- (void)_postAndRelease:(NSNotification*)notification
{
  Observation	*o;
  unsigned	count;
  NSString	*name = [notification name];
  id		object;
  GSIMapNode	n;
  GSIMapTable	m;
  GSIArrayItem	i[64];
  GSIArray_t	b;
  GSIArray	a = &b;

  if (name == nil) {
      RELEASE(notification);
      [NSException raise: NSInvalidArgumentException
		  format: @"Tried to post a notification with no name."];
    }
  object = [notification object];

  /*
   * Lock the table of observations while we traverse it.
   *
   * The table of observations contains weak pointers which are zeroed when
   * the observers get garbage collected.  So to avoid consistency problems
   * we disable gc while we copy all the observations we are interested in.
   * We use scanned memory in the array in the case where there are more
   * than the 64 observers we allowed room for on the stack.
   */
  GSIArrayInitWithZoneAndStaticCapacity(a, _zone, 64, i);
  lockNCTable(TABLE);

  /*
   * Find all the observers that specified neither NAME nor OBJECT.
   */
  for (o = WILDCARD = purgeCollected(WILDCARD); o != ENDOBS; o = o->next) {
      GSIArrayAddItem(a, (GSIArrayItem)o);
    }

  /*
   * Find the observers that specified OBJECT, but didn't specify NAME.
   */
  if (object) {
      n = GSIMapNodeForSimpleKey(NAMELESS, (GSIMapKey)object);
      if (n != 0) {
          o = purgeCollectedFromMapNode(NAMELESS, n);
          while (o != ENDOBS) {
              GSIArrayAddItem(a, (GSIArrayItem)o);
              o = o->next;
          }
      }
  }

  /*
   * Find the observers of NAME, except those observers with a non-nil OBJECT
   * that doesn't match the notification's OBJECT).
   */
  if (name) {
      n = GSIMapNodeForKey(NAMED, (GSIMapKey)((id)name));
      if (n){
          m = (GSIMapTable)n->value.ptr;
      } else {
          m = 0;
      }
      if (m != 0) {
	  /*
	   * First, observers with a matching object.
	   */
	  n = GSIMapNodeForSimpleKey(m, (GSIMapKey)object);
	  if (n != 0) {
	      o = purgeCollectedFromMapNode(m, n);
	      while (o != ENDOBS) {
		  GSIArrayAddItem(a, (GSIArrayItem)o);
		  o = o->next;
          }
      }

	  if (object != nil) {
	      /*
	       * Now observers with a nil object.
	       */
	      n = GSIMapNodeForSimpleKey(m, (GSIMapKey)nil);
	      if (n != 0) {
	          o = purgeCollectedFromMapNode(m, n);
              while (o != ENDOBS) {
                  GSIArrayAddItem(a, (GSIArrayItem)o);
                  o = o->next;
              }
          }
	    }
      }
    }

  /* Finished with the table ... we can unlock it,
   */
  unlockNCTable(TABLE);

  /*
   * Now send all the notifications.
   */
  count = GSIArrayCount(a);
  while (count-- > 0) {
      o = GSIArrayItemAtIndex(a, count).ext;
      if (o->next != 0) {
          NS_DURING {
              [o->observer performSelector: o->selector
                                withObject: notification];
          }
          NS_HANDLER {
              NSLog(@"Problem posting notification: %@", localException);
          }
          NS_ENDHANDLER
      }
  }
  lockNCTable(TABLE);
  GSIArrayEmpty(a);
  unlockNCTable(TABLE);

  RELEASE(notification);
}

@kinarob 👍 for your curiosity. But if you wants to get how framework implements in iOS8, I think you can check the assembly and Xcode to debug. We'd better to follow Apple's documents, maybe some versions in series of iOS8 already support weak behavior, but anyway, always add removeObserver explicitly is more robust.
I said unsafe_unretained, I mean framework just keep the pointer of the observer, so framework can use unsafe_unretained、assign、address pointer to store, these actually do the same thing.
And the source you linked is not the source code of Apple, it's just GNU project. So if you curious, you can debug and see how mechanism works, post here that we can all learned.

😂😂，You're right. I think I should check the assembly and Xcode to debug，Thank you @zhongwuzw


removed_fileds not acknowledged in arrow_reader_worker

Sadly won't be able to reproduce the error quickly :
transform = TransformSpec(lambda x : x, removed_fields=["columnA"])
reader = make_batch_reader(dataset_url, transform_spec=transform)
# next(reader) gives an error

I was trying to trace the error and realised that

reader.schema : doesn't have columnA
arrow_reader_worker.py calls schema.make_namedtuple(**result_dict) where result_dict comes from worker workers_pool.get_results().
The result_dict seems to have columnA in it.

The error is following :
~/Desktop/github/petastorm/petastorm/reader.py in __next__(self)
    598     def __next__(self):
    599         try:
--> 600             return self._results_queue_reader.read_next(self._workers_pool, self.schema, self.ngram)
    601         except StopIteration:
    602             self.last_row_consumed = True

~/Desktop/github/petastorm/petastorm/arrow_reader_worker.py in read_next(self, workers_pool, schema, ngram)
     71             print(f"The schema has the following keys : \n {schema._fields.keys()}")
     72             print(f"The resulting dict has the folowing keys {result_dict.keys()}")
---> 73             return schema.make_namedtuple(**result_dict)
     74
     75         except EmptyResultError:

~/Desktop/github/petastorm/petastorm/unischema.py in make_namedtuple(self, **kargs)
    233                 typed_dict[key] = None
    234         print(typed_dict.keys())
--> 235         return self._get_namedtuple()(**typed_dict)
    236
    237     def make_namedtuple_tf(self, *args, **kargs):

TypeError: __new__() got an unexpected keyword argument 'columnA'

Suggested (quick) solution is to add an if condition inside the read_next to ensure that column.name in schema._field.keys().
One can have a look here at my fork here.

Seems to me that the problem her is what appears to be a confusing interface. I see that you assumed that
transform = TransformSpec(lambda x : x, removed_fields=["columnA"])

removes "columnA" from the data-frame for you, while my intent was to indicate that your lambda actually removes the column. I can see how this is confusing. I would expect the code to be like this:
def delColumnA(x):
   del x['columnA']
   return x

transform = TransformSpec(lambda x : x, removed_fields=["columnA"])

I'll prepare a diff to support syntax like this: TransformSpec(removed_fields=["columnA"]). Does it makes sense to you?

Sent you an invite to collaborate on Petastorm. Would appreciate your help reviewing #417 with the fix. Thanks!

Hey @selitvin, I'd love to review the PR, looks like I don't have the right perms. Also looks like few CircleCI tests are failing!


Runtimes other than Tokio

It would be nice to relax the dependency on the tokio runtime for running shiplift futures.
This dependency exists because the http transport (Hyper) implicitly relies on the tokio runtime by default.
Hyper provides a means for optionally using a custom runtime by exposing a generic trait.
shiplift should re-expose this api so that it is not tightly coupled to tokio

looking at this now. Should be simple enough to add methods to pass an executor through to the Hyper client when creating a Docker object. Hyper's HttpConnector uses calls to Spawn under the hood, so it also needs to have the executor passed through to it on creation. Does the hyperlocal::UnixConnector make use of a runtime internally?
I'll do this with the old futures api for now

i've done some more investigating- It'll require exposing a generic trait for a task executor object, and then passing that in to the hyper client. Hyper exposes this via the tokio::Executor trait for this purpose, but the futures crate has the equivalent futures::Spawn trait (they're pretty much identical, but neither is a re-export of the other, currently).
My feeling is it's better to expose futures::Spawn as the required trait in the API, and then impl tokio::Executor for that object internally before passing it to hyper::Client.
I see what you mean about the lack of stability....


logger appends to current log file (if it exists) instead of wiping it clean first

for example if you run python src/main.py --env cover --approach oracle --seed 0 twice, you'll have two different sets of test results in the same log file. discuss whether we actually want this

the main advantage is that we won't accidentally overwrite logs. the main disadvantage is it's potentially confusing and gross. the tiebreaker for me is that we're going to be accidentally overwriting results in the first case regardless, so we might as well go with the option that avoids the confusion / grossness, i.e., overwrite logs rather than append.


v3.3.0 on macOS 12: ./virtualization_14.h:25:80: error: no type or protocol named 'VZNetworkBlockDeviceStorageDeviceAttachmentDelegate'

Describe the bug
v3.3.0 cannot be built on macOS 12
To Reproduce
Build v3.3.0 with macOS 12 on GHA
Expected behavior
It should be compilable
Screenshots
https://github.com/lima-vm/lima/actions/runs/11656525011/job/32456361334?pr=2834
# github.com/Code-Hex/vz/v3
In file included from ../../../go/pkg/mod/github.com/!code-!hex/vz/v3@v3.3.0/storage.go:10:
./virtualization_14.h:25:80: error: no type or protocol named 'VZNetworkBlockDeviceStorageDeviceAttachmentDelegate'
@interface VZNetworkBlockDeviceStorageDeviceAttachmentDelegateImpl : NSObject <VZNetworkBlockDeviceStorageDeviceAttachmentDelegate>
                                                                               ^
./virtualization_14.h:27:21: error: expected a type
- (void)attachment:(VZNetworkBlockDeviceStorageDeviceAttachment *)attachment didEncounterError:(NSError *)error;
                    ^
./virtualization_14.h:28:33: error: expected a type
- (void)attachmentWasConnected:(VZNetworkBlockDeviceStorageDeviceAttachment *)attachment;
                                ^
3 errors generated.
make: *** [_output/bin/limactl] Error 1

Environment that you use to compile (please complete the following information):
https://github.com/actions/runner-images/blob/macos-12/20240926.174/images/macos/macos-12-Readme.md

Xcode version: 14.2
macOS Version: 12.7.6
mac architecture: Intel
Go Version: 1.23.1

Additional context
Observed in:

https://github.com/lima-vm/lima/pull/2834

@AkihiroSuda Thanks for your report!
I think this issue will be solved by this commit: https://github.com/Code-Hex/vz/pull/169/commits/6f19063ac364a1abd2c4d8aab6ecf6180066ebdb

Thanks

Thanks!


Failed to find mapper

Hi,
Sorry to open another issue up so soon. I used the example given on the project page, but Portmapper fails to find any mapping devices. It did open a UDP port in UPnP 60339. Is there an alternate process for device discovery?

Got logs?

Sorry if it's something obvious, but where are these being dumped? Or do I have to write one around the process? I add PortMapper as a standalone jar into the project I'm working on, since it's that old i.e. no Maven / Gradle etc.

How did you add it as a standalone jar? The project has dependencies on some apache commons libraries and slf4j.
In any event, here's how the logging works...
The project uses slf4j for logging. slf4j is a high-level API that binds with many different Java logging frameworks, so in addition to slf4j-api (which is already included as a dependency), so you have to also provide a logger implementation and a slf4j binder for that logger implementation.
I think the simplest thing you can do is ...

download slf4j-simple (1.7.21 I think is the version you want)
include the slf4j-simple jar file in to your classpath when you run
include the following command line arg when you run: -Dorg.slf4j.simpleLogger.defaultLogLevel=debug

slf4j-simple is an binder that doesn't map to any particular logging implementation, instead it dumps logs out to console.  The command line arg tells it to log at the debug-level.
If you want a better overview of how to configure slf4j with different loggers, you can check out this page:  http://saltnlight5.blogspot.ca/2013/08/how-to-configure-slf4j-with-different.html

Side note: You have to have some logging set up, because in your last ticket you copy/pasted some log messages along with the error.

Sorry, I was suddenly swamped at work. I promise to get you the info needed as soon as I can.


Verifier Transaction Batch Ordering

Describe the bug
Verifiers will

Passively observe Ethereum contracts
Compute the resulting state of rolled up transactions by using the OVM geth fork
Prove fraud resulting from a mismatch between claimed resulting state and computed resulting state

Batches of rollup transactions will likely contain more than one rollup transaction (that's the whole benefit of Optimistic Rollup), and these transactions will need to be processed by the OVM geth fork in order of batch number, followed by index within batch.
At the moment, the mechanism by which order is enforced in transmitting transactions to the OVM geth fork does not work and assigns all transactions within a batch the same index
Steps to reproduce
Steps to reproduce the behavior:

Run a verifier pointing at contracts with rollup transactions posted (starting at an L1 block number before they were posted)
Verify that l1_rollup_tx entries all have an index_within_submission of 0

Expected behavior
The l1_rollup_tx.index_within_submission should be unique in combination with geth_submission_queue_index, and the first transaction in the rollup batch should get index 0, the second gets index 1, and so on...

Note: this issue does not pertain to full-blown Sequencers because Sequencers have already processed batches of transactions within the OVM geth fork at the time that they receive and parse the rollup data from Ethereum. Sequencers can then just compare state roots instead of send to Geth and then compare state roots.


Prevent saving an "empty" session

My use case is the following:
I want to autoload a session for the cwd at start if it exits. If not I want to open alpha dashboard. I have setup alpha not to start automatically and have the following function as on_autoload_no_session function:
local on_autoload_no_session = function()
  -- need to pass true (on_vimenter) so that alpha clears the unnamed buffer vim creates at start
  require("alpha").start(true)
end

The first run everything goes fine, alpha dashboard starts up:

(just noticed the typo in "Find sesssion" :))
Then I hit <leader>q which is bound to :qa! in the dashboard settings.
The next time I open nvim in the same cwd, persisted loads practically an empty session:

Here's the actual session.vim file saved:
let SessionLoad = 1
let s:so_save = &g:so | let s:siso_save = &g:siso | setg so=0 siso=0 | setl so=-1 siso=-1
let v:this_session=expand("<sfile>:p")
silent only
cd ~/gits/persisted.nvim
if expand('%') == '' && !&modified && line('$') <= 1 && getline(1) == ''
  let s:wipebuf = bufnr('%')
endif
let s:shortmess_save = &shortmess
if &shortmess =~ 'A'
  set shortmess=aoOA
else
  set shortmess=aoO
endif
argglobal
%argdel
set lines=61 columns=232
if exists('s:wipebuf') && len(win_findbuf(s:wipebuf)) == 0 && getbufvar(s:wipebuf, '&buftype') isnot# 'terminal'
  silent exe 'bwipe ' . s:wipebuf
endif
unlet! s:wipebuf
set winheight=1 winwidth=20
let &shortmess = s:shortmess_save
let s:sx = expand("<sfile>:p:r")."x.vim"
if filereadable(s:sx)
  exe "source " . fnameescape(s:sx)
endif
let &g:so = s:so_save | let &g:siso = s:siso_save
set hlsearch
nohlsearch
doautoall SessionLoadPost
unlet SessionLoad
" vim: set ft=vim :

What should've happened (imo) is that the alpha dashboard would've opened instead of this "session".
My question is: is there a way to prevent persisted from saving such an "empty" session?

 I use this for my config:
use({
  "olimorris/persisted.nvim",
  module = "persisted", -- For lazy loading
  config = function()
    require("persisted").setup()
    require("telescope").load_extension("persisted") -- To load the telescope extension
  end,
})

and my "Find Session" command calls require("persisted").load().
I take your point though that there could be times when an empty session is saved to disk. Defo a risk if you don't lazy load.

Hmm, how would lazyloading work with autoloading sessions? My use case is that I want to load alpha dashboard if session autoload fails, my reasoning being that manually loading an existing session for the current workdir is an unnecessary extra step.

It wouldn't; misread that first part of the issue 😄. Really good use case btw.
I think there's two components we'd need:

A global variable to inform other plugins (or your config) that no session has been autoloaded (a global variable feels like the cleanest way of doing this)
The ability to ignore the alpha filetype, ensuring that a blank session is not saved to disk if you quit Neovim from the dashboard

Do you agree?

That should do it, or at least I can't think of a reason why that wouldn't work.

I've marked this as an enhancement and will try and pick this up in a couple of weeks

Another option is to use the return value of a callback (e.g. true or false) to determine whether a session should be auto-saved — that way, any condition can be implemented. We could either use the existing before_save or introduce a new callback like should_save or should_autosave, or perhaps even allow the user to pass a callback to the existing autosave as an alternative to a boolean. It shouldn't affect manual SessionSaves, of course.

@loqusion - really good suggestion! Much cleaner and will cover anyone's edge case. I've added this in the latest commit

That's really nice, works like a charm and makes it easy to update if there's more conditions in the future! Takkâ ennuv!


Recursively detect frame work when multiple inheritance of nn.Module is used

Hi,
I found that the function detect_framework() in graph.py can only detect the class directly inherited from nn.Module (in a Pytorch style), so I wrote this:
def find_root_class(outer_class, all_classes):
if outer_class.__bases__[0] == object:
return all_classes + outer_class.__bases__
else:
return find_root_class(outer_class.__bases__[0], all_classes + outer_class.__bases__)
Then the original detect_framework() could be:
def detect_framework(value):
classes = find_root_class(value.__class__, ())
for c in classes:
if c.__module__.startswith("torch"):
return "torch"
elif c.__module__.startswith("tensorflow"):
return "tensorflow"
Hope this could be useful.

A more elegant solution has already been implemented in 294f8732b271cbdd6310c55bdf5ce855cbf61c75. However, it has not been merged yet (and unfortunately, probably is not going to get merged any time soon). Nevertheless, you can already use the fixed version, if you install hiddenalyer via git and not via pip.


[Experiment] TypeSafe Query Builder - Behavior when the select clause is omitted

If the select clause is omitted, all columns will be selected.
The "*" keyword must not be used.
All columns will be selected even if a table join is performed.
Note that if there are duplicate column names, the table referenced first will take priority.
If this specification is not met, the workaround is to manually declare the select clause.

I will not do this because of the following difficulties.
I think it is possible to get the column names if TableBase is a PhysicalTable.
However, when tables other than Physical Tables are mixed in, it is necessary to re-express them using "*", which is a bit of a hassle.
I am interested in this issue, but since the content is similar to the following issue, I will not do this for now.
[Experiment] TypeSafe Query Builder - Allows you to specify a DataSet in the select clause #430


[Feature Request] Ability to remap keybinds to mouse input.

📝 Provide a description of the new feature
What is the expected behavior of the proposed feature?  What is the scenario this would be used?
Currently, powertoys has the ability to remap any key to any other key. My suggestion is to extend this feature to also remap specific keys to click events. This might be useful for people with trackpads especially, as it will cut the time of having to click using the trackpad alone.

If you'd like to see this feature implemented, add a 👍 reaction to this post.

great idea, tracked in #3364


wasm fails to decode when using webpack -p

Bug report
What is the current behavior?
When bundling with -p webpack warns that LEB128 encoding changed, this might lead to bugs on the console, when attempting to load the file an error is thrown:  CompileError: AsyncCompile: Wasm decoding failed: table index 101 out of bounds (1 entry) @+346
If the current behavior is a bug, please provide the steps to reproduce.
Here is a repository to reproduce the above: https://github.com/Alexendoo/webpack-wasm-bug, it has a few npm scripts

build and bindgen to output the wasm file using cargo and wasm-bindgen
webpack:p and webpack:d to run webpack -p and -d respectively
serve runs a webserver to browse the result

The first two scripts require a rust environment to be set up, but the repository has the results of running all the build steps committed into it so they don't necessarily need to be ran again, you can jump straight to serve to see the result.
What is the expected behavior?
webpack -p should produce usable wasm modules, like webpack -d does in this case
Other relevant information:
webpack version:  4.16.1
Node.js version: v10.7.0
Operating System: Windows 10
Additional tools: Cargo, wasm-bindgen

Cc @xtuc

https://github.com/webpack/webpack/pull/7732 seems to have fixed it.

Yes, this sounds a lot like webassemblyjs #407, which is consistent w/ #7732 fixing it.

Also I would like to re-enable the optimization.mangleWasmImports but i'm not able to write a failing test. I'll try on real world example, before submitting a PR.

Had the exact same issue and can confirm that setting @TimHambourger's usedExports: false fixed it for me.

We have a battle tested LEB128 crate in the rust community, that we could compile to wasm if that would be useful ;)
https://github.com/gimli-rs/leb128

webpack v.4.18.0 should fix it


Minor improvments: local images and ability to edit and duplicate cards

Thanks for bringing these up.
Are these changes something you would want merged into the main repo, or are they something you need just for yourself in your fork?
Regardless, I'm interested in your use cases for them, if you're willing to share :)
If you want these merged into the main repo, then at least the card editing and creation/duplication needs to be put behind a setting, similar to allowCategoryEditing. I would add a allowCardEditing flag that allows both editing and duplicating.

First of all thank, you for this (free software) sorting card tool.
My idea was to share with you some modifications I made. You may want to merge them in your repo.
The uses cases are very common:

Editing cards: in the initialization phase of the card sorting, while letting users browsing the cards' label and discussing with them their meaning, it is common that users submit some labels that are more meaningful for them. With physical cards, we usually strike the old label and add a new one on the card. It is useful to understand how much our labels are meaningful.
Duplicate cards: in the sorting phase, it happens that users want to drag a card in several groups (more like with a tag, than with a section). After a discussion, it is common to allow the users to take a blank card, to duplicate the label on it, and then sort the same label in several groups.

I will explore how to add settings.

Ah, thanks for the clarifications. Since duplicating cards has a different purpose than editing cards, my earlier suggestion to place them behind a single settings flag may be misguided.

If you do edit the settings, there's one piece of complexity that maybe in hindsight wasn't the best idea. The settings flags are packed into the bits of a single number.
https://github.com/indigane/cardsort/blob/main/common-scripts.js#L3-L6
const settingsFlagsEnum = {
  allowCategoryEditing: 1,
  isRandomized: 2,
};

So when adding flags, these need to be powers of 2, for example:
const settingsFlagsEnum = {
  allowCategoryEditing: 1,
  isRandomized: 2,
  allowCardEditing: 4,
  allowCardDuplication: 8,
};

I added two settings, I hope it is OK.

Some final improvements in order to show the old label when it has been edited (it also work with Export and Share). I think my work on this feature is over.

Hi,
Do you agree to merge this PR?
I have some other changes to propose as a PR. It would be easier to submit them once this first PR has been accepted or rejected.


Will the yi home 1080p IFUSY44GBN compatible.?

Hello, Will the yi home 1080p IFUSY44GBN be able to have these extra features. Thank you.

I don't know.
What platform is?
What firmware version is?

Here is a backup
backup.zip

Your cam is a y21ga.
You can use this hack.

Not working, just yellow light stays on, thank you for looking into it for me.

Remove all saved mp4 from the sd card (record folder) and try again.

Not working, just yellow light stays on, thank you for looking into it for me.

And use the provided cable and wall adaptor, if it is weak the cam doesn't work correctly.

Still no good, can i edit any files for this to work, i am using original power and micro usb. Thank you for your time and thoughts.

I checked again your dump and it's ok.
What program are you using to decompress the archive?

7Zip, is that no good. thank you.

7zip is ok.
Another question: does backup procedure work?
I mean the procedure explained in the wiki.

Yes it does.

The hack uses the same procedure.
It must work.

Did you check the web interface?

Yes, I now think its bricked, will open it up to repair. thank you.

When i come to open it up for repair, is there any commands or file i can use or write to the loader, to make this work. thank you.

Ive unbricked, and watched the boot process, but its not finding a file for some reason, here is the end of the boot,
checkdisk.c(do_fat_check-121)[00:00:07.388]:retBuf(fsck.fat 3.0.26 (2014-03-07)
step 0 5
0x41: Dirty bit is set. Fs was not properly unmounted and some data may be corrupt.
step 1 5
step 2 5
step 3 7
step 4 7
step 5 7
step 6 7
/dev/mmcblk0p1: 559 files, 2088/998043 clusters
)
checkdisk.c(do_fat_check-140)[00:00:07.391]:Mount sd ok.
checkdisk.c(check_partion_vfat-156)[00:00:07.391]:TF Card check finished.
checkdisk, main() ret_status(10000)
checkdisk, main() ret_status(10000),g_sysconf_ptr->tf_status.stat(10000)
---update file(home_y21gam) Not exist---
/backup/init.sh: line 157: syntax error: unexpected end of file (expecting "fi")
root@(none):/# checkdisk.c(do_fat_check-121)[00:00:07.388]:retBuf(fsck.fat 3.0.2
6 (2014-03-07)
-/bin/sh: syntax error: unexpected word (expecting ")")
-/bin/sh: syntax error: unexpected ")"
root@(none):/# step 0 5
-/bin/sh: step: not found

init.sh is wrong.
I don't know why.
You have to restore mtdblock4 with the original one.
Read the wiki: https://github.com/roleoroleo/yi-hack-Allwinner-v2/wiki/Unbrick-the-cam

Unbricked camera, put your files back on, and its bricked again, so could be the size of the sd card, im using 32gb. So all i put on the sd card (root) is the release files, the 3 folders and init file.,Or the files within the zip, I have tried both scenerios, but still no good. Thank you, for your time, could i not just write a bin file to the start of memory address.

Maybe the init.sh file is in dos format?
Extract the sd card and check if the newline is dos format or linux format.
https://github.com/roleoroleo/yi-hack-Allwinner/issues/132#issuecomment-682039627

Your SD sould look like this:

Another question: are you able to login with telnet?

Yes i can login with telnet, im just gonna test your newline theory.

LF is at the end of my init.sh files.

Please, cat the file and post it.

Sorry cant telnet through wifi, only while its connected to ttl, the blue light comes on, then dies..

If your current status is different than this post https://github.com/roleoroleo/yi-hack-Allwinner-v2/issues/90#issuecomment-776024681 make another backup and send it to me.
I will check it.

Or maybe a power problem? Defective adapter?
Did you try to use another power adapter and another cable?

If you are connected through ttl, starts an ftp server and send me init.sh.

Thank you, i know im getting closer, i saw your script execute, and now it reads on the webpage.
ERROR
The requested URL could not be retrieved
The following error was encountered while trying to retrieve the URL: http://ip-cam:8080/
Unable to determine IP address from host name ip-cam
The DNS server returned:
Name Error: The domain name does not exist.
This means that the cache was not able to resolve the hostname presented in the URL. Check if the address is correct.
Your cache administrator is webmaster.
I changed the sdcard, so it was a card problem, thank you for your help.

Use the ip addess and not the name.
Example:
http://<IP_ADDRESS>:8080

Yes I did, but no good, camera just keeps crashing, we are close, but not there yet, I've tried 4 different sd cards, and 3 different power supplies, it only draws 0.10amps, and the unit does get hot. I will keep trying, thank you for your support. Keep up the excellent work, wished I had your knowledge.

I think your init.sh is corrupted.
Send me a copy of it.

Can you make any sense of this, the hack runs, then stop, with a write rror.
--------------------------insmod sensor--------------------------
[    3.915485] sunxi-mmc sdc1: smc 1 p1 err, cmd 8, RTO !!
[    5.902053] sunxi-gmac 5020000.eth eth0: Initialize hardware error
============================================= home low_half_init.sh... =========                                                          ================================
============================================= begin to start app... ============                                                          =============================
############## Starting Hack ##############
############## Starting Hack ##############
############## Starting Hack ##############
############## Starting Hack ##############
Hacking
Applying hack
Updating /backup/init.sh
cp: write error: No space left on device
chmod: /backup/init.sh: No space left on device
Updating /backup/tools/wifidhcp.sh
cp: can't open '/backup/tools/wifidhcp.sh': No space left on device
chmod: /backup/tools/wifidhcp.sh: No such file or directory
Disabling hack for next reboot
starting pid 649, tty '': '/etc/init.d/rcK'
mount: mounting /dev/mtdblock3 on /home failed: Resource busy
mount: mounting /dev/mtdblock4 on /backup failed: Resource busy
sh: you need to specify whom to kill
mount: mounting /dev/mtdblock3 on /home failed: Resource busy
mount: mounting /dev/mtdblock4 on /backup failed: Resource busy
sh: you need to specify whom to kill
killall: udevd: no process killed
starting pid 672, tty '': '/sbin/swapoff -a'
starting pid 673, tty '': '/bin/umount -a -r'
umount: devtmpfs busy - remounted read-only
The system is going down NOW!
Sent SIGTERM to all processes

Some files are in newbackup, and not backup.

backup partition is full.
It's a jffs2 filesystem with very little free space.
The only way is to restore the mtd4 partition.

That's how I'm unbricking it aswel, is there a way to extract the files or bins from firmware file.
Thank you.

If you have a backup you can extract files from images.
For squashfs (mtd2 and mtd3) use unsquashfs command.
For jffs2 (mtd4) use this script with a 64k erase size:
#!/bin/bash

## Script to mount jffs2 filesystem using mtd kernel modules.
## EMAC, Inc. 2009

if [[ $# -lt 2 ]]
then
    echo "Usage: $0 FSNAME.JFFS2 MOUNTPOINT [ERASEBLOCK_SIZE]"
    exit 1
fi

if [ "$(whoami)" != "root" ]
then
    echo "$0 must be run as root!"
    exit 1
fi

if [[ ! -e $1 ]]
then
    echo "$1 does not exist"
    exit 1
fi

if [[ ! -d $2 ]]
then
    echo "$2 is not a valid mount point"
    exit 1
fi

if [[ "$3" == "" ]]
then
<------>esize="128"
else
<------>esize="$3"
fi

# cleanup if necessary
umount /dev/mtdblock0 &>/dev/null
modprobe -r mtdram &>/dev/null
modprobe -r mtdblock &>/dev/null

modprobe mtdram total_size=32768 erase_size=$esize || exit 1
modprobe mtdblock || exit 1
dd if="$1" of=/dev/mtdblock0 || exit 1
mount -t jffs2 /dev/mtdblock0 $2 || exit 1

echo "Successfully mounted $1 on $2"
exit 0

Thats a bit over my head, how can i format or erase this mtd4 partition or get a copy of the original and replace with mine, my backup may be corrupted, but just enough to get me out of trouble, your unbricking code works a charm, I have now got the camera back to normal operation without your hack.
Thank you for your time.

Is it possible you can send a blank or non corrupt mtd4 partition please. Thank you.

mtd4.zip

You are the man, that got i working (in a fashion), i now get webpage up, ive changed to lowest settings, and i can stream, i enabled swap file, but then the camera crashes, but i will try try again. thank you so much for your help, how do i buy a coffee...

This can be closed.

You are the man, that got i working (in a fashion), i now get webpage up, ive changed to lowest settings, and i can stream, i enabled swap file, but then the camera crashes

With swap space enabled the cam shouldn't restart

how do i buy a coffee...

At the bottom of the page: https://github.com/roleoroleo/yi-hack-Allwinner-v2


IMGSRV: texmgmt.c:4039: IsTextureConsistent: IMGEGLImage is not consistent

The above exception occurs when you switch back from the current application to another application.

could you solve this problem?

same problem here

iam also having the same problem wen using the video_player plugin

iam also having the same problem wen using the video_player plugin

I have the same problem using the same plugin (video_player) .. how to you solved?


Expire comment by config value

I am not sure if using config values is the best way to achieve this, but I have the following uses cases where something like this would be very helpful:

We provide an application that is run and updated by third-parties. That software has certain code paths that need to run at least once, e.g. database migrations. Code paths can be removed once run everywhere.
We provide an API that has compatibility layers for older client versions. Once support is removed for those older versions, the compatibility layers can be removed too.
We integrate with self-hosted instances of various third-party APIs and have code paths to support older versions where certain API endpoints are missing or return data in a different format. We would like to remove those code branches once all instances have been upgraded.

I was thinking about a section in the PHPStan config like:
parameters:
    todo_by:
        values: # or something more helpful
            minimumApiClientVersion: 1.2

and then near the code path
// TODO: minimumApiClientVersion:2 This can be removed once all API consumers use client version 2.0 or higher

should be easy to implement.
I am also thinking about a good name because values is a very generic and multi purposed term.
maybe versionToggles could work?
the idea is to describe constraints, similar its done for packages in composer.json , right?

we are also working on a issue-tracker integration. that way you could manage your current planning state in the ticket and as soon as you close the ticket (or move it into one of the configured 'closed-states'), comments would invalidate.
the mentioned PR integrates jira, but for sure we could do the same for github issues or similar stuff.
would this work for you, too?

Yes, constraints similar to packages in composer.json would be perfect! versionToggles already sounds like a better name than the generic values.
I was thinking of a config file because the step to increase the constraints could be automated by running some command that then automatically creates a PR to adjust the config file. The PR would fail and force us to clean up the code paths.
Issue tracker integration could probably work too. The main downsides I see with that approach is that it requires API credentials to run and it does API requests during the PHPStan run which can fail and will slow down the PHPStan run. It also requires you to remember that an issue actually exists which might be a problem, considering that some of them take >1 year to resolve.

I guess I'd call it virtualPackages: or in Composer term we'd say provide: to declare additional package names with their versions :) But just my 2c, if you think it reads weird from your perspective you're probably right. I'm biased.

thx for the input. this makes me think whether we should have the composer name scheme applied for the packages and therefor do it like:
parameters:
    todo_by:
      virtualPackages:
        - 'apiClient/minimumVersion': '1.2'

meaning we would need a x/y notated package

Sounds like a great idea! Less code to maintain should make it easier for everyone.


Added quota tracker remote datatype with tests

Codecov Report

Merging #71 (e4bc76f) into dev (83ac75c) will increase coverage by 0.03%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##              dev      #71      +/-   ##
==========================================
+ Coverage   62.87%   62.90%   +0.03%
==========================================
  Files         115      116       +1
  Lines        9914     9928      +14
==========================================
+ Hits         6233     6245      +12
- Misses       3681     3683       +2

Impacted Files
Coverage Δ

...ssemblyline/remote/datatypes/user_quota_tracker.py
100.00% <100.00%> (ø)

assemblyline/odm/randomizer.py
94.81% <0.00%> (-0.95%)
:arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 83ac75c...e4bc76f. Read the comment docs.

Codecov Report

Merging #71 (e4bc76f) into dev (83ac75c) will increase coverage by 0.03%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##              dev      #71      +/-   ##
==========================================
+ Coverage   62.87%   62.90%   +0.03%
==========================================
  Files         115      116       +1
  Lines        9914     9928      +14
==========================================
+ Hits         6233     6245      +12
- Misses       3681     3683       +2

Impacted Files
Coverage Δ

...ssemblyline/remote/datatypes/user_quota_tracker.py
100.00% <100.00%> (ø)

assemblyline/odm/randomizer.py
94.81% <0.00%> (-0.95%)
:arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 83ac75c...e4bc76f. Read the comment docs.


fix build interface includes

Description
build interface includes was accidentally using
.../build/conda/cuda-12.5/release/autogenerated/include

instead of
.../build/conda/cuda-12.5/release/cpp/mrc/autogenerated/include

this PR fixes that, such when depending on mrc from down-stream libraries, the following error does not occur:
CMake Error in python/morpheus_llm/morpheus_llm/_lib/CMakeLists.txt:
  Imported target "mrc::pymrc" includes non-existent path

    "/home/coder/mrc/build/conda/cuda-12.5/release/autogenerated/include"

  in its INTERFACE_INCLUDE_DIRECTORIES.  Possible reasons include:

  * The path was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and references files it does not
  provide.

Checklist

[x] I am familiar with the Contributing Guidelines.
[x] New or existing tests cover these changes.
[x] The documentation is up to date with these changes.

/merge


Minor wordsmithing

Removed use of slang term 'tossed'
Added emphasis to "not" in reference to not cancelling pending I/O

@smaillet : Thanks for your contribution! The author(s) have been notified to review your proposed change.

Yes, don't know how that got in there! Thank you.


Decimation docs missing requirement

Documentation Is:

[X] Missing or needed?
[ ] Confusing
[ ] Not sure?

Please Explain in Detail...
After experimentation I found that decimation only works if the number of points on the chart is 4+ times the pixel width of the chart. You can see it here: https://codesandbox.io/s/react-17-forked-gt7qvw?file=/src/App.js. Resize the preview area and you'll see decimation kick in at widths below 500px.
This requirement isn't documented in list here: https://www.chartjs.org/docs/latest/configuration/decimation.html#requirements
I'm also not sure why this is a requirement. It makes sense for min-max decimation but when using lttb it doesn't seem necessary.
Your Proposal for Changes
It seems like this requirement should be documented here. Will create a PR for it.
Example
https://codesandbox.io/s/react-17-forked-gt7qvw?file=/src/App.js

Writing some documentation is good. The 4*width is just the default. If you set the threshold option of the plugin, it will use that instead.

Ah thanks, I missed that. Have created a PR to mention that in the decimation requirements here https://github.com/chartjs/Chart.js/pull/10516


When compiling with Nuitka I need to add it in Azure folder.

Hi, I need to add the Azure folder when compiling with Nuitka. At first, when my application opened, I made it add itself, but I could not get a result. What should I do?
The Nuitka Command I'm Using -->  python -m nuitka --mingw64 --windows-icon-from-ico=C:\Users\tcool\OneDrive\Masaüstü\AliceInc\Medya\1-DİJİTAL\ALİCE.ico --onefile --windows-company-name=AliceInc --windows-product-version=1.0 --plugin-enable=tk-inter Alice.py

In the template, I have made it clear, that not filling out the issue template is not acceptable. I am closing this kind of report as invalid. The main reason is that I do not want to be left guessing. For you it's easy to erase the issue template and expect me to ask you questions only as necessary, but I cannot do that. I would much rather wait for you to create a new report, fill out the template, or wait for somebody with the necessary skill to do it.


How to plot Figure 2 ?

Kindly provide some code references to fig. 2 or you may also publish your own code.

Thanks for the question, please check out https://github.com/mlfoundations/model-soups/issues/3


material:TextField and material:EditorField events not triggered

    I want to achieve the equivalent to the following for `material:TextField` and `material:EditorField`:

<Entry Text="Test">
    <Entry.Behaviors>
        <toolkit:EventToCommandBehavior Command="{Binding CmdToCallWhenUnfocusingEntry}" EventName="Unfocused" />
    </Entry.Behaviors>
</Entry>

i.e. I want to react to certain events like Focused, Unfocused, Completed etc. that exist for plain MAUI controls.
Obviously, the naive approach
<material:TextField Title="{resx:Localize ServerURL}" Text="{Binding UrlOfServer}">
    <material:TextField.Behaviors>
        <toolkit:EventToCommandBehavior Command="{Binding CheckUrlCommand}" EventName="Unfocused" />
        <toolkit:EventToCommandBehavior Command="{Binding CheckUrlCommand}" EventName="Completed" />
    </material:TextField.Behaviors>
</material:TextField>

does not work (I guess since InputField is inherited from Grid?)
Edit: I have checked the docs and only found validations, which are not doing quite what I want.
So if I want to do achieve this and not rely on an InputForm validation triggered by a separate button press, how would I go about it?
I know that everything regarding Behaviors for custom controls is not trivial (attached behaviors, etc.). Is there something missing in the implementation, or did I miss anything in the docs?
Edit 2: On further attempts, I noticed that for the following:

The ReturnCommand is called correctly, but this will only react to Enter on the soft keyboard, no other focus change.
Neither the TextChanged event (which is actually defined in material:TextField) nor the Unfocused event (inherited from VisualElement) or its corresponding EventToCommandBehavior will be triggered. Maybe this is not marshalled correctly to/from the underlying EntryView?

<material:TextField
   Title="{resx:Localize ServerURL}"
   ReturnCommand="{Binding EntryUnfocused}"
   Text="{Binding UrlOfServer}"
   TextChanged="TextField_Unfocused"
   Unfocused="TextField_Unfocused">
      <material:TextField.Behaviors>
         <toolkit:EventToCommandBehavior Command="{Binding EntryUnfocused}" EventName="Unfocused" />
      </material:TextField.Behaviors>
</material:TextField>

Originally posted by @Hottemax in https://github.com/enisn/UraniumUI/discussions/248

Ok, good I found this. Apparently we have a regression on Android only.
This exact behavior is happening for Net8, Maui toolkit 9.1 (!)
Maybe such toolkit is not supported yet, because this was working about a month ago.


Revert dependency updates to resolve conflict

Is this a duplicate of https://github.com/open-feature/open-feature-operator/issues/92 ?

duplicate


How to handle error, when captcha fails ?

Hello, I'd like to request guidance on handling errors that occur when the captcha fails. Currently, we lack a solution for addressing this issue.

+1 for the error
i would like to implement the invisible captcha but i need to handle the errors when captcha is failing or has a problems with fetching key / contacting domain

What would you like to do when the captcha fails? I'm assuming you are referring to when the user does not pass the captcha.

I am referring to both scenarios: 1) When we are using managed captcha & it fails and 2) When the user does not pass the captcha. I think in both these cases we should be able to handle errors. Personally, I want to reinitialize the captcha when it fails.

Hey @abhinavakhil, there's a recently-added event handler for error codes released in<EMAIL_ADDRESS>maybe that will be useful for you
To refresh the widget while handling the error codes, you can check this comment: https://github.com/verto-health/ngx-turnstile/issues/24#issuecomment-2016961475


⚠ Bofrost.fr has degraded performance

In 0b3ab36, Bofrost.fr (https://www.bofrost.fr) experienced degraded performance:

HTTP code: 200
Response time: 1207 ms

Resolved: Bofrost.fr performance has improved in 68ffba1 after 20 minutes.


Question: Is it possible to reference the "current" attribute value when overriding it?

Hi,
I've been using this gem for a couple years, so I think I know my way around, but this one has got me stumped. I know I can reference other attributes when setting some attribute, but what about referencing the "current" value of the field itself?
With JSON fields becoming more prominent, I have found the need to merge some default hash with additional options more prominent. Consider:
FactoryBot.define do
  factory :payload do
    transient do
      options { {} }
    end

    data { {default: "true"}.merge(options) }

    trait :custom do
       options { {default: "false"} }
    end
  end
end

Now I can do either:
create(:payload, :custom) or create(:payload, options: {default: "false"}), to get a "{default => "false"}" payload.
However, I can not do create(:payload, :custom, options: {additional: "yup"}) to get a {default: "false", additional: "yup"}} payload.
It would all be solved if I could access options to merge with the value e.g.:
FactoryBot.define do
  factory :payload do
    transient do
      options { {} }
    end

    data { {default: "true"}.merge(options) }

    trait :custom do
       options { options.merge(default: "false") } # options can not reference itself :(
    end
  end
end

Obviously, the example above causes an infinite loop and a stack error.
Is what I want possible? Maybe I am approaching this all wrong..

Is it possible from an after(:build) callback?

While after(:build) does provide a more flexible assignment alternative, the issue is not merging data with options, but options with more options.

You could use two different transient attributes for this:
FactoryBot.define do
  factory :payload do
    transient do
      default_options { { default: "true" } }
      options { {} }
    end

    data { default_options.merge(options) }

    trait :custom do
      default_options { {default: "false"} }
    end
  end
end

It makes sense that options { options.merge(default: "false") } wouldn't work. Internally this defines an options method on an evaluator object. When we call that method, it executes the block in the context of the evaluator object (using instance_eval). So options { options } ends up being a recursive call to the same method.


Pool skips requests

I fetch 1 URL, then add 10 more URLs to fetch. When I set concurrency to 1, all 10 are fetched. If I set concurrency to 2, 1 is not fetched. If I set concurrency to 3, 2 are not fetched. Not sure if this is random or not.
When set to 3, index 8 and 9 are not fetched, but 10 is. So I don't understand what is wrong?
This is my generator:

$generator = function () {
  while ($request = array_shift($this->requests)) {
    if (isset($request['page'])) {
      $key = 'page_' . $request['page'];
    } else {
      $key = 'listing_' . $request['listing'];
    }

    yield $key => new Request('GET', $request['url']);
  }
  echo "Exiting...\n";
  flush();
};
And my pool:

$pool = new Pool($this->client, $generator(), [
  'concurrency' => function() {
    return max(1, min(count($this->requests), 3));
  },
  'fulfilled' => function ($response, $index) {
      // new requests may be added to the $this->requests array here
  }
  //...
]);

$promise = $pool->promise();
$promise->wait();

@gayathriw did you find out why it is doing that or how to fix it? I'm having the same problem :/
It's very strange...


tpch q13 join order adjust

Proposed changes
tpch q13 join order is not good
The reason is the cost of broad cast is higher than cost of shuffle in cost model v1.
In broadcast, we do not known the number of receiver BEs, so we use the number of BEs in the system.
debug message adjust

in explain, print row count after filter
if join is not marked join, do not print marked join info

Issue Number: close #xxx
Problem summary
Describe your changes.
Checklist(Required)

[ ] Does it affect the original behavior
[ ] Has unit tests been added
[ ] Has document been added or modified
[ ] Does it need to update dependencies
[ ] Is this PR support rollback (If NO, please explain WHY)

Further comments
If this is a relatively large or complex change, kick off the discussion at<EMAIL_ADDRESS>by explaining why you chose the solution you did and what alternatives you considered, etc...

run buildall

run buildall

TeamCity pipeline, clickbench performance test result:
the sum of best hot time: 34.8 seconds
stream load tsv:          447 seconds loaded<PHONE_NUMBER>9 Bytes, about 159 MB/s
stream load json:         24 seconds loaded<PHONE_NUMBER> Bytes, about 93 MB/s
stream load orc:          73 seconds loaded<PHONE_NUMBER> Bytes, about 14 MB/s
stream load parquet:          31 seconds loaded 861443392 Bytes, about 26 MB/s
https://doris-community-test-1308700295.cos.ap-hongkong.myqcloud.com/tmp/20230322110304_clickbench_pr_118605.html

run buildall


settings: Add backend and UI for restricting setings by plan type.

Zulip supports restricting settings by Realm.plan_type. Currently some settings are already restricted (e.g. ability to upload a wide organization logo is restricted if plan_type == LIMITED), but we don't display this to the user in the settings UI.
We'll start by fixing this for wide organization logo.
There are a few parts to this

[x] Add two page_params variables
plan_includes_wide_organization_logo = not realm.plan_type == Realm.LIMITED
upgrade_text_for_wide_organization_logo = "Available on all paid plans. Upgrade"
[x] When plan_includes_wide_organization_logo is False, remove the upload buttons, and show upgrade_text_for_wide_organization_logo at the top of the section.
https://fontawesome.com/v4.7.0/icon/rocket is our icon for upgrading, and should appear before the upgrade text.

We should also make sure the events system does the right thing when the plan type is updated.

@zulipbot claim

For anyone wondering why we need to create new variables instead of just using page_params.realm_plan_type it's because handlebars, unlike Jinja or the Django template language, does not allow testing things like equality in its "if" conditional blocks (as of now anyhow). So we need a boolean variable to work with and hence the need for plan_includes_wide_organization_logo.
We could avoid using upgrade_text_for_wide_organization_logo by having the string directly reside in the frontend (and marking it for translation). What do you think @rishig?

The reason to have the string in the backend is that we're pretty soon going to have multiple paid plan types, and the string will depend on which plan type the feature is in (so the conditional for the string will also become too complicated for handlebars).

Ah, makes sense then to include upgrade_text_for_wide_organization_logo as well.

Resolved via #12554; @Hypro999 is there a reason you didn't include a Fixes: note in the commit message of the last commit?  If you don't do that, the issue isn't automatically closed.

@timabbott, sorry about that, I've been forgetting to do that lately it. I'll add that line from now onward.


Nested feature branch support for git-sync

@charlierudolph @allewun @ricmatsui
Shipping the parent branch for this branch automatically closed the PR on GitHub.
:-1: on ignorant half-automation that tries to be helpful while not fully understanding what's going on.
Here is the PR again.
implements parts of #529

This PR is outdated, a newer one has been opened.


claws mail ics import

Hi !
I use claws mail and i get my invitations with a mail !
the plugin i use is vCalendar -> i export the calendar automatically to this file claws-mail.ics
Is it possible to import claws-mail.ics in diary ?
thanks
regrads

Yes, it would be possible but it's not implemented yet. The CalDAV sync code already contains some utility functions to "parse" these kind of VEVENTS.
There is also a task on my list to handle multiple events returned from a CalDAV request. I suppose that is similar to parsing an ics file from disk.
https://github.com/in0rdr/diary/issues/75
So it would be possible, but not implemented yet, even though some code blocks might already exist.
Does this answer your question?
I will certainly consider this kind of functionality in the future (also export to ics file), thanks for bringing it up here.
On 19 Sep 2021, at 09:17, kristoferus75 @.***> wrote:

Hi !
I use claws mail and i get my invitations with a mail !
the plugin i use is vCalendar -> i export the calendar automatically to this file claws-mail.ics
Is it possible to import claws-mail.ics in diary ?
thanks
regrads
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.

Yes Thanks !


Resolve all warnings and remove -Werror exceptions

This fixes #460, fixes #479, fixes #462, fixes #459, fixes #483, fixes #467, fixes #470, fixes #481, fixes #477, fixes #465, fixes #466, fixes #469, fixes #472, fixes #474, and fixes #471.

Simplify fix for Linux C++ test build (#595).

This patch resolves a TODO item in commit 818ead2 (Fix Linux C++ test build).
It appears that the undefined symbol errors of the following form:

undefined reference to `boost::test_tools::tt_detail::print_log_value<decltype(nullptr)>::operator()(std::ostream&, decltype(nullptr))'

were due to the fact that GCC does not automatically emit such overloads unless
the relevant files are compiled with -std=c++11 or greater. (In this case, the
relevant files happen to be external Boost source files.) This patch adds the
-std=c++11 flag to the corresponding cmake build command, which allows us to
avoid defining the function overload ourselves.
See also:
https://svn.boost.org/trac10/ticket/12969

Fix transposed memset arguments.

A call to memset() in vector_internals had its arguments apparently transposed,
with the length argument coming second instead of third. This patch swaps the
arguments to the correct order.

Fix compiler warnings (division by zero).

When constructing floating-point infinity values, divide by floating-point zero
rather than integer zero, in order to avoid compiler warnings.

Fix missing return statements/unreachable code.

We also add a macro ASSERT_UNREACHABLE(), which is roughly equivalent to
"assert(false)" but is also able to leverage the existing error-reporting
and stack-trace machinery.

Fix function return type (broadcast_queue.hpp).

Fix signed/unsigned comparisons.

In some cases involving ordering comparisons, it is important to ensure that
the operands are within range of the signed type actually used to perform the
comparison. For this purpose, this patch adds a family of functions called
"truncate_check" to perform these range checks at runtime. (Of course, if we
can ensure statically that a given range check is satisfied, then we may
remove the invocation of truncate_check() and avoid the runtime overhead.)

Fix unused variables (#460, #479).

Fix strict-aliasing issues.

Use boost::filesystem for temporary paths (#462).

One of the C-API unit tests (capi_models.cxxtest) was attempting to write to a
path of the form "/var/tmpFILE" instead of "/var/tmp/FILE", which was causing
the test to fail due to permissions issues on Linux. This patch replaces the
temporary path with an implementation based on boost::filesystem.

We also switch to an auto-generated temporary path rather than a hard-coded
path in the capi_sframe unit test, in order to avoid errors if the current
user does not have permission to write the path in question.

Finally, we replace a use of the deprecated function tmpnam(), addressing a
compiler warning (#462).

Implement several new features in run_cpp_tests.py.

Make caching behavior optional, so that we can avoid hashing many large files
when this is not necessary.

Add an option to disable random shuffling of the individual tests (i.e., the
"--schedule-random" flag in ctest). This makes it much easier to compare
results across multiple runs.

Add an option to disable expensive tests (i.e., those that typically take
longer than a few seconds); this is useful to get a quick overall read on
correctness.

Display ctest output incrementally via subprocess.Popen, rather than saving it
all until the end of the run.

Address compiler warnings for protobuf includes.

Some auto-generated protobuf source files cause compiler warnings (e.g.,
-Wunused-function). Existing sources that include these files guard them with
clang pragmas to disable the warnings, but GCC does not recognize the
pragmas, causing additional compiler warnings. Instead, we tell CMake to add
GCC-specific flags to disable the warnings in the command-line invocations
for the relevant source files.

Fix deprecation warning for Boost header (template_arity_spec.hpp).

Prevent excessive debugging output from Boost build ("common.copy", "common.mkdir", etc.).

Fix CMake script to restrict C++-specific compiler flag to C++ source files.

Builds of external source files were triggering compiler warnings due to the
presence of the "-fvisibility-inlines-hidden" flag, which is only valid for C++
source (not plain C). This patch restricts this flag to C++ source files only.

Add missing cases in conditionals/switch-case blocks (#459, #483).

Fix order of operations (xor vs. equals).

Fix warnings regarding C++ comment syntax: avoid backslash and '/*' tokens (#467).

Fix minor format-string issues (#470).

snprintf() expects the format specifier "%lld" to refer to a value of type
"long long", not flex_int; we assert statically that flex_int is synonymous
with "long", and add a static cast.

Use of the null terminator "\0" in the format string for sscanf() elicits a
GCC compiler warning; we remove this character.

Fix unused variable in test/random/test_alias.cpp.

The variable "k" is assigned to, but not subsequently used, in the
run_alias_benchmark() function. Rather than remove it, we use it as a dummy
accumulator, in order to preserve the existing sequence of random number
generation calls.

Fix variable shadowing issue in sparse_similarity/item_processing.hpp.

The variable "row_idx", referring to an atomic counter shared between threads,
was incorrectly shadowed by another local variable of the same name. This patch
renames the outer-scope variable, and updates one of the corresponding
references in the inner scope.

Fix return type (void functions incorrectly marked as returning bool).

Fix potentially uninitialized values (#481).

Factor out utility function "ceil_divide" (also fixes -Wunused-function warnings).

Add missing braces in std::array initialization (#477).

Extra braces are required in C++11; see:
https://en.cppreference.com/w/cpp/container/array

Add missing virtual method override annotations.

Fix implicit conversion of constant (#465).

Fix boolean value returned from main() (#466).

Fix std::move invocations on temporary variables (#469).

We still make std::move calls in the case of the gl_string unit test, to
attempt to preserve the existing test semantics.

Fix potential side-effects in typeid() call (#472).

Fix abs() call to refer to intended operand instead of comparison result (#474).

Previously the code was testing "abs(stats.residual < 1e-5)" instead of
"abs(stats.residual) < 1e-5".

Add local directives to disable warnings on overloaded virtual methods (-Woverloaded-virtual).

In some cases, we have a base class method overridden by a derived class
method of the same name, but different type signature. This causes clang to
generate compiler warnings (-Woverloaded-virtual). Ideally, we would simply
rename the methods in the derived class, but this may require other API
changes. For now, we instead add preprocessor directives to prevent these
warnings at a few key sites.

Remove test of tc_ft_type_enum against NULL (#471).

Previously we ran CHECK_NOT_NULL on a value of type tc_ft_type_enum. This is
likely not intended, since this is not a pointer type, and in fact may have
incorrectly resulted in errors thrown upon receiving the value FT_TYPE_INTEGER
(= 0). This patch removes that check.

Fix uninitialized value in TF-IDF computation.

Disable -Wsign-compare warning for auto-generated Cython source files.

Disable some warnings for selected external source files (as well as CoreML-related internal files).

Fix uninitialized variable in unity_sframe.

Add #ifdef guards around compiler pragma directives to prevent GCC warnings.

Fix memory-clearing behavior in flexible_type.

In order to clear a flexible_type value, in addition to setting val.intval
(the first 8 bytes) and val.stored_type (the last 4 bytes), we must also set
val.dtval.m_microsecond (the middle 4 bytes). Previously, these 4 bytes may
have been uninitialized on some uses, causing GCC compiler warnings.

Add missing argument in image similarity GPU test case.

Explicitly specify Python version for virtualenv.

This seems to be necessary in some environments when both Python 2.x and
Python 3.x are installed on macOS.

Add missing API_AVAILABLE annotations for macOS.

This fixes several compiler warnings about specific APIs only being available
from macOS 10.13 (or 10.14) onwards.

Enable -Werror on Linux (and in release builds).

Remove global -Werror exceptions.

Sigh, for the record, everything in this PR was authored by Joe Zimmerman, but our GitHub settings forced a merge commit listing me as the author. Sorry, Joe!


⚠ Bofrost.es has degraded performance

In 7221fce, Bofrost.es (https://www.bofrost.es) experienced degraded performance:

HTTP code: 200
Response time: 1437 ms

Resolved: Bofrost.es performance has improved in 121fc2c after 305 days, 8 hours, 55 minutes.


Automate deployment.

Every push to master should automatically deploy a new release to GitHub.
This can be done on CircleCI.
It would be good to run it by Jessy before implementing.

What would the script do?

Bump the minor version
Build the application
Create a GitHub release

We can use a tool for releasing: https://github.com/remixz/publish-release
We can use the CI to trigger the tool

But we would not compare hashes

We did an auto-bump in an old project: it would always bump the minor
version. If we want to do a major bump, we just bump the major bump the
major version. The only downside would be no x.x.0 version.
David Braun<EMAIL_ADDRESS>schrieb am Mi., 23. Mai 2018, 20:24:

What would the script do?

Bump the minor version

No, we would do that so that we have control over SemVer semantics.

Build the application

Yes.

Create a GitHub release

Yes.
We can use a tool for releasing: https://github.com/remixz/publish-release
We can use the CI to trigger the tool
Nice find!
But we would not compare hashes
Correct, because the CI build would be canonical.
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
https://github.com/cosmos/voyager/issues/709#issuecomment-391449762, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AFmO2V-4KKvRxIsIfwLMcwViDEqrk02jks5t1allgaJpZM4UCLM8
.

I think 0.7.1 instead of 0.7.0 would be weird, likewise with a missing 1.0.0. It's not conventional and doesn't follow SemVer correctly.
However, if we don't autobump the version, we would have to manually bump the version with every pull request. Similar to what we're doing with the changelog. Is that right? I support going with this.

Note: We need a bot that is able to commit to master and to create a release.

sounds like we can figure out a way to automate builds AND use semver which would be ideal.
regarding comparing hashes, this should also be automatable but can be left for v2 of automated builds.

Note: We need to update the changelog with the new version number

I think 0.7.1 instead of 0.7.0 would be weird, likewise with a missing 1.0.0. It's not conventional and doesn't follow SemVer correctly.

I agree, I think we should comply with SemVer.

However, if we don't autobump the version, we would have to manually bump the version with every pull request.

No, we would bump the version only once per release, not on every PR.
There is no need to change how we increment the version number from how we're doing it today.  That process can stay the same.

Note: We need a bot that is able to commit to master and to create a release.

Not quite:  The bot would watch for a commit to master and then it would create the release.  Our pushing a commit to master will be our signal that we're ready to make a release.
We want to automate the process of releasing but not the act of releasing.  We could get away with that if we weren't publishing security-sensitive software but because Voyager is so security sensitive we want to always keep our hand on the release lever.
Regarding the comparing of hashes, I've given it some more thought.  The question in my mind is "why are we comparing hashes?".  If it's because we think our build process is buggy or nondeterministic, then let's automate it and fix it until it works.  If we're comparing hashes because we don't trust the build machine not to be compromised then it could be a good idea to have redundant builds in heterogenous environments to reduce the risk.  This hazard is explained well in Deterministic Builds Part One: Cyberwar and Global Compromise.
Perhaps we want to go further than this and think of a blockchain-oriented solution, e.g., have every validator build the code as well and compare hashes as part of the Cosmos protocol.

Everything not automated has potential to be forgotten.

Note: We need a bot that is able to commit to master and to create a release.

The push to master should be the only action we need to do to release. Everything else should be automated. Therefor the bot updates the version and publishes the release so nobody of us has to do this manually.

"why are we comparing hashes?". If it's because we think our build process is buggy or nondeterministic

Yes ;) And until we know that it is deterministic, we should check the hashes.

redundant builds in heterogenous environments

That is a good idea that was discussed several times already. Let's do this. But later when there is more time.

have every validator build the code

Great idea. But validators probably don't want to be compromised like that. Full-nodes could do it though.

The push to master should be the only action we need to do to release. Everything else should be automated. Therefor the bot updates the version and publishes the release so nobody of us has to do this manually.

OK.  How are we going to tell the bot which version number to use, or do you want to break compliance with SemVer?

I don't mind having no x.x.0. It is still semantic if it starts with
version x.x.1.
Do update the minor version. We would just push a commit changing the
version to x.(x+1).0. the bot then increments the version to x.(x+1).1.
David Braun<EMAIL_ADDRESS>schrieb am Do., 24. Mai 2018, 19:19:

The push to master should be the only action we need to do to release.
Everything else should be automated. Therefor the bot updates the version
and publishes the release so nobody of us has to do this manually.
OK. How are we going to tell the bot which version number to use, or do
you want to break compliance with SemVer?
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
https://github.com/cosmos/voyager/issues/709#issuecomment-391793053, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AFmO2RPFJZ45eziINb2yq0nZSEhr5cFHks5t1uuQgaJpZM4UCLM8
.

Well, not exactly:

Patch version Z (x.y.Z | x > 0) MUST be incremented if only backwards compatible bug fixes are introduced. A bug fix is defined as an internal change that fixes incorrect behavior.

We would be signaling a bug fix even if there isn't one.

Version 1.0.0 defines the public API.

We would't be able to define the public API by publishing Version 1.0.0.

I would offer myself to release 1.0.0 by hand. :)
David Braun<EMAIL_ADDRESS>schrieb am Do., 24. Mai 2018, 23:12:

Well, not exactly:
Patch version Z (x.y.Z | x > 0) MUST be incremented if only backwards
compatible bug fixes are introduced. A bug fix is defined as an internal
change that fixes incorrect behavior.
We would be signaling a bug fix even if there isn't one.
Version 1.0.0 defines the public API.
We would't be able to define the public API by publishing Version 1.0.0.
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
https://github.com/cosmos/voyager/issues/709#issuecomment-391864309, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AFmO2WR4WYoJHZEEiJW8HG5IjoNQ5oBFks5t1yJWgaJpZM4UCLM8
.

Let me talk to my people, we'll sort it out.

How's this going, @jessysaurusrex ?


[docs] Minor changes  in three docs.

What type of PR is this?
/kind documentation
What this PR does / why we need it:
Minor changes about grammar in three docs.
Does this PR introduce a user-facing change?:
NONE

/auto-cc @Iceber

/lgtm