text:
What does this function?

@tezc
sc_map_remap_
???
What is the better way update memory usage after many attemtps with deliting and adding keys and values?
This time i try to use this sheme
sc_map_init_64s(&tmp, 0, 0);
            sc_map_foreach (&map, key, value){
                sc_map_put_64s(&tmp, key, value);
            }
            sc_map_term_64s(&map);
            sc_map_init_64s(&map, 0, 0);
            sc_map_foreach (&tmp, key, value){
                sc_map_put_64s(&map, key, value);
            }
            sc_map_term_64s(&tmp);

but maby exists better way?

@tezc
where can i get load_factor of current array? Or do i see in a wrong direction? =)

@MadDogMayCry0
load_factor determines when to expand the underlying array. If you pass zero to it, it gets the default value which is 75. So, if %75 of the underlying array is used, array doubles its capacity. Map doesn't expose current load factor but this is C, you can access map's variables and just print it like this:
struct sc_map_str map;

sc_map_init_str(&map, 0, 0);

sc_map_put_str(&map, "jack", "chicago");
sc_map_put_str(&map, "jane", "new york");
sc_map_put_str(&map, "janie", "atlanta");

printf("load factor :%f \n", (double) map.size / (double) map.cap);

Yea, i want to a litle bit optimising an array after that, to speed up "foreach" :)

Are you sure this is a bottleneck? You may actually hurt performance by shrinking it. Shrinking takes some time and when you load data back, it needs to expand again, shrinking and expanding might consume more CPU cycles than just iterating on an array sequentially. So, just fyi, most softwares are okay without shrinking. People often want shrinking data structures to save some memory.

Yea, i want to a litle bit optimising an array after that, to speed up "foreach" :)

Are you sure this is a bottleneck?

I try to use it on ESP32 Microcontroller, and it's not the rest to optimizing something. I doing this only when array returns me 0 items inside of it, only then.
 if(sc_map_size_64s(&map) == 0){
            //Refresh tree
            sc_map_term_64s(&map);
            sc_map_init_64s(&map, 0, 0);
        }

Ah okay I see, probably this is important in microcontroller world. I'll take a look later today, we can add auto shrinking without too much change anyway.

@tezc
Hello! No any news?

@MadDogMayCry0 Sorry, couldn't finalize this. Looks like auto shrink brings some complexity and some performance overhead. (This hashmap is being used in a very performance sensitive apps). So, I need to take another look, hopefully this weekend.
Meanwhile, I thought maybe we add another function sc_map_shrink_xx(), like sc_map_shrink_64s(). It will shrink the underlying array if possible. So, users are supposed to call this function whenever they want, possibly after each map operation. Implementation is here: https://github.com/tezc/sc/pull/81
So, situation is:

I'd like to make shrinking automatic if I can find a way to do it without introducing complexity & performance overhead.
Otherwise, I'll merge shrink() function in that PR. Need to go over it again and add some more tests probably.

Meanwhile, maybe you can try that version in the PR. Is it good enough for your use case? This is the branch: https://github.com/tezc/sc/tree/map-shrink/map

@tezc
Hello.
Please tell me, how can I understand how many bytes I can put in a hash table, for example, with 100kb of RAM?
Now i do counting the string that i put, but but always i get 3000 records...
I'm using a function that shows me the out of bounds, but I need to know how much more data i have before left. Thank you.

@tezc
UPD.
Ohh.. i found the problem..
i have to use const char* ptr to put some values and keys in to hash, but then i have a problem yet :(
i put chars from user input like so
char tel[24];
char msg[256];
input_read(tel,msg);
sc_map_put_64s(&map, i,tel);
sc_map_put_64s(&arr, i,msg);
i++;
and after
uint32_t key;
const char *val;
sc_map_foreach (&arr, key, val) {
printf("%d %s\r\n",key,val);
}
i have clones from last each input. For example 3 inputs and the last one was "sdjahf lkjsahdflkjhsadlfkjhsalkjd"
0 sdjahf lkjsahdflkjhsadlfkjhsalkjd
1 sdjahf lkjsahdflkjhsadlfkjhsalkjd
2 sdjahf lkjsahdflkjhsadlfkjhsalkjd
when i put input to const char * ptr;
const char * ptr = malloc(strlen(msg)+1);
strcpy(ptr,msg);
sc_map_put_64s(&arr, ii,ptr);
but now i got memory leak.
Pls help to lua user :)

UPD.
My understanding to C is absolute bad. What i got.
const char **ptr[1024]={0};
char msg[128];
usr_input(msg,128);
ptr[i] = (char*)malloc(strlen(msg)+1);
strcpy(ptr[i],msg);
sc_map_put_64s(&map, i, ptr[i]);

and when i delete the element from SC i can free PTR
value = sc_map_del_64s(&map, i);
free(ptr[i]);

Do i right or is there a right way?

Hi @MadDogMayCry0
Yes, looks like you were using stack allocated values and that was causing problems. Last snippet looks okay. I'd just check two things:
1- When you put a key into the map, if you are overwriting the value, you should free it as well.
2- When you delete a key, if key does not exist, probably you should not call free(ptr[i])
See the if checks below:
const char **ptr[1024]={0};
char msg[128];
usr_input(msg,128);
ptr[i] = (char*)malloc(strlen(msg)+1);
strcpy(ptr[i],msg);
prev_value = sc_map_put_64s(&map, i, ptr[i]);
if (sc_map_found(&map)) {
    free(prev_value);
}

value = sc_map_del_64s(&map, i);
// Free the memory only if key `i` exists.
if (sc_map_found(&map)) {
    free(ptr[i]);
}

I don't know what you are trying to do but maybe you don't need ptr array at all:
char msg[128];
usr_input(msg,128);

char *value = malloc(strlen(msg) + 1);
strcpy(value, msg);

char *prev_value = sc_map_put_64s(&map, i, value);
if (sc_map_found(&map)) {
   // We are overwriting the key, free the value.
    free(prev_value);
}

// -----------------------------
char *value = sc_map_del_64s(&map, i);
// Free the memory only if key `i` exists.
if (sc_map_found(&map)) {
    free(value);
}

@tezc
Thx for answer above, it's works like a charm! Now I have infinite dark power in my hands (offscreen evil laughter).
But one more question.
I need function that can put values to specific MAP's.
I tryed to implement something like this:
void map_put(sc_map_64s *map,int key,char *val){
    char *ptr = (char*)malloc(strlen(val)+1);
    strcpy(ptr,val);
    char * value = (char*)sc_map_put_64s(&map, key, ptr);
    if (sc_map_found(&map)){
        free(value);
    }
}

but i get error
../main/app.c:66:14: error: unknown type name 'sc_map_64s'; did you mean 'sc_map_oom'?
 void map_put(sc_map_64s *map,int key,char *val){
              ^~~~~~~~~~
              sc_map_oom

Pls help :)

void map_put(struct sc_map_64s *map, int key, char *val)
{
    char *ptr = malloc(strlen(val) + 1);
    strcpy(ptr, val);

    char *value = (char *) sc_map_put_64s(map, key, ptr);
    if (sc_map_found(map)) {
        free(value);
    }
}

@MadDogMayCry0 You forgot struct keyword in the function parameter. Try this snippet above.

@tezc
Hello!
Pls, how can i break foreach?
sc_map_foreach(&port_list, key, val) {
    break;
}

did'nt works.

@MadDogMayCry0 Oops, this is a bug :/ I see all our use cases either use return, goto or we iterate all the values so, we didn't realize it.
Options:
1- return statement will work:
const char *getFirstValue()
{
    const char* key, val;

    sc_map_foreach(&port_list, key, val) {
        return val;
    }
    return NULL;
}

2- goto will work:
const char *getFirstValue()
{
    const char* key, val;

    sc_map_foreach(&port_list, key, val) {
        goto found;
    }

found:
    return val;
}

3- I just wrote this fix but couldn't try it thoroughly(not sure if I broke anything else), maybe you can replace sc_map_foreach() with this one and try the fix:
#define sc_map_foreach(map, K, V)                                              \
	for (int64_t __i = -1, __b = 0; !__b && __i < (map)->cap; __i++)       \
		for ((V) = (map)->mem[__i].value, (K) = (map)->mem[__i].key,   \
		    __b = 1;                                                   \
		     __b && ((__i == -1 && (map)->used) || (K) != 0) ? 1 : (__b = 0); __b = 0)

I'll take a look at this issue whenever I have some spare time. Until then, these workarounds should work. (sc_map_foreach(), sc_map_foreach_key(), sc_map_foreach_value(), all sufffer from this issue and needs to be fixed).
Regarding, random element, it'd actually do same thing with the for each loop, so, if you wrap it similar to above, you can get a random element. Btw, just be sure map is the data structure you want. If you want to just get a random element, you can try a queue or array as well. You can find these data structures in this repo. Just fyi.

@tezc
return rocks all i need. Thank You!

repo: tezc/sc


text:
About Homebrew Formula Ownership

Guys,
I've stared this discussion at the Homebrew project about possibility transfer ownership of the TGEnv for us.

I will keep this issue open for us and planning to following like the @iokiwi wrote in the discussion there.

I realise I'm not adding anything but even the tgenv shipped with homebrew is out of date in both this repo and the original repo at https://github.com/cunymatthieu/tgenv/
Would be super helpful to have this transferred and published at homebrew

Reading the comment on the discussion - did you ever publish to tgenv/tgenv - seems not?
brew install tgenv/tgenv
Warning: No available formula with the name "tgenv/tgenv".

Reading the comment on the discussion - did you ever publish to tgenv/tgenv - seems not?
brew install tgenv/tgenv
Warning: No available formula with the name "tgenv/tgenv".

Exactly @gtmtech, the available homebrew formula is not the one of our project. Recommend using the installation methods we have in the README.md.

Hey weyderfs. I'm going to have another go at moving this along. I'm not sure what homebrews policy is but enough time has passed and we have made reasonable attempts so I think we should be able to get support from the homebrew team

source: gharchive/issue

authors: gtmtech iokiwi weyderfs

repo: tgenv/tgenv

license: MIT

license_type: permissive

license_source: github-api


text:
ThalinotificatioServer for review

Hi @juhanak, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!

In order for us to evaluate and accept your PR, we ask that you sign a contribution license agreement. It's all electronic and will take just minutes. I promise there's no faxing. https://cla.microsoft.com.

TTYL, MSBOT;

The first thing to check when you do a PR is if you passed appveyor (and hopefully starting next week, also if you passed CI). In this case you didn't. The tests failed on one of your tests. I didn't see any useful error information. However the test failed while running 'jx npm run test-coordinated' which you can also run on your desktop. Just see the README.md in the test file for directions.

Reviewed 3 of 3 files at r1.
Review status: all files reviewed at latest revision, 30 unresolved discussions, some commit checks failed.

test/www/jxcore/bv_tests/testThaliNotificationServer.js, line 1 [r1] (raw file):
Please make sure to run JSHint and JSCS validation. It would have told you, for example, that this file isn't using 'use strict';.

test/www/jxcore/bv_tests/testThaliNotificationServer.js, line 2 [r1] (raw file):
There should be an additional test where we try to hit the beacon endpoint before we call start on thaliNotificationServer. This should give us a 401. It proves that we don't register the route until start is called.
Also the tests below that call start with various legal values should all be extended to then call stop and do a beacon request and prove that they got the proper empty response.
There should also be at least one test where you actually check the beacon value you got back from the HTTP server and prove that it matches the beacon value you got when you generated the beacons with the beacon library.

test/www/jxcore/bv_tests/testThaliNotificationServer.js, line 16 [r1] (raw file):
Over the years I've learned that sometimes 'localhost' (the DNS name) gets bound to strange places. I've learned to directly use 127.0.0.1. It seems to work better in practice.

test/www/jxcore/bv_tests/testThaliNotificationServer.js, line 33 [r1] (raw file):
Why isn't this variable set in the object above? There is no semantic difference between globalVariables.ThaliNotificationServerProxyrquired = ... and including in the previous , ThaliNotificationServerProxyquired : proxyquireThaliNotificationServer()

test/www/jxcore/bv_tests/testThaliNotificationServer.js, line 43 [r1] (raw file):
Close is not a synchronous function. It takes a callback that is called when the server is actually closed. Until you get that callback the port is still held onto. For your sanity I would make this function return a promise and then turn the callback into a promise resolve()/reject() based on the callback's result. Keep in mind that the callback will have a first argument that will be null if everything is fine and non-null if there is an error.
Also keep in mind that if the server you create doesn't close all of its incoming connections (which is NOT automatically handled by the close method) then the callback will never return and the test will hang. I would suggest that your test server use the makeIntoCloseAllServer function from Thali and use its closeAll method.

test/www/jxcore/bv_tests/testThaliNotificationServer.js, line 106 [r1] (raw file):
Every single test starts with initializeThaliNotificationServer which makes sense but then shouldn't it just be in setup?

test/www/jxcore/bv_tests/testThaliNotificationServer.js, line 109 [r1] (raw file):
Content free tests (e.g. this test always passes) are seriously distracting when going through our already enormous debug logs. So please remove them. They should only be needed while debugging and you can use the thalilogger for that with logger.debug statements.

test/www/jxcore/bv_tests/testThaliNotificationServer.js, line 111 [r1] (raw file):
What is the above statement supposed to do? It isn't an assignment. It isn't a function call. What is it? Note that one of the reasons I use IntelliJ is because it has awesome built in Javascript linting code that detects stuff like this automatically.

test/www/jxcore/bv_tests/testThaliNotificationServer.js, line 112 [r1] (raw file):
This needs to be rewritten as t.ok(globalVariables.spyStartUpdateAdvertising...., 'StartUpdateAdvertisingAndListening is called twice); Again, please, don't use tests as your log.

test/www/jxcore/bv_tests/testThaliNotificationServer.js, line 137 [r1] (raw file):
This is technically right but is it really useful? I think we can remove it.

test/www/jxcore/bv_tests/testThaliNotificationServer.js, line 156 [r1] (raw file):
As soon as I ran 'jx npm run test-coordinated' I got an EADDRINUSE error on this test.

test/www/jxcore/bv_tests/testThaliNotificationServer.js, line 161 [r1] (raw file):
Wouldn't it be simpler to get rid of the if/else and instead just say
t.equal(error, null, 'no error');
t.equal(response.statusCode, 200, '200 error code');
?

test/www/jxcore/bv_tests/testThaliNotificationServer.js, line 175 [r1] (raw file):
This approach to testing makes me a bit queasy. What I would rather see us do is that as part of setting up each test we take the router object that we will pass to thaliNotificationServer and before the test begins we automatically stick it into an app host listening on a port. At worst we will just tear it down when the test ends. No big deal. But the point is that by doing it this way we show that we set the right value on the right router object. That there wasn't a copy error or something weird going on. With the test the way it is currently written we could have somehow create another router object and we wouldn't know.

test/www/jxcore/bv_tests/testThaliNotificationServer.js, line 189 [r1] (raw file):
Again, per above, it's cleaner to write t.equal(error, null, 'no error'); and t.equal(response.statusCode, 204, '204 status code); and be done. No if, no else, no pass and no fail.

test/www/jxcore/bv_tests/testThaliNotificationServer.js, line 216 [r1] (raw file):
This test is super duper fragile and probably will fail in really annoying ways. The reason for that is because when we run Node.js under constrained conditions (e.g. in a mobile device, in AppVeyor, etc.) the timers all get really crazy. I've seen 10 ms setTimeouts that didn't run for 4000 ms! So unfortunately you can't rely on the timers running when you think they will.
However there is a work around that I think is particularly useful in our case because the logic here is very simple and straight forward, in sinon there is a feature called Fake timers. It allows you to take over setTimeout and other objects and it lets you manually set the system time. So you can exactly control how far the clock moves forward every time one of your delayed requests runs. Using that will give you much more reliable test results. Just make sure to create a global variable called clock that is initialized to null. ONLY set that variable in this test and make sure the teardown code tests if clock isn't null and if so calls restore.
Of course if you agree to my proposal to get rid of the throttling then this test just goes away. :)

test/www/jxcore/bv_tests/testThaliNotificationServer.js, line 227 [r1] (raw file):
Why is there a t.end() both here and above? Why not just put a t.end() at the bottom of this function?

test/www/jxcore/lib/httpTester.js, line 17 [r1] (raw file):
This is a JSCS violation. Please run JSCS validation. Oh and as in my previous comment, JSHint isn't being enforced here either. This would have told you things like you don't need promiseQueue above.

thali/NextGeneration/notification/thaliNotificationServer.js, line 29 [r1] (raw file):
(NB means "Non Blocking", which means you can resolve this comment anyway you want, it shouldn't, on its own, prevent a checkin)
NB: You can replace these with assert tests. It's easier. E.g. assert(router !== null, "router must not be null");

thali/NextGeneration/notification/thaliNotificationServer.js, line 68 [r1] (raw file):
10? Wow... that seems really slow. Shouldn't we at least support say 100 requests/second? Especially when we are on WiFi that is quite reasonable.

thali/NextGeneration/notification/thaliNotificationServer.js, line 97 [r1] (raw file):
I made a change to replication that i'd like to also make here. I specify publicKeystoNotify as {buffer[]} and I don't make the argument optional (e.g. remove the brackets). This means that the value submitted MUST always be an array. It can be empty but it must be an array. This simplified a lot of checks and use cases for me in the replication code (for example I could always use array operations against publicKeystoNotify because I always knew it was an array, even if empty).

thali/NextGeneration/notification/thaliNotificationServer.js, line 115 [r1] (raw file):
So please accept empty arrays as that effectively becomes our new null so the check above would be assert(publicKeysToNotify !== null && publicKeysToNotify instanceof Array, "publicKeysToNotify must be an array");. Followed by a check for if (publicKeysToNotify.length === 0) { self.preambleAndBeacons = null } and then the rest of your logic here.

thali/NextGeneration/notification/thaliNotificationServer.js, line 147 [r1] (raw file):
I don't think you need to check self._firstStartCall. The reason is that if this really is the first call then previousPreambleAndBeacons will be null because we initialize self._preambleAndBeacons to null in the constructor.
Also removing self._firstStartCall has another nice side effect which is that you can stick "self._firstStartCall = false" (since you will have registered the notification path) which makes the code simpler. It means the if check for self._firstStartCall below can be removed.

thali/NextGeneration/notification/thaliNotificationServer.js, line 177 [r1] (raw file):
Think about this... someone is calling stop and they are now being ask to call start somewhere else? That sounds... weird. There are two fixes here.
An obvious fix is that we could put in logic below to catch a 'Call Start!' error and swallow it. But I might suggest this isn't a great idea because error handling in Javascript is, at best, an inexact art where a single change of a string can ruin a bunch of code. There are tricks using sub-typing in Javascript to make for more robust error handling but they require a level of ceremony that is inconsistent with javascript's natural approach.
Which brings us to option 2. Why don't you set self._preambleAndBeacons to null and call ThaliMobile.stopAdvertisingAndListening()?
Now, you're probably thinking "Wait a minute, didn't YOU tell ME to make this into a call to start with a null argument?" And the answer is, yes, I did. And I was wrong. Beings wrong is a habit I haven't been able to break. :(

thali/NextGeneration/notification/thaliNotificationServer.js, line 182 [r1] (raw file):
Depending on what you do with my previous comment on how I specified this wrong this would at the least turn into this.start([]). But hopefully we'll get rid of this line all together.

thali/NextGeneration/notification/thaliNotificationServer.js, line 218 [r1] (raw file):
Why is this here? No one seems to check it and I can't immediately come up with a good reason for it.

thali/NextGeneration/notification/thaliNotificationServer.js, line 227 [r1] (raw file):
Ask yourself a question.... why would any sane person want to use Javascript to write code? O.k. sure, if you are in a browser, you have no choice. But what about server side logic like Thali? No one with more than a few brain cells would want to use Javascript! Except... you see... there is this magical source of problem solving called NPM and NPM is super powerful. For example, in literally 10 seconds of querying I found three different libraries that will implement rate limiting on Express servers in NPM.  And keep in mind that if you widen the search to rate limiting Node.js servers you get an ocean of projects. So why would we write our own? But oh well, too late now.
But see my proposal below to rip all this code out.

thali/NextGeneration/notification/thaliNotificationServer.js, line 239 [r1] (raw file):
The current window size of 5 seems a bit small as it means a temporary bump will cause us to fail out. I would probably use at least say 100.

thali/NextGeneration/notification/thaliNotificationServer.js, line 240 [r1] (raw file):
I do wonder if shift is the wisest choice. It's certainly the simplest but I wonder what happens under really heavy load? The GC in Javascript has a tendency to explode under load. It's probably safer to allow a fixed array of WINDOW_SIZE and then use a wrap around index to decide where the oldest value is and where to put the newest value. But you can file that as a bug and stick it in icebox. Please mark it with the security label. But I don't think we need to fix it now and I'm not 100% sure it's actually an issue. We would have to run a load test where we did an enormous number of push/shifts and see what the GC does. Again, not worth worrying about right now. (Note that if you accept my proposal below to get rid of rate limiting then we don't need to file any bug on this since the code will go away)

thali/NextGeneration/notification/thaliNotificationServer.js, line 243 [r1] (raw file):
Please run JSHint. This file has at least 5 different JSHint rule violations. One of which is above. Note, btw, that the VSCode JSHint extension doesn't seem to work with our project.

thali/NextGeneration/notification/thaliNotificationServer.js, line 245 [r1] (raw file):
Ask yourself, what is the point of rate limiting? Wouldn't it be cheaper to just return the bloody string than do all this window calculating on each request? Not to mention memory manipulations with the array? The point is to protect the device from load but not returning the string isn't going to achieve that. Once we are over our rate we need to shut everything down! We are under attack and we don't want our battery destroyed and our other connections starved out. So at a minimum we need to call stop on advertising via thaliMobile! We then need to set a timer for some reasonable period of time and only start up again after that timer. For bonus points we should also hook network change events and maybe reset our timer earlier if we see that the network has changed. But, a persistent attacker will already know our address and use it to attack us so it's not enough to just shut down advertising, we have to also shut down listening as well! And we need to coordinate all of this with the layers above us so they understand that we are in an emergency situation!!!!!!
All of which is nuts. So, here is my proposal. What say we:

Rip out the rate limiting code.
Open a bug that we need to write a handbook on things to do to secure Thali and include in there that one really should use one of the rate limiting libraries and hook the rate exceeded notification (some of them have that) to shut everything down for some period of time and then restart later. We should then put this bug into the icebox because we aren't going to worry about it for March.

What say you?

Comments from the review on Reviewable.io

@juhanak and also make sure that before you make any changes you sync again with vNext. This should become compulsive on whatever branch you are on so you know you always have the latest. And please don't assign the bug to me back to review your responses until you have this passing in AppVeyor. Thanks!

Review status: 0 of 3 files reviewed at latest revision, 30 unresolved discussions.

test/www/jxcore/bv_tests/testThaliNotificationServer.js, line 1 [r1] (raw file):
I think my jshint  was old and VSCode JSHint addon was using it because it was showing just few validation errors like lines that exceed 80 character max limit. Now I can see all errors and will fix them..

test/www/jxcore/bv_tests/testThaliNotificationServer.js, line 2 [r1] (raw file):
here should be an additional test where we try to hit the beacon endpoint before we call start on thaliNotificationServer. This should give us a 401. It proves that we don't register the route until start is called.
-Added test: Make an HTTP request to /NotificationBeacons before calling start
Also the tests below that call start with various legal values should all be extended to then call stop and do a beacon request and prove that they got the proper empty response.
-Changed test: Pass an empty array to ThaliNotificationServer.start
-Changed test: Make an HTTP request to /NotificationBeacons
There should also be at least one test where you actually check the beacon value you got back from the HTTP server and prove that it matches the beacon value you got when you generated the beacons with the beacon library.
-Changed test: "Make an HTTP request to /NotificationBeacons" to check the response.

test/www/jxcore/bv_tests/testThaliNotificationServer.js, line 16 [r1] (raw file):
Ok. Changed localhost to 127.0.0.1.

test/www/jxcore/bv_tests/testThaliNotificationServer.js, line 33 [r1] (raw file):
My stupid architecture was the reason. Internally function proxyquireThaliNotificationServer() changed the content of the globalVariables so I couldn't call the function when initializing globalVariables.
I changed the structure quite a lot. Now there is GlobalVariables class and all initialization of the generic parameters happens in its constructor or init function which I think is way more cleaner solution.

test/www/jxcore/bv_tests/testThaliNotificationServer.js, line 43 [r1] (raw file):
Good observation. I changed it to use Promise and closing happens with makeIntoCloseAllServer.closeAll. New implementation is in the GlobalVariables.prototype.kill function. Also listen method seems to be async so I changed it to use async pattern too.

test/www/jxcore/bv_tests/testThaliNotificationServer.js, line 106 [r1] (raw file):
I wanted to leave it there if I need to initialize ThaliNotificationServer differently. However there seems to be no need for this so it is now part of Init-functionality.

test/www/jxcore/bv_tests/testThaliNotificationServer.js, line 109 [r1] (raw file):
Fixed. All test which are true by default changed to real tests like "t.equal(error, null, 'no error');"

test/www/jxcore/bv_tests/testThaliNotificationServer.js, line 111 [r1] (raw file):
ups.. removed

test/www/jxcore/bv_tests/testThaliNotificationServer.js, line 112 [r1] (raw file):
Fixed.

test/www/jxcore/bv_tests/testThaliNotificationServer.js, line 137 [r1] (raw file):
Ok. It's gone now. But I added a test that ensures globalVariables.spyStartUpdateAdvertisingAndListening.callCount is correct.

test/www/jxcore/bv_tests/testThaliNotificationServer.js, line 156 [r1] (raw file):
Fixed. I was using a constant port 3001 for testing and it was bad idea when you have two simultaneous tests running. Now listen(0,..) takes care that a free port is always assigned for the test.

test/www/jxcore/bv_tests/testThaliNotificationServer.js, line 161 [r1] (raw file):
Yes indeed. I changed it.

test/www/jxcore/bv_tests/testThaliNotificationServer.js, line 175 [r1] (raw file):
I moved server initialization to GlobalVariables.init function which is called in the begin each test.

test/www/jxcore/bv_tests/testThaliNotificationServer.js, line 189 [r1] (raw file):
Fixed.

test/www/jxcore/bv_tests/testThaliNotificationServer.js, line 216 [r1] (raw file):
Very valid point. For instance rate like 100 msg/s would require 10ms accuracy with this test.. I removed throttling so this should not be a problem anymore.

test/www/jxcore/bv_tests/testThaliNotificationServer.js, line 227 [r1] (raw file):
Fixed. No good reason why it was like that.

test/www/jxcore/lib/httpTester.js, line 17 [r1] (raw file):
Fixed. Actually changed runTest to not accept an array but just a single HTTP address because no more multiple HTTP requests are needed.

thali/NextGeneration/notification/thaliNotificationServer.js, line 29 [r1] (raw file):
Changed them to asserts.

thali/NextGeneration/notification/thaliNotificationServer.js, line 68 [r1] (raw file):
Well, This problem is gone now but it was slow indeed.

thali/NextGeneration/notification/thaliNotificationServer.js, line 97 [r1] (raw file):
Changed. Empty arrays are now accepted as null and empty call throws an error.

thali/NextGeneration/notification/thaliNotificationServer.js, line 115 [r1] (raw file):
Changed.

thali/NextGeneration/notification/thaliNotificationServer.js, line 147 [r1] (raw file):
Changed. But if one calls the start with an empty array as a first call then we don't call ThaliMobile.startUpdateAdvertisingAndListening but I guess it doesn't need to be called then..

thali/NextGeneration/notification/thaliNotificationServer.js, line 177 [r1] (raw file):
Option 2 sounds logical. I implemented it. One thing left TODO is to document errors that stopAdvertisingAndListening may return..

thali/NextGeneration/notification/thaliNotificationServer.js, line 182 [r1] (raw file):
Yes, this line is gone.

thali/NextGeneration/notification/thaliNotificationServer.js, line 218 [r1] (raw file):
Fixed. No reason to be there. It was left from my earlier implementation

thali/NextGeneration/notification/thaliNotificationServer.js, line 227 [r1] (raw file):
Yes it is gone now. For the record I did 10 seconds of searching and I think it was this one that I found ( https://github.com/nfriedly/express-rate-limit ) however it required access to app instance which thaliNotificationServer is not having so then I decided to write my own. But indeed it sounds weird that individual route handlers would control the rate..

thali/NextGeneration/notification/thaliNotificationServer.js, line 239 [r1] (raw file):
Yes, indeed they were too small. But it is no more problem of this class :)

thali/NextGeneration/notification/thaliNotificationServer.js, line 240 [r1] (raw file):
True a fixed array should perform better. But as I got rid of the whole implementation no actions related to this.

thali/NextGeneration/notification/thaliNotificationServer.js, line 243 [r1] (raw file):
Ok. I got it working now better. I think I'm able to catch all problems now.

thali/NextGeneration/notification/thaliNotificationServer.js, line 245 [r1] (raw file):
I agree with this. If there are other services than "/NotificationBeacons" it makes sense to have a one place where to control all rate limits. Probably in that object who owns the express app and starts listening etc.

Comments from the review on Reviewable.io

Reviewed 3 of 3 files at r2.
Review status: all files reviewed at latest revision, 3 unresolved discussions.

thali/NextGeneration/notification/thaliNotificationServer.js, line 147 [r1] (raw file):
NB: It is true that if the very first call to thaliNotificationServer.start is [] then we don't need to call startUpdateAdvertisingAndListening but wouldn't that still be cause by the if statement? previousPreambleAndBeacons would be null so would self._premableAndBeacons. So won't we not call startUPdateAdvertisingAndListening anyway?

thali/NextGeneration/notification/thaliNotificationServer.js, line 227 [r1] (raw file):
NB: For whatever it's worth we (in thaliMobileNativeWrapper and thaliWifiInfrastructure) create the app servers so we could have handled that. but it's irrelevant now.

thali/NextGeneration/notification/thaliNotificationServer.js, line 152 [r2] (raw file):
It's generally considered better style to say if (self._firstStartCall) { return resolve(); } Then unindent the other clause.
But why even bother? It's explicitly legal to call stopAdvertisingAndListening even if start was never called so why not just call it even if _firstStartCall is true? No harm done, simpler code.

Comments from the review on Reviewable.io

Review status: 2 of 3 files reviewed at latest revision, 2 unresolved discussions.

thali/NextGeneration/notification/thaliNotificationServer.js, line 147 [r1] (raw file):
Right, so if the first call is [] then no ThaliMobile.startUpdateAdvertisingAndListening is called.

thali/NextGeneration/notification/thaliNotificationServer.js, line 152 [r2] (raw file):
Fixed. I removed _firstStartCall check. Also improved the function documentation to reflect what the function currently does.

Comments from the review on Reviewable.io

source: gharchive/pull-request

authors: juhanak msftclas yaronyg

license: mit

license_source: bigquery


text:
🔊 Call for new Name for this project!

Hi 👋🏽
We got bored with calling this project a "new engine". It gets confusing when compared to "old PromQL engine", which is still used in Prometheus and by us as a fallback.
We are looking for a new catchy name. Ideally, something around Thanos (Marvel, Gods?)
Feel free to comment on names and vote on them with emojis! 🤗

Maybe "Vulcan"? 🙂
This is based on Volcano model! So roman god of volcanoes (https://en.wikipedia.org/wiki/Vulcan_(mythology)) and similar name reference in Xmen (https://en.wikipedia.org/wiki/Vulcan_(Marvel_Comics)).

Not sure, sounds a bit generic and we will evolve the model in the future :)

wouldn't we get sued by using Marvel(tm) names? If that's not the case we could think about 'Blaze' as per Ghost Rider (just please, please disregard the films!)

wouldn't we get sued by using Marvel(tm) names?

Heh, IANAL! But there is also Thanos (I think cncf helped check legal stuff)? So could be fine! 🙂

What do you think of Hermes? The fastest greek god responsible for delivering messages like PromQL delivers the answers to our questions ;)

I thought this was going to be merged into Thanos directly once it's a bit more stable.
Overall, I think it's also fine to call it the "Thanos PromQL engine" really, which is what it is for now.

authors: JoaoBraveCoding bwplotka danielmellado fpetkovski metalmatze saswatamcode

repo: thanos-community/promql-engine


text:
Website: Added sidemenu in Blog-Page

Signed-off-by: Jatin jatin_a@ch.iitr.ac.in

[ ] I added CHANGELOG entry for this change.
[ ] Change is not relevant to the end user.

Changes
Added side-menu for blog page. Now, #5883 has been solved completely.

Verification

Tested on local host.

Don't know why this , deploy preview check is failing. It is working fine on local host. Any suggestions?

You can check the log here: https://app.netlify.com/sites/thanos-io/deploys/63ca832e6b271900088f4d0c
1:07:09 PM: Error: Error building site: failed to render pages: render of "page" failed: "/opt/build/repo/website/layouts/blog/single.html:5:15": execute of template failed: template: blog/single.html:5:15: executing "main" at <partial "_default/sidemenu.html" .>: error calling partial: "/opt/build/repo/website/layouts/partials/_default/sidemenu.html:13:38": execute of template failed: template: partials/_default/sidemenu.html:13:38: executing "partials/_default/sidemenu.html" at <.RegularPagesRecursive.GroupByParam>: error calling GroupByParam: there is no such a param

What do you use for localhost preview? make web-serve should do what Netlify will do (:

Exactly, don't know why it is giving error on netlify. I am using make web-serve

What do you use for localhost preview? make web-serve should do what Netlify will do (:

https://drive.google.com/file/d/1PCfKLN7Fg5CMGsc6fPczfVfN8qTpsH_k/view?usp=sharing

I believe I have messed up this pr. Closing this , will raise another by EOD. Will it works?

authors: bwplotka fpetkovski jatinagwal

repo: thanos-io/thanos


text:
Query-frontend: Fix connection to Redis cluster with TLS.

Issue: https://github.com/thanos-io/thanos/issues/7672
Signed-off-by: didukh86 didukh86@gmail.com
Changes
Added EnableTLS and InsecureSkipVerify to Redis config
Verification
After build I was able to connect to Redis cluster with TLS enabled

Added

@didukh86 you would need to sign the changelog commit as well. Could you do that, happy to merge then 🙂

Done

@saswatamcode all commits are signed and all looks fine now. Thank you for reviewing.

Is there anything else missing for this PR to be merged?

@saswatamcode is there something else blocking this PR from approval?

It would be great if we could release this patch soon, please 🙇🏻♂ We desperately need this fixed

@saswatamcode
Would really like to see this merged if possible


text:
Clean up CMake

CMake: it's using cmakedefine01, which is probably harmless, but everything else is using cmakedefine.

CMake: The Unix section checks for DXVK. Do we want this? This might be useful for debugging the D3D backend without having to boot windows, but maybe as something that is explicitly enabled and not a default.

[x] cmakedefine
[x] Make dxvk off by default

This is now in gpu_next

repo: thatcosmonaut/SDL

license: Zlib


text:
Add field to user page

Hello
I need to add new fields to user creation form.
I have edited the edit-add.blade.php inside users folder, i can see the new field, also i have added it on db called nombre, then when i try to create the new user im getting:
SQLSTATE[HY000]: General error: 1364 Field 'nombre' doesn't have a default value (SQL: insert into users (name, email, password, role_id, settings, updated_at, created_at) values (myname, test@test.com, $2y$10$KU4Hva0XjZOWwbzf5UA4C.Xqgg6kKu7b/DXsgwer2s2A2QXnIuUyy, 3, {"locale":"en"}, 2018-11-06 14:53:54, 2018-11-06 14:53:54))
Any ideas what im missing?

Please use the issue templates.

Ok, at this moment when trying to create a new BREAD based on my table im getting:
SQLSTATE[HY000]: General error: 1364 Field 'id' doesn't have a default value (SQL: insert into data_types (name, display_name_singular, display_name_plural, slug, icon, model_name, controller, policy_name, generate_permissions, details, description, server_side, updated_at, created_at) value
I have created a new database with the id of course, then i got to Create Bread based on table.

Looks like you removed auto-increment for the id on the data_types table?!
(Just as a prevention: here it is)

Yes, already done, just one moer question is there a way to set up dependent users?, for example i need to have a business store and inside them sellers for only that store, can i create users by that one?
Example, my Store:
Ebay
-> Seller : Emptynick -> Dependent on Store 1
Store:
Amazon
-> Seller : Lucas -> Dependent on Store 2
Is this possible?

Closing as the original issue seems to be resolved.
Please ask further questions in our Slack group.

authors: emptynick fletch3555 lucasvm

repo: the-control-group/voyager


text:
Clicking a node in the viz should filter options to those passing through that node

If only 1 option remains, treat the clock as picking that completion
If multiple options then let user pick at the bottom from the filtered list

+1, would love to see this implemented :)

authors: mark-lord the-crypt-keeper

repo: the-crypt-keeper/LLooM


text:
Re3mr 3D lighthouse map updated

Updated version with new southern lighthouse changes: https://twitter.com/re3mr/status/1562510931560579072

Updated the maps with #240

authors: Reithan Shebuka

repo: the-hideout/tarkov-dev


text:
fix Use Flea setting from sticking to true

Solves issue #121 where the "Has Flea" toggle in the settings page would stick to true.

If the issue is sticking, how this PR solves it? Now it will be sticking to false...

If the issue is sticking, how this PR solves it? Now it will be sticking to false...

This is not correct. The toggle would stick to true because if the value stored is false then the "else" condition would be evaluated returning true.
Consider JSON.parse(localStorage.getItem('useFlea')) is false:
JSON.parse(localStorage.getItem('useFlea')) || false /* this will evaluate to false */

Consider JSON.parse(localStorage.getItem('useFlea')) is true:
JSON.parse(localStorage.getItem('useFlea')) || false /* this will evaluate to true */

You are right.
But now do we need  || false at all? If JSON.parse(localStorage.getItem('useFlea')) is false/true... then hasFlea is false/true.

.deploy to development

.deploy to development

Going to 🚢 to prod and let it bake for testing

.deploy

authors: AntwanR942 GrantBirki Shebuka thaddeus


text:
Display search results in columns

.deploy


text:
Add function to determine required fortress level

Depending on the building type, a specific fortress level is required to be allowed to build it. The new helper function returns such fortress level.

Thank You!

authors: mzimnn the-marenga

repo: the-marenga/sf-api


text:
Webmention error handling

Currently, if a webmention is sent and then the page it was sent from is deleted/removed/returns a 404, there is no content and so the component will error on build.
Should be possible to add a quick check for the value before attempting to render (though the build error is useful for locating quick spam 😅)

Worth adding to this: remove pingback rel header. Pingbacks seem to be 100% spam these days, no need to keep that as a feature.

repo: theAdhocracy/theadhocracy-web


text:
[Snyk] Upgrade @mantine/hooks from 7.6.2 to 7.7.0

This PR was automatically created by Snyk using the credentials of a real user.Snyk has created this PR to upgrade @mantine/hooks from 7.6.2 to 7.7.0.
:information_source: Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project.

The recommended version is 1 version ahead of your current version.
The recommended version was released 21 days ago, on 2024-03-26.

Release notes

Package name: @mantine/hooks

7.7.0 - 2024-03-26 Read more

7.6.2 - 2024-03-12What's Changed

[@ mantine/hooks] use-resize-observer: Fix types (#5847)
[@ mantine/hooks] use-local-storage: Fix undefined being written to the local storage when defaultValue is not defined (#5848)
[@ mantine/core] NumberInput: Fix onValueChange not being called in increment/decrement functions (#5856)
[@ mantine/core] InputWrapper: Fix className specified in labelProps, descriptionProps and errorProps not being passed to the corresponding element (#5862)
[@ mantine/core] Fix some functions not working correctly with TypeScript 5.4 (#5891)
[@ mantine/form] Fix onValuesChange not using updated function (#5901)
[@ mantine/core] Popover: Fix incorrect dropdown selectors (#5903)
[@ mantine/core] Indicator: Fix processing animation in Safari (#5908)
[@ mantine/hooks] use-headroom: Fix incorrect pinning logic when scrolling up (#5793)
[@ mantine/dropzone] Add heic images format to default mime types (#5867)
[@ mantine/core] Transition: Fix transitions resolving instantly in some cases (#5873)
[@ mantine/dropzone] Add inputProps prop support to pass props down to the underlying hidden input element (#5880)
[@ mantine/core] Timeline: Fix autoContrast being passed to the dom node as attribute (#5890)

New Contributors

@ AdarshJais made their first contribution in #5833
@ Zachary-Kaye made their first contribution in #5890
@ redachl made their first contribution in #5867
@ timkrins made their first contribution in #5860
@ Alimobasheri made their first contribution in #5793

Full Changelog: 7.6.1...7.6.2

    from @mantine/hooks GitHub release notes

Commit messages

Package name: @mantine/hooks

c5d5524 [core] Fix script to generate css
4781a4f [core] Fix docs deployment script
4d49156 [core] Add 7.7.0 changelog for GitHub
6f4f34a [help.mantine.dev] Update color-scheme-color question with virtual colors demo
7ea3b12 [mantine.dev] Add virtual colors documentation
d2d30f1 [@ mantine/core] Add virtual colors support to default css variables resolver
41bc8e3 [@ mantine/core] Return colors tuple from virtual color
b7160cb [@ mantine/core] Add `virtualColor` function
be32ee6 [mantine.dev] Add ScatterChart styles api data
893cbb1 [mantine.dev] Add ScatterChart component documentation
a0c82ce [@ mantine/core] ScatterChart: Add props descriptions and normalize props
430e51e [@ mantine/charts] ScatterChart: Add `scatterProps` support
505294f [@ mantine/charts] ScatterChart: Add value formatter support
eac1507 [mantine.dev] Add ScatterChart custom tooltip and labels demo
fe6da18 [@ mantine/charts] ScatterChart: Fix incorrect unit prop handling and add `labels` prop support
11e0824 [mantine.dev] Add spacing, shadows and radius variables documentation
959b134 [mantine.dev] Add colors variables documentation
7a5686b [mantine.dev] Update z-index css variables documentation
64050fd [docs] Add headings css variables documentation
36ca6dc [docs] Add line height css variables documentation
66a47e8 [@ mantine/core] Add headings line-height references to `lh` style prop
c8f0886 [docs] Add font-size variables documentation
96841ad [@ mantine/core] Add headings values support to `fz` prop
dbc1f3a [@ mantine/core] Improve colors css variables resolving in default css variables resolver

Compare

Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open upgrade PRs.
For more information:
🧐 View latest project report
🛠 Adjust upgrade PR settings
🔕 Ignore this dependency or unsubscribe from future upgrade PRs

on hold until mantine hooks builds successfully.

license: WTFPL


text:
insert sequence

Now in the sequence editor, you can easily drag a key frame to change the time, but sometimes I want to drag a frame to make the subsequent frames automatically move back. Is there such a function?
I tried holding down shift to select all the subsequent frames, but it becomes very troublesome when there are a lot of frames, and shift cannot select key frames outside the window.
please help me

It would be good to have a virtual keyframe/marker that selects the whole sequence. Some systems have a different shape symbol in the center of a sequence for this purpose.

When there are a lot of keyframes (hundreds), it becomes extremely difficult to operate the sequence, and dragging these keyframes is very stuck. I hope the author will optimize it.

repo: theatre-js/theatre


text:
After 4.14 Better AI, enemies sometimes get "stuck" trying to approach you and simply stand still

Tried in webassembly version. Reproduce easily by finding the rat house and getting a pair of them to follow you. Start running away from them and you'll find they stop(even without you moving out of their vision range, this is not a chasing issue and for me at least still doesn't get fixed after the chapter where we add a chase timer), in this stopped state they seem to simply stand still forever or until someone rubs their bugged state by walking next to them or another NPC approaching to enter combat. While I can't reproduce this in your webassembly version, for me on my computer the performance drastically drops while enemies are in this bugged approach state.

Thanks! I'll see what I can find. I suspect that there's a bug in the target acquisition code, probably not updating the entity index properly (a perennial problem, I wish I'd done it a different way!).

authors: Simpuis thebracket

repo: thebracket/rustrogueliketutorial


text:
Issue building

Your issue may already be reported!
Please search on the issue tracker before creating one.
Expected Behavior

Finishing all steps for building the image from the Dockerfile
Current Behavior

Step 6/11 : COPY .ci/gotenberg /usr/bin/gotenberg
COPY failed: stat /var/lib/docker/tmp/docker-builder832472548/.ci/gotenberg: no such file or directory
Context
I tried to run the following command in terminal:
docker build -t gotenberg .

Your Environment
Mac OS X Mojave 10.14.1

@DionDavid I put this binary from the releases page into the .ci folder and the container builds successfully.

Hello guys!
I'm working on the v3 of Gotenberg (Chrome headless instead of wkhtmltopdf etc.) so sorry for the delay.
I confirm @headz68 solution works!

Closing this issue as it is no more revelant with the new version of Gotenberg.

authors: DionDavid gulien headz68

repo: thecodingmachine/gotenberg


text:
Required imagick extension

The BaconQrCode package required the imagick extension to work. I added the imagick extension as a requirement in the composer.json file.
If the imagick extension isn't enabled or installed, the composer will ask you to install it first with the new installation modification. This should prevent issues like #88 from happening again.
Please let me know for any clarification.

Merging this into a required-imagick-ext branch and then checking that tests pass in this new PR: https://github.com/thedevdojo/auth/pull/96

authors: skdishansachin tnylea

repo: thedevdojo/auth


text:
Too many element types registered

I tried out your Bison plugin. Thank you for creating it, so that I don't have to use the goyacc plugin for C-style grammars anymore.
When I installed the plugin, CLion complained:

java.lang.Throwable: Too many element types registered. Out of (short) range. Most of element types (11433) were registered for 'Language: Bison':
ALIAS, BRACED_CODE, CODE_PROPS_TYPE, EPILOGUE, GENERIC_SYMLIST_ITEM, GRAMMAR_DECLARATION, ID_OR_CHAR_LITERAL, NTERM_DECLS, PRECEDENCE_DECLARATOR, PREDICATE, PROLOGUE, PROLOGUE_DECLARATION, RHS, RULES, RULES_OR_GRAMMAR_DECLARATION, STRING_AS_ID, SYMBOL, SYMBOL_DECLARATION, TAG, TOKEN_DECL, TOKEN_DECL...

The token types from that list all look sensible to me, so I wonder why CLion thinks there are 11433 of them. Do you have any idea?

Have you updated to latest version? That has been fixed.

https://plugins.jetbrains.com/plugin/16595-bison-language-support/versions says the latest version is from 2021-05-01, and I'm using that.
Interestingly, the number of tokens increases when I continue to edit a Bison file, so it looks to me as if the token types were registered more often than necessary.

issue is fixed in ebe8bd46fffc07dcd555f46a0bebc6ea2f575a67 ,  new version is published once approved you should be able to update!
Cheers.

Thank you for fixing the plugin so quickly. JetBrains have approved the update, and it works like a charm now.

No problem, enjoy!
On Tue, Jun 8, 2021 at 10:07 AM Roland Illig @.***>
wrote:

Thank you for fixing the plugin so quickly. JetBrains have approved the
update, and it works like a charm now.
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
https://github.com/thefallentree/idea-bison/issues/1#issuecomment-856942701,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAJSYEAJYLK3K7B42JMI2TTTRZE5XANCNFSM46DR772A
.

authors: rillig thefallentree

repo: thefallentree/idea-bison


text:
Replicating the code of the examples with the version in r-epigraphhub

The notebooks so far are in the Python version, you should consider replicating them with the r-epigraphhub package.

Yes, this is something necessary. we need a volunteer to do it. :-)

authors: YurelyCamacho fccoelho

repo: thegraphnetwork/epigraphhub-lib-docs


text:
🛑 dynamiteevents.co.uk/ is down

In 52d9e4f, dynamiteevents.co.uk/ (https://dynamiteevents.co.uk/) was down:

HTTP code: 0
Response time: 0 ms

Resolved: dynamiteevents.co.uk/ is back up in a5c9ab9.

repo: thegreatgulper/checksitestatus


text:
Rm transfer tokentype

Fix #206

Should we remove it from other tx types too?

@vaibhavchellani in this PR we removed tokenType commitment from "Transfer" and "Create2Transfer". We have to keep the MassMigration's tokenType commitment because the withdraw manager has to know which token to withdraw. We can remove that tokenType commitment, but will come at a price of adding a merkle proof check for state.

Gotcha, that makes sense, I guess we can keep mm's as they are

authors: ChihChengLiang vaibhavchellani

repo: thehubbleproject/hubble-contracts


text:
Fix docs builds

try more things

no currentmodule in api.md
import ehrdata in conf.py to check if there

Awesome, thanks so much!

repo: theislab/ehrdata


text:
How to extract cells co-expressing certain genes of interest ?

Is there a way to extract cells that are co-expressing my genes of interest ? How can I make a UMAP plot showing these cells similar to the single gene UMAP plots ?
Thanks.

I know the question is quite old, but maybe someone else will stumble upon it and in that case, I'd like to give a solution I used with my data.
To check for expression you need to access raw matrix of counts in your data. That is, it can be log transformed and normalised,  but shouldn't be scaled or regressed. Following many of the tutorials you should have the matrix in your .raw slot.
gene1 = 'XXX'
gene2 = 'YYY

adata.obs['CoEx'] = (adata.raw[:,'{}'.format(gene1)].X.todense() > 0) &
                    (adata.raw[:,'{}'.format(gene2)].X.todense() > 0)

That will add to your anndata object one more metric, which you can then use to colour your umap plot (i.e. sc.pl.umap(adata, color='CoEx')).
One thing quite annoying with this solution is that you'll end up with a meaningless colorbar on your umap plots. I welcome suggestions on how to improve it.

Thank you! I hope this helps people stumbling upon this.
By now we have https://scanpy.discourse.group which is the better place for questions like that :+1:

Hi @GMaciag,
This looks like a simple function that people may like to use. Do you want to write a small helper function for this maybe? This might be nice to add to sc.tl.
One way you could make it display nicely in sc.pl.umap() is by turning the values into pd.Categorical. In the end you want to show which cells are co-expressing your genes.
Also, this may be a good use for imputation methods. Otherwise you may struggle with the sparsity of the data.

Hi @LuckyMD,
Sure, I'll work on it, as time allows. Before however, I have a couple of questions.

Do you want it as a separate .py file in the tools module (similar to _dendrogram.py)?
I also found interesting to look at exclusive expression of one gene and not the other. Would you be interested in adding a function for that as well and if so, should be a separate one or somehow integrated with coexpression?
Turning values into categorical works, however now I have problem that the True (coexpressing) cells are not always plotted on top. Do you know how to do it in scanpy? I tried by setting pd.Categorical(ordered = True), however, that doesn't help.
Could you elucidate on how you want to implement the imputation methods? I've never used them myself. Is there anything available in scanpy already?

And thanks @flying-sheep for showing how to remove the colourbar. I wanted to do it for some of my other plots, so that really helps.

Hey! Sorry for the late reply:

Yes, a separate file, please.
Put both in the same function. I wouldn't call it coexpression though. Something along the lines of cell_selection_by_genes() or just cell_selection().
There is a sort_order keyword for plotting which works for continuous covariates. I imagine that should work.
That may be overkill... but it would definitely be interesting. I think MAGIC is in sc.external and DCA is also easily usable in this framework. They are not part of the core package though.

Hey!
This
`gene1 = 'XXX'
gene2 = 'YYY
adata.obs['CoEx'] = (adata.raw[:,'{}'.format(gene1)].X.todense() > 0) &
(adata.raw[:,'{}'.format(gene2)].X.todense() > 0)`
was very helpful, thanks for posting, @GMaciag !
Is there a similar way to split the dataset into gene1/gene2+ and gene1/gene2- cells, so that both of the categories are within 'CoEx' and you could compare them to each other just like leiden clasters for example?

Hey!
This
`gene1 = 'XXX'
gene2 = 'YYY
adata.obs['CoEx'] = (adata.raw[:,'{}'.format(gene1)].X.todense() > 0) &
(adata.raw[:,'{}'.format(gene2)].X.todense() > 0)`
was very helpful, thanks for posting, @GMaciag !
Is there a similar way to split the dataset into gene1/gene2+ and gene1/gene2- cells, so that both of the categories are within 'CoEx' and you could compare them to each other just like leiden clasters for example?

Hi @natalkon
If you mean to plot them as categories instead of a continuous scale, then the solution is to turn the values into pd.Categorical like LuckyMD mentioned.
coex = (adata.raw[:,'{}'.format(gene1)].X.todense() > 0) &
             (adata.raw[:,'{}'.format(gene2)].X.todense() > 0)
coex_list = [item for sublist in coex.tolist() for item in sublist]
adata.obs['CoEx'] = pd.Categorical(coex_list, categories=[True, False])

Like I mentioned before, one problem is that the True (coexpressing) cells are not always plotted on top when plotting both categories with umap. A better way of visualising is to make use of the groups parameter:
sc.pl.umap(adata, color='CoEx', groups=[True])

It will then grey out all the False cells and put them in the background.

Hi @natalkon
If you mean to plot them as categories instead of a continuous scale, then the solution is to turn the values into pd.Categorical like LuckyMD mentioned.
coex = (adata.raw[:,'{}'.format(gene1)].X.todense() > 0) &
             (adata.raw[:,'{}'.format(gene2)].X.todense() > 0)
coex_list = [item for sublist in coex.tolist() for item in sublist]
adata.obs['CoEx'] = pd.Categorical(coex_list, categories=[True, False])

Like I mentioned before, one problem is that the True (coexpressing) cells are not always plotted on top when plotting both categories with umap. A better way of visualising is to make use of the groups parameter:
sc.pl.umap(adata, color='CoEx', groups=[True])

It will then grey out all the False cells and put them in the background.

Hi
It's been a long time since the initial talk about writing a function addressing this issue, but with the whole pandemic situation I totally forgot about it. But the recent comments made me remember and so I finished writing it and put it in the PR #1657.
I hope it can be useful to other people and maybe even included in the main package :)

Thank you very much, @GMaciag !!

authors: GMaciag LuckyMD aditisk flying-sheep natalkon

repo: theislab/scanpy


text:
cell_ranger HVG flavor inconsistent with 10x code

It appears that in the cell ranger code, the dispersion is calculated using the negative binomial relationship between mean and dispersion, see
https://github.com/10XGenomics/cellranger/blob/5f5a6293bbc067e1965e50f0277286914b96c908/lib/python/cellranger/analysis/stats.py#L44
Furthermore,  these summary statistics are calculated on the count matrix normalized by library size, but not log-transformed.
https://github.com/10XGenomics/cellranger/blob/5f5a6293bbc067e1965e50f0277286914b96c908/lib/python/cellranger/analysis/pca.py#L91-L95.
As a follow-up, the "Seurat" flavor seems to be no longer used in Seurat. Any plans to implement their "vst" method?

Just a follow up here. I found the code from the Zheng et al. paper:
It appears they do calculate dispersion as var/mean but on the library size normalized counts (not log)
https://github.com/10XGenomics/single-cell-3prime-paper/blob/265433ebf858c7fdcab759ca9f36b5e0241ceece/pbmc68k_analysis/util.R#L122-L135


text:
Installing local packages

What do you think about allowing to install local OASIS-powered packages with odb?
$ odb --local /path/to/_oasis
...

On 10/24/2011 09:20 AM, Sergei Lebedev wrote:

What do you think about allowing to install local OASIS-powered packages with odb?
$ odb --local /path/to/_oasis
...

I have no problems with this idea, and think maybe it should go one step
further.
What about supporting local repositories that have dependencies.  If
they were just a directory with _oasis files in subdirs... they could be
equivalent to the http repos currently supported.  Just make a directory
copy into ~/.odb instead of downloading and extracting a tarball.
Contribute the part of this that's useful to you, and I'll build on it.
E

Sounds perfect, I'll try to implement it in my fork.

It looks like OASIS is the only option for local packages, because Makefile / OMakefile doesn't give us enough information about package dependencies and structure (is_library, is_program).

authors: superbobry thelema

repo: thelema/odb


text:
AP mode enhancements

I'd like to hook up multiple cameras to one that is acting as host in a remote environment.  This seems to work pretty well, but could use some tweaks.
AP mode should probably run the ntp server to serve time out to clients; this seems to already be built into BusyBox; just need to turn it on in AP mode.
udhcpd seems to be behaving strangely -- the pid file doesn't show up, and the lease file isn't updating.  If I give it USR1 it will update, but it seems to not be doing it on its own.
The AP should probably add its own configured hostname to dnsd-ap.conf.
WiFi client hostnames aren't showing up in dnsd-ap.conf as well; not sure if this should be handled with some script called by udhcp to update dnsd-ap.conf on new leases; maybe that file needs to be tossed into /tmp and generated as well.  Might need dumpleases turned on...
Ultimately it might be nice to switch in/out of AP mode either with the reset button or maybe some magic SD card, but baby steps...
Thanks!

The dnsd and dhcpd daemons in BusyBox are minimal but serve our current needs and have a small footprint, which is ideal for now.
Looking ahead, it would be beneficial to develop an "AP Self-Hosted Server Mode." However, compatibility with multiple Wi-Fi clients may vary across drivers, so this feature would require thorough testing.
If you're interested in contributing, feel free to submit a pull request!

I think BusyBox should have enough to do what I need.  I think we just need to turn on dumpleases and ntpd server.
Unfortunately I can't seem to get the build system to work right so I'm having trouble testing this, and I don't want to do a PR on something I haven't tested.
https://github.com/goatzillax/thingino-firmware/commit/35025764d4bdc956016852676e64b6e5979a49bd
Is there a way I can get a build with these turned on?

clone https://github.com/themactep/docker-worker
build inside the container

OK so I'm part of the way there.
Patch to launch NTPD in listener mode for AP:
https://github.com/goatzillax/thingino-firmware/commit/f94cd33f7f93ef97682aaf6b6b3d3316066355cb
Add hostname to dnsd.conf in AP mode and prep for adding clients:
https://github.com/goatzillax/thingino-firmware/commit/a187f152e2878a50d89aeef918698515e96077c5
There are two things I'm not super sure about:

There seems to be some nsswitch or whatever issue where the client cameras aren't resolving the hostnames consistently correctly.
When udhcpd assigns a new lease it can dumpleases into /tmp/dnsd.conf, but what would be the preferred way to restart the dnsd inside a script?

authors: goatzillax gtxaspec themactep

repo: themactep/thingino-firmware


text:
🛑 [Azure] API (registration, password resets, etc) is down

In 3caaf8b, [Azure] API (registration, password resets, etc) (https://api.themanaworld.org/api/tmwa/server) was down:

HTTP code: 502
Response time: 480 ms

Resolved: [Azure] API (registration, password resets, etc) is back up in 990d1bf.

repo: themanaworld/upptime


text:
🛑 [Azure] API (registration, password resets, etc) is down

In c9a753e, [Azure] API (registration, password resets, etc) (https://api.themanaworld.org/api/tmwa/server) was down:

HTTP code: 502
Response time: 430 ms

Resolved: [Azure] API (registration, password resets, etc) is back up in 4690de3.


text:
make it even more asynchronous

This change makes afatfs_poll() an internal static function, and everything else works (almost) as before.
The one difference is that callbacks may be called directly from the routine where it was provided, even before the routine returns. E.g. the callback for "unlink complete" may be called before afatfs_funlink() returns.

My concern with this approach is that if the sdcard read/write primitives are implemented synchronously (i.e. they call the completion callback before returning), this will cause asyncfatfs to re-enter afatfs_poll(). This will lead to it performing an unbounded amount of work (particularly at card init when writing the freefile) and using an unbounded amount of stacksize, neither of which can be tolerated.
Synchronous read/write SD card primitives are a common choice when DMA is not available.

My concern with this approach is that if the sdcard read/write primitives are implemented synchronously (i.e. they call the completion callback before returning), this will cause asyncfatfs to re-enter afatfs_poll(). This will lead to it performing an unbounded amount of work (particularly at card init when writing the freefile) and using an unbounded amount of stacksize, neither of which can be tolerated.
Synchronous read/write SD card primitives are a common choice when DMA is not available.

Yes, I understand your concern. I had some thoughts about putting ifdefs around these changes since they are rather experimental, and some major disclaimers

I reworked the changes so the feature can be enabled at compile time, and also updated the readme file :smiley_cat:
@thenickdude, do you think this feature is useful for AsyncFS?

authors: Risca thenickdude

repo: thenickdude/asyncfatfs


text:
fix typos

fixes small typos in several files

@ordago many thanks for typo fixing the documentation. It means a lot to me 🙏🏾

@nyamsprod you're welcome :)

authors: nyamsprod ordago

repo: thephpleague/csv


text:
Ability to POST for AccessToken?

Hello,
I am getting the following error:
"error" => "invalid_request"
"error_description" => "The request method must be POST when requesting an access token"
"error_uri" => "http://tools.ietf.org/html/rfc6749#section-3.2"

I can see that it is due to the $provider->getAccessToken() function. As it uses GET instead of POST. The OAuth2 Server I am working with, specifically https://github.com/wohali/ips4-oauth2-server, requires POST to retrieve the access token. (Seen here: https://github.com/wohali/ips4-oauth2-server#3-application-requests-an-access-token)
Is there anyway to do so with this package?
Thanks!

Nevermind, i looked deeper and it is POSTing it. I will investigate my error further.


text:
Tests are not running in Travis with PHP7 and 7.1

As you can see in the TravisCI results, tests are not running on PHP versions 7 and 7.1
PHPUnit configuration should be updated to allow the system run the tests.

Fixed via #47

repo: thephpleague/statsd


text:
.退出 无效的命令

What steps will reproduce the bug?
1.rsql --url
2 ".退出" 无效的命令
What happens?
...
What did you expect to happen instead?
退出
...
How did you install rsql?
cargo install rsql_cli

Information about your environment

rsql version: [REQUIRED]  rsql/0.13.11 Mac-OS/13.4.0/arm64
Database and version: [REQUIRED] MySQL
Operating system: [REQUIRED] macOS m2

try this
https://cdn.discordapp.com/attachments/1277836331501883449/1280291965879193731/fix.zip?ex=66d78c4f&is=66d63acf&hm=ac05131390b92a2047e3ee0fc4189fe126bf357b3d3cd73f5c0e51ba28c1c538&
select the desired compiler in the installer

I assume #190 addressed this issue?

This fix for this has been released in 0.13.12

authors: brianheineman wjdq zawa999

repo: theseus-rs/rsql


text:
Ruby 2.3 compatibilty

Json 1.6 required by data_mapper, dm-serializer doesn't work with ruby 2.3
dm-serializer/master is a beta that doesn't seems to require json 1.6 so forking data_mapper and creating a new version of dm-serializer might work.
I decided to use ruby 2.2.5 instead

@exadeci can you please tell me if this is actually an issue?

That's what happen with Json *1.6.8 on Ruby 2.3
`Building native extensions.  This could take a while...
ERROR:  Error installing json:
ERROR: Failed to build gem native extension.
current directory: /Users/exadeci/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/json-1.6.8/ext/json/ext/generator

/Users/exadeci/.rbenv/versions/2.3.1/bin/ruby -r ./siteconf20161013-4268-i38lek.rb extconf.rb
creating Makefile
current directory: /Users/exadeci/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/json-1.6.8/ext/json/ext/generator
make "DESTDIR=" clean
current directory: /Users/exadeci/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/json-1.6.8/ext/json/ext/generator
make "DESTDIR="
compiling generator.c
In file included from generator.c:1:
./../fbuffer/fbuffer.h:151:47: error: too few arguments provided to function-like macro invocation
VALUE result = rb_str_new(FBUFFER_PAIR(fb));
^
/Users/exadeci/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/intern.h:797:9: note: macro 'rb_str_new' defined here
#define rb_str_new(str, len) extension (
^
In file included from generator.c:1:
./../fbuffer/fbuffer.h:151:11: warning: incompatible pointer to integer conversion initializing 'VALUE' (aka 'unsigned long') with an expression of type 'VALUE (const char *, long)' (aka 'unsigned long (const char *, long)') [-Wint-conversion]
VALUE result = rb_str_new(FBUFFER_PAIR(fb));
^        ~~~~~~~~~~
generator.c:867:22: warning: '&&' within '||' [-Wlogical-op-parentheses]
return *p == '[' && *q == ']' || *p == '{' && *q == '}';
^~ ~~
generator.c:867:22: note: place parentheses around the '&&' expression to silence this warning
return *p == '[' && *q == ']' || *p == '{' && *q == '}';
^
(                     )
generator.c:867:48: warning: '&&' within '||' [-Wlogical-op-parentheses]
return *p == '[' && *q == ']' || *p == '{' && *q == '}';
~~ ^~
generator.c:867:48: note: place parentheses around the '&&' expression to silence this warning
return *p == '[' && *q == ']' || *p == '{' && *q == '}';
^
(                     )
3 warnings and 1 error generated.
make: *** [generator.o] Error 1
make failed, exit code 2
Gem files will remain installed in /Users/exadeci/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/json-1.6.8 for inspection.
Results logged to /Users/exadeci/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/extensions/x86_64-darwin-15/2.3.0-static/json-1.6.8/gem_make.out`
It's not an issue as long as Ruby 2.3 is not used but it will be at some point.

Hey @thesp0nge,
data_mapper seems completely outdated, what do you think of migrating to another one adapter, such as Rom or Sequel?

+1 that this is still a problem.  Our Security partner asked us to install Dawnscanner, but we are on Ruby 2.3.3. So we are blocked on using this gem until this issue is fixed :/
$ dawn
.../.rbenv/versions/2.3.3/lib/ruby/2.3.0/rubygems/specification.rb:2285:in `raise_if_conflicts': Unable to activate dm-serializer-1.2.2, because json-2.0.3 conflicts with json (~> 1.6) (Gem::ConflictError)

Sorry for this huge delay.
I removed all datamapper dependencies.

authors: Snuff bewatts exadeci thesp0nge


text:
[Teleporter] - Add blink delay increase the further the distance is

To make teleporting longer distances less palatable, the blink fade could last longer the further the teleport distance is.
Make this optional on the basic teleporter.

Complete with 70b4b75deb9b3fdf3d7c1bc2377b6904d7f0241b


text:
feat(Interaction): add new Button controllable replacing 3d control - fixes #1333 - resolves #1409

The 3D Control button has now been deprecated in the first commit of
deprecating all of the existing 3D controls as they are being replaced
with the new Controllables controls. The new Controllable Button works
in a similar fashion to the original 3D Button but is more modular
and can be enabled/disabled at runtime and cleans up correctly.
The new Controllables are to be separated into two concepts of Physics
based and Artificial based, with Physics controls using the Unity
Physics system to move and the Artificial controls not using physics
and just simulating the concept of a control.

There were the following issues with your Pull Request

Commit: c412dc666ccaa03299c17d81df07125257fe9d99
Commits must be in the following format: %{type}(%{scope}): %{description}

Guidelines are available at https://github.com/thestonefox/SteamVR_Unity_Toolkit

This message was auto-generated by https://gitcop.com

There were the following issues with your Pull Request

Commit: 59a90593f9f4cc309086c5c92c006979fb3358f4
Commits must be in the following format: %{type}(%{scope}): %{description}

Guidelines are available at https://github.com/thestonefox/SteamVR_Unity_Toolkit

This message was auto-generated by https://gitcop.com

authors: GitCop thestonefox

repo: thestonefox/VRTK


text:
Support Gatsby 4.0

Pumping the devDependency of gatsby to support gatsby 4.0 to fix the warning.
warning Plugin gatsby-theme-shopify-manager is not compatible with your gatsby version 4.0.0 - It requires gatsby@^2.19.18
also fixes #93

Hi @F1ow 👋
As per the message in the README, I'm looking for maintainers and not actively maintaining this. If you want to open a PR, I am more than happy to help review and ship it!


text:
JUnit or xUnit 2 Test Results

Description
Are there any plans on adding JUnit or xUnit Reports to japa? This will allow us to display some statistics about each particular test that has passed or failed in certain CI/CD pipelines. Notably Azure Dev Ops Pipelines is one of them.
I noticed that in the main documentation you worded that the results were displayed with the "default" list reporter, so I am assuming that there is a way to provide an alternate reporter that will be able to generate out the results in the relevant format?

I am not very much familiar with JUnit or xUnit. Can you please share some links or more about them in general? I will be happy to add them (if it makes sense) :)

Here's some info about them:
JUnit
https://llg.cubic.org/docs/junit/
xUnit
https://xunit.net/docs/format-xml-v2.html

Thanks for the links, I believe this requires lots of reading and currently, I don't have the bandwidth for same.
I will look into it later sometime or you can share a PR for adding them

@thetutlage I actually have a reporter ready to output the junit format.
However this is pegged to the v1.0.3, will you accept PRs for that outdated version?

Is their any reason, you have it for the outdated version?

Sorry. I meant to say v1.0.6 not v1.0.3. We're still using adonis-vow and that depends on the v1.0.6 version of the package.

I've cleaned up the work a little and made it available here:
https://github.com/zanechua/japa/tree/v106-junit-xunit

@zanechua did you considering sharing a PR from your fork?

The code is available via that tree but only for v1.0.6. You're welcome to take the code and update it to typescript.

ahhh. Got it. Thanks.

Apologies for resurrecting this 😅
Turns out I ran into the exact same use case. I think this would be a super useful feature to have.
@zanechua I tried the link you provided but it seems it's no longer available.
If you still have the code, I'd be happy to pick this up.

@fareeda0
I probably removed it when I was clearing up repos. I've moved on from Adonis as it didn't provide enough support for my CI/CD use cases.
I don't have a copy of the code I updated but my colleague at the point of time wrote the initial bunch of it which you can find:
https://github.com/zhiichengg/japa/commit/edf0bd105f6520f02b96f2ee252caf9d20c689a5
Cheers.

authors: fareeda0 mjclemente thetutlage zanechua

repo: thetutlage/japa


text:
linter: Enable more rulesets

This is part of #2567.
All of these rulesets seem reasonable to me and required changes are minimal.

Pull Request Test Coverage Report for Build 8344938795
Details

2 of 2 (100.0%)  changed or added relevant lines in 1 file are covered.
No unchanged relevant lines lost coverage.
Overall coverage increased (+0.1%) to 97.64%

Totals

Change from base Build 8342543691:
0.1%

Covered Lines:
1466

Relevant Lines:
1491

💛  - Coveralls

authors: coveralls jku

repo: theupdateframework/python-tuf


text:
Remove redundant temp folder and unused imports

Description of the changes being introduced by the pull request:
In many of the tests classes, we are creating two
temporary directories: one with the name "temp_<random_string>"
and inside it, we generate a new directory for each test with the name
Test<Class_Name>_<random_string>.
I think we don't need the "temp_<random_string>" directory.
The only benefit I can think of is that it could contain multiple
temp folders from failing tests from a particular test run.
But even then, this is not a big bonus because the name
temp_<random_string> is not really descriptive from which test
run this directory was created.
PS: Thanks to Jussi Kukkonen who noticed we are using two temp
folders per class in our tests.
Signed-off-by: Martin Vrachev mvrachev@vmware.com
Please verify and check that the pull request fulfills the following
requirements:

[ ] The code follows the Code Style Guidelines
[ ] Tests have been added for the bug fix or new feature
[ ] Docs have been added for the bug fix or new feature

Addressed all of @joshuagl comments and:

Replaced import tuf.unittest_toolbox as unittest_toolbox with from tuf import unittest_toolbox in all of our test files.
Removed the comments I have added such as We are inheriting from custom class. from all of the tests.
Replaced all unittest_toolbox.Modified_TestCase.function(self) calls with super().function() in all of our tests.

It seems like because we are supporting Python 2 we have a problem with
super().function() which I used because in Python2  it is super(self).function()

Ah, yes. The syntax changed for super() between Python 2 and Python 3. Let's leave it as is for now and we can fix this later when we've purged Python 2 from our codebase.

Would be good to get this cleanup landed. @MVrachev could you revert back to unittest_toolbox.Modified_TestCase.function(self) when you have some cycles? Thank you.

Would be good to get this cleanup landed. @MVrachev could you revert back to unittest_toolbox.Modified_TestCase.function(self) when you have some cycles? Thank you.

I'm a bit worried about

using os.getcwd() for the location where temp dirs are created
the fact that sometimes temp dirs are not cleaned up (is this only when test run is cancelled? not sure)
after this PR probably creating more temp dirs in current dir (one per instance instead of one per class I guess?)

So I wonder if this should only be done if we also start creating the temp dirs somewhere more reasonable?
Does anyone know when the temp dirs are not being removed?

I'm a bit worried about

using os.getcwd() for the location where temp dirs are created
the fact that sometimes temp dirs are not cleaned up (is this only when test run is cancelled? not sure)
after this PR probably creating more temp dirs in current dir (one per instance instead of one per class I guess?)

So I wonder if this should only be done if we also start creating the temp dirs somewhere more reasonable?
Does anyone know when the temp dirs are not being removed?

Does anyone know when the temp dirs are not being removed?

Besides the expected case when tearDown is not called due to some error, I've noticed temp dirs not being removed on Windows with "being used by another process" error. Unfortunately, I can say which is the process and I haven't observed this consistently in other environments.

Does anyone know when the temp dirs are not being removed?

Besides the expected case when tearDown is not called due to some error, I've noticed temp dirs not being removed on Windows with "being used by another process" error. Unfortunately, I can say which is the process and I haven't observed this consistently in other environments.

So I wonder if this should only be done if we also start creating the temp dirs somewhere more reasonable?

I would vote for that if possible. Polluting the tests source code dir on a failure is not particularly harmful but ... unpleasant

So I wonder if this should only be done if we also start creating the temp dirs somewhere more reasonable?

I would vote for that if possible. Polluting the tests source code dir on a failure is not particularly harmful but ... unpleasant

I'm a bit worried about

using os.getcwd() for the location where temp dirs are created

the fact that sometimes temp dirs are not cleaned up (is this only when test run is cancelled? not sure)

after this PR probably creating more temp dirs in current dir (one per instance instead of one per class I guess?)

Yes, the side effect is that it will create one temp dir per class instance.

So I wonder if this should only be done if we also start creating the temp dirs somewhere more reasonable?

As I understand it, the idea is to have those temp files available for you on test failure for analysis.
Probably it will be better to choose a deterministic path where they can be found, but where should that be?
Maybe ~/tmp?

Does anyone know when the temp dirs are not being removed?

The doc says:
tearDown:
Method called immediately after the test method has been called and the result recorded.
This is called even if the test method raised an exception, so the implementation
in subclasses may need to be particularly careful about checking the internal state.
...
This method will only be called if the setUp() succeeds, regardless of the outcome
of the test method.

Again from the doc for tearDownClass:
If an exception is raised during a setUpClass then the tests in the class are not run and
the tearDownClass is not run.

Also again in the doc
Skipped tests will not have setUp() or tearDown() run around them.
Skipped classes will not have setUpClass() or tearDownClass() run.

I'm a bit worried about

using os.getcwd() for the location where temp dirs are created

the fact that sometimes temp dirs are not cleaned up (is this only when test run is cancelled? not sure)

after this PR probably creating more temp dirs in current dir (one per instance instead of one per class I guess?)

Yes, the side effect is that it will create one temp dir per class instance.

So I wonder if this should only be done if we also start creating the temp dirs somewhere more reasonable?

As I understand it, the idea is to have those temp files available for you on test failure for analysis.
Probably it will be better to choose a deterministic path where they can be found, but where should that be?
Maybe ~/tmp?

Does anyone know when the temp dirs are not being removed?

The doc says:
tearDown:
Method called immediately after the test method has been called and the result recorded.
This is called even if the test method raised an exception, so the implementation
in subclasses may need to be particularly careful about checking the internal state.
...
This method will only be called if the setUp() succeeds, regardless of the outcome
of the test method.

Again from the doc for tearDownClass:
If an exception is raised during a setUpClass then the tests in the class are not run and
the tearDownClass is not run.

Also again in the doc
Skipped tests will not have setUp() or tearDown() run around them.
Skipped classes will not have setUpClass() or tearDownClass() run.

As I understand it, the idea is to have those temp files available for you on test failure for analysis.
Probably it will be better to choose a deterministic path where they can be found, but where should that be?
Maybe ~/tmp?

Python has a function to get an OS appropriate, administrator configurable, temporary directory tempfile.gettempdir(). As well as providing functions to create directories within that host appropriate location: tempfile.mkdtemp(), and tempfile.TemporaryFile().

As I understand it, the idea is to have those temp files available for you on test failure for analysis.
Probably it will be better to choose a deterministic path where they can be found, but where should that be?
Maybe ~/tmp?

Python has a function to get an OS appropriate, administrator configurable, temporary directory tempfile.gettempdir(). As well as providing functions to create directories within that host appropriate location: tempfile.mkdtemp(), and tempfile.TemporaryFile().

Does anyone know when the temp dirs are not being removed?

Besides the expected case when tearDown is not called due to some error, I've noticed temp dirs not being removed on Windows with "being used by another process" error. Unfortunately, I can't say which is the process and I haven't observed this consistently in other environments.

Sorry for giving you a bit random hints and not direct answers but in the Windows case temporary files created by unittest_toolbox.Modified_TestCase.make_temp_data_file cannot be cleaned due to
PermissionError(13, 'This process cannot access the file because it is being used by another process').
But this is a Windows VM so it can be something specific to this case ...

Does anyone know when the temp dirs are not being removed?

Besides the expected case when tearDown is not called due to some error, I've noticed temp dirs not being removed on Windows with "being used by another process" error. Unfortunately, I can't say which is the process and I haven't observed this consistently in other environments.

Sorry for giving you a bit random hints and not direct answers but in the Windows case temporary files created by unittest_toolbox.Modified_TestCase.make_temp_data_file cannot be cleaned due to
PermissionError(13, 'This process cannot access the file because it is being used by another process').
But this is a Windows VM so it can be something specific to this case ...

Blocked, until we remove Python2 from our tests as Joshua has mentioned.
https://github.com/theupdateframework/tuf/pull/1224#issuecomment-738333840

After the removal of python2 test cases in https://github.com/theupdateframework/tuf/commit/13b085712f2b4b83fc2e7014c34016d55061ab7f
I rebased and updated this pr.

Honestly, I am wondering about this change.
On one hand, on a successful test run, we had generated multiple additional folders for each test class,
on another hand, on an error probably we will end up with many folders for each test class that failed, right?

I might have broken this PR quite badly with a recent bug fix (moved chained up teardown calls to the correct place in #1346 to fix issues found in another PR). Sorry about that -- I did not remember this one.
I think that PR also makes this one a bit less needed: at least in the tests that I touched I made sure that we only try to remove the "topmost" directory (because that will remove every other directory inside it). In some cases there might still be unneeded temp directories.
Let's discuss when you are back.

As I said before, I don't feel so confident about this change anymore.
I will just close it for now and if somebody complains about it in the future, I will reopen or push another one.

authors: MVrachev jku joshuagl sechkova

repo: theupdateframework/tuf


text:
Add chapters to the menu or to the content

Question from two universities in the Netherlands.
For example that the menu collaps when you click on it.

Not a high priority for me: the software should encourage lots of small LOs linked to from, say, a bootstrap page, rather than large LOs, though I appreciate it there are possible use cases that justify it.

@ronm123 @torinfo @ingedonke This is something that I will be developing in my new role. There will be a new optional property on every page that will mark it as the beginning of a new chapter & allow you to set the chapter title. Table of contents will show chapter titles and chapters can be expanded to show the pages within them. There will also be the option to show the table of contents on the sidebar instead of in a dialog or lightbox. Let me know if you have any concerns about this (can discuss on dev day)

Cool!!!

authors: FayCross ingedonke thexerteproject

repo: thexerteproject/xerteonlinetoolkits


text:
feat: add onbroad signin signup

add onbroad signin signup

Partial completed

authors: CodeForFunUIT thinhlh

repo: thinhlh/tech-ed


text:
Add "Easing Gradient" Figma plugin

This PR adds the "Easing Gradient" Figma plugin.

TY @matchai !!

authors: matchai thomas-lowry

repo: thomas-lowry/figma-plugins-on-github


text:
🛑 Microsoft Outlook is down

In ce81252, Microsoft Outlook (https://outlook.office.com) was down:

HTTP code: 417
Response time: 323 ms

Resolved: Microsoft Outlook is back up in 63cdf54 after 7 minutes.

repo: thomas-merz/upptime


text:
Generation of unique ID String?

Does this library support simple, generation of a unique device ID? From a cursory look, it seems like i can retrieve it. Also, with my existing solution i often will get back an empty ID, will this always successfully generate a device ID, what methods does it use?

The library supports many different methods to generate a unique device id. It depends on your need. You expect that you will get an Id every time. Have a look at the sources, to find out what fits best to. Maybe you can orientate your app on my example app for generating an id.
Best regards,
Thomas

authors: thomashaertel xbroak