text:
Add --show-mouse (-s) option.

Adds an optional command line argument to show the mouse in the output file.

Added a new option (--hide-mouse -e) and the cursor is now shown by default in the output file

My points remain: I would like only --hide-mouse as a long option, and the man page should be updated @Stronkkey

thank you for invoking my review @Stronkkey but I'm not a wf-recorder maintainer, just a happy user following its development :slightly_smiling_face:
As I mentioned in this comment and reiterated by @ammen99 in this other comment, it seems that the default behaviour of wf-recorder is to show the mouse pointer. As such I don't see a compelling reason to have both options:
-s, --show-mouse
--hide-mouse

The option to hide the mouse should be enough, IIUC. If a user wants to see the mouse cursor they will simply do nothing. I'd rather not change a default implicit behaviour (show the mouse cursor) to an explicit option, it's a breaking change that could surprise users.
I am also mildly against the short option -e because I feel it's not greatly self-explaining.
Other than that, this PR adds a feature I personally would not use but - hey - this is not my project so the maintainer will have the last word on accepting the patch or declining it :slightly_smiling_face:
In any case: thanks for taking the time to contribute to wf-recorder.

@ammen99 Ok so now the option to hide the mouse is gone (+rebased commits).
@apiraino Oops didn't notice.

Any update on the review?

@ammen99 Ok so now the option to hide the mouse is gone (+rebased commits).

I think something went wrong, because the option is still there when I go to the source file ..
Also, make sure to update the man page ;)

I'll pass on this on :sleeping:

authors: Stronkkey ammen99 apiraino michaelskyba


text:
Add configuration for Travis CI

This is my strong opinion and I hope it doesn't come across as an imposition: CI like this would have helped you realize that things were broken on Linux before cutting a 0.3 release! This is definitely YOUR crate, though, and it's your call whether or not this is appropriate for the development you do here. That's not a wrong decision either!
This Travis config is borrowed from the great-ci repo. Some functionalities you may not actually want even if you decide you want to accept this form of CI generally might be:

Code coverage analysis
Putting docs into a gh-pages branch

...which can easily be removed, no worries! 😄
This PR has a soft dependency on PR #9 -- N.B that CI will break without that pass. :)

Thanks @ErichDonGubler. Much appreciated. My dev env is OSX, so this is particularly helpful.

source: gharchive/pull-request

authors: ErichDonGubler amodm

repo: amodm/webbrowser-rs

license_type: permissive

license_source: bigquery


text:
_tee seems to have no effect

sh version: 1.12.13
In [13]: sh.curl('-I', 'example.com').stdout
Out[13]: b'HTTP/1.1 200 OK\r\nContent-Encoding: gzip\r\nAccept-Ranges: bytes\r\nCache-Control: max-age=604800\r\nContent-Type: text/html\r\nDate: Fri, 12 May 2017 04:09:21 GMT\r\nEtag: "359670651+gzip"\r\nExpires: Fri, 19 May 2017 04:09:21 GMT\r\nLast-Modified: Fri, 09 Aug 2013 23:54:35 GMT\r\nServer: ECS (ewr/15BD)\r\nX-Cache: HIT\r\nContent-Length: 606\r\n\r\n'

In [14]: sh.curl('-I', 'example.com', _out = sys.stdout, _tee = True).stdout
HTTP/1.1 200 OK
Content-Encoding: gzip
Accept-Ranges: bytes
Cache-Control: max-age=604800
Content-Type: text/html
Date: Fri, 12 May 2017 04:09:48 GMT
Etag: "359670651+gzip"
Expires: Fri, 19 May 2017 04:09:48 GMT
Last-Modified: Fri, 09 Aug 2013 23:54:35 GMT
Server: ECS (ewr/15BD)
X-Cache: HIT
Content-Length: 606

Out[14]: b''

the same behaviour occurs with _tee = 'out' too

This seems to only not be working with when a pipe or tty is passed to _out/_err, probably due to the fact that if that is the case, we os.dup2 the pipe/tty's file descriptor into the processes's stdout/stderr.  Meaning there is no way for us to intercept the data flowing from the process into the output handler, since it's connected directly.  This seems like a bug.  Thanks for reporting

Fixed on master, version 1.12.14

source: gharchive/issue

authors: amoffat fletom

repo: amoffat/sh

license: mit


text:
Enable Theme switching

User story

As a facility manager
I want to be able to switch between dark and light theme
So that I can choose the Theme that suits me best

Acceptance criteria

[x] User is able to switch between dark and light Theme

Definition of done (DoD)

[x] All acceptance criteria were met
[x] Pipeline is building successfully
[x] Unit/integration tests are passing
[x] Code has been reviewed and merged into the primary development branch

DoD general criteria

[x] Developers agreed to release
[x] Product owner approved features
[x] Feature has been fully implemented

Because I like to document: Lighttheme works perfectly by pressing the button in the bottom left. For this issue I just want to note that, while Alex of course did almost all the work, I supported for like 30minutes and helped with the decision where the button should be placed (so not on a separate page).

license: MIT

license_source: github-api


text:
api/auth/refresh does not check JTI blocklist

api/auth/refresh doesn't check JTI blocklist before refresh tokens

fixed in 0091718

fixed in 0091718

repo: amozebus/fastapi-beyond-crud


text:
feat: Atlassian JWT client

Adds a JWT client that can be used with Atlassian's Connect module
This client, for every request, generates a signed token based on the current time, the actual request and some fixed claim data (iss to be exact)
Note: The current connector ONLY supports issues though, so this will also only support issues for now.

I need to do more testing around writes, but reads work just like usual.
Test

[!WARNING]
This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

#1190  👈 (View in Graphite)
#1189
main

This stack of pull requests is managed by Graphite. Learn more about stacking.

I haven't added it because Lauren thinks that this is just a one-off, and not actually supporting it as an auth scheme by itself. Do we want to support providers with JWT as their primary authScheme? cc @laurenzlong

OK she explained it to me. I'm changing my review because I understand the exception.

repo: amp-labs/connectors


text:
Hot to resolve promises inside Loop::repeat() callback?

I need to call some function periodically with Loop::repeat() but inside this function I have some promises I need to resolve. From the examples it's not clear how to do that.
Can the callback yield?
		Loop::run(
			function (): void {
				Loop::repeat(
					$this->loopInterval,
					function () {
						$result = yield $this->callAsyncApi();
						// ...
					}
				);
			}
		);

Or can it return a Promise?
		Loop::run(
			function (): void {
				Loop::repeat(
					$this->loopInterval,
					function () {
						return call(function () {
							$result = yield $this->callAsyncApi();
							// ...
						});
					}
				);
			}
		);

Or should I do it using some other means?
How does it work in Loop::defer() callback?

defer and repeat work in the same way. choose the first variant, simply yield Promise inside Loop.

What happens if I don't throw an exception but instead yield it as a Failure? Does that end the eventloop too? Or if not, then what happens and how should I deal with it? When does it make sense to yield a Failure instance?

@enumag Yielding a failed promise (including failure) has the same effect as throwing the exception directly.

authors: Ejz enumag kelunik

repo: amphp/amp


text:
amp-story viewer does not display on mobile

The embedded amp story viewer disappears on mobile. This seems to effect every page that has this viewer. I don't know how many people actually read docs like this on there phone, but may be an issue.
edit: gif was too long to embed. Direct link is here: https://i.imgur.com/7tqlS7p.gifv

This is working as intended. As you said, not sure if there is a good way to embed a story on mobile. Closing this issue for now, please reopen if you have a good idea how to to this.

authors: calebcordry sebastianbenz

repo: ampproject/amp-by-example


text:
amp-accordion example does'nt work!

Powered by AMP ⚡ HTML – Version 1456954860788
AMP validation had errors:
https://ampbyexample.com/components/amp-accordion/:5:2 The attribute 'custom-element' in tag 'amp-access extension .js script' is set to the invalid value 'amp-accordion'. (see https://www.ampproject.org/docs/reference/extended/amp-access.html)
https://ampbyexample.com/components/amp-accordion/:1570:12 The tag 'amp-accordion' is disallowed.
https://ampbyexample.com/components/amp-accordion/:1571:4 The attribute 'expanded' may not appear in tag 'section'.
https://ampbyexample.com/components/amp-accordion/:1653:2 The tag 'amp-accordion' is disallowed.

Hi, have you tried to:

check the box under CDN experiments.

enter the following line in the Javascript console:
AMP.toggleExperiment('amp-accordion')

as suggested in the left top corner of the page?
For the validation errors, as suggested here: https://github.com/ampproject/amphtml/blob/master/extensions/amp-accordion/amp-accordion.md this tag is in experimentation so " no validation yet".

Thanks for the answer!
Yes, finally it works for me this way, but does it mean that I can't use it in production for my AMP site?
I came here from https://www.ampproject.org/docs/reference/extended/amp-accordion.html and it is marked as "Stable" there :\

You can't use it in production yet. Seems like the docs are out-of-sync. This one still says it's experimental. You can check here to see when it's in prod.

authors: dimanjy kul3r4 sebastianbenz


text:
Update Storybook to v2.24.0

Let's try a newer version of Storybook so it'll be easier to debug the issue

NOTE: this didn't fix the issue. I'm not near a computer at the moment. I'll check it out later.

license: unlicense


text:
Add tests to validate notebooks

Issue #, if available: #73
Description of changes: Tests that notebooks run. Doesn't test the validity of the output.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Codecov Report

Merging #207 into master will decrease coverage by 0.04%.
The diff coverage is 63.15%.

@@            Coverage Diff             @@
##           master     #207      +/-   ##
==========================================
- Coverage   89.47%   89.42%   -0.05%
==========================================
  Files         105      105
  Lines        2861     2876      +15
  Branches      292      293       +1
==========================================
+ Hits         2560     2572      +12
- Misses        249      251       +2
- Partials       52       53       +1

Impacted Files
Coverage Δ

...ukit/benchmarking/loop_benchmarking/benchmarker.py
0% <0%> (ø)
:arrow_up:

emukit/benchmarking/loop_benchmarking/metrics.py
93.33% <92.3%> (-0.42%)
: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 bb05a6e...cdd10d7. Read the comment docs.

Can you check what's going on here? Changes from benchmarking PR are now in here too for some reason

It needed a rebase, should  be fixed now.

Notebook tests seem to add around 5 minutes to the build. What do people think about that @apaleyes @javiergonzalezh @mmahsereci ? Mac builds are now 20 minutes and linux are 10 minutes.

I am fine with that, as long as we find a way to test all notebooks eventually. One obvious idea is to have a separate build run daily (or nightly), that runs full test suite, including all notebooks. Not ideal, but better than nothing.

authors: apaleyes codecov-io marpulli

repo: amzn/emukit


text:
About enabling run http server as daemon

I checked documentation , but i could not find something about that : after we run app as daemon then how can we stop it? Is there any specific command for it or should i kill the process by myself? Thanks in advance.

Yes, you should stop the app by killing the process.
And you also could use the app().quit() method triggered by some custom operations (e.g. by a special HTTP request) to stop the app.

Thank you again.
Maybe It would be better that manage all of daemon processes from drogon_ctl. Like :
drogon_ctl start daemon , drogon_ctl restart daemon ,drogon_ctl stop daemon  and even drogon_ctl list daemon.
And also could be added features to run on systemd or other system daemon managers.

@FFC12 Thanks for your suggestions, but drogon_ctl is not a system tool, and it is unaware of which drogon applications are built or installed in the current system, perhaps at least a common configuration file should be designed to achieve the interfaces you said.

Having drogon_ctl generate a systemd unit file seems like a reasonable idea.
BTW I just discovered Drogon yesterday and am highly intrigued. :)

Adding a handler for the TERM signal would also be good if there's not something like that already. And the ability to register functions for it to call.

@yodermk Good idea! I'll consider to implement it. Thanks.

@yodermk I've added the method for TERM signal.

authors: FFC12 an-tao yodermk

repo: an-tao/drogon


text:
Environment creation failed due to this package conflict and python 3.12 requirements

This package is setting python version constraint >=3.12, which makes it impossible to create base environment with python version less than 3.12.
Urgent fix will be helpful.

This actually is not a function of this source repo, which does not make such a constraint, but rather the channel that has hosted it.

repo: anaconda/anaconda-anon-usage


text:
Particle SystemのTriggersで使われてるColliderが消える

https://docs.unity3d.com/ja/2019.4/Manual/PartSysTriggersModule.html

実験結果から直接ついてるコライダーが使われるっぽい。子は含まれない


text:
Create a file structure if 'new' is passed as the first argument of the command

Do you want to request a feature or report a bug?
Feature
What is the current behavior?
Currently nothing happens when you pass in the new argument
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://jsfiddle.net or similar (template: https://jsfiddle.net/84v837e9/).
N/A
What is the expected behavior?
A new react app and structure should be created if I pass in new as the first argument
I.E if i type:
$ raise new awesome-app
Then I should get a bootstrapped react application
Which versions of react-raise, and which browser / OS are affected by this issue? Did this work in previous versions of  react-raise?
N/A
NB: You can drop a comment below for more clarification

Issue has been fixed

repo: andela-iamao/react-raise


text:
Feedback

What does this PR do?
This pull request was created to check houndCI
Description of Task to be completed?
refactor of code and ensure no houndCI flag is raised
How should this be manually tested?
npm test
Any background context you want to provide?
No background context
Screenshots (if appropriate)

Questions:
Not Applicable.

Changes Unknown when pulling 879cc6edb4feda276b95c2e1371477a086c58554 on feedback into ** on master**.

Changes Unknown when pulling fa86eb6d8f585e5ddfce1e62bf7cfb7e20818774 on feedback into ** on master**.

Changes Unknown when pulling 260f01e9da58c50c18415f4e098cbc7b9b2f4a18 on feedback into ** on master**.

Changes Unknown when pulling 6fcd4dc7ec0cb45fe423e8ae9bcc25f11a32c594 on feedback into ** on master**.

authors: andela-tisrael coveralls

repo: andela-tisrael/checkpoint-string-class


text:
Speed up when using fill_contiguous instead of draw_iter [experimental, rough]

Hi,
First up this is nowhere near mergeable - it's more of a feature request with a really rough example.
Here's a video of a worst-case-scenario GIF I've got running on a Pi Pico (clocked to 266Mhz)
Before:
https://github.com/andelf/tinygif/assets/2095051/d0dc7239-50b7-4adc-aa2a-d2cdccd90c1a
After:
https://github.com/andelf/tinygif/assets/2095051/59cfcc39-f098-4370-b148-e6e16df1be87
My GIF knowledge isn't good enough to work out what's going on with the offset pixels (it's probably something silly I've missed), and the DecodeIterWrapper can definitely be refactored into something faster / nicer.
There's another issue wherein GIFs do this:
https://github.com/andelf/tinygif/assets/2095051/4d51a145-f074-4fef-8ca6-068c814f8f87
Rather than (with the current version):
https://github.com/andelf/tinygif/assets/2095051/1aadc1cd-8e81-47dc-b54b-fa3e6557c27f
Which is presumably some sort of optimisation where the GIF only redraws a portion of the gif & would, presumably, require some sort of internal framebuffer approach
Assuming this even can be done in a way which works, if you changed to have it as default you would lose the ability to show GIFs with transparency & the upcoming interlace support, so you might want to do a different export or hide it behind a feature or something to maintain that feature.
This is the worst case scenario GIF I've been testing with by the way, can see from this that even the After is running slow

I'm probably not able to push this much further myself, but if you want to give it a go & need some additional help testing things then let me know.
Feel free to close this PR whenever.
Thanks

As a consumer-side workaround, drawing the GIF to a embedded_graphics_framebuf::FrameBuf is faster than drawing direct to the display - if you've got the RAM available.
Not quite as fast as doing a fill_contiguous to the display (or using some optimised internal frame buffer) would be though.

As a consumer-side workaround, drawing the GIF to a embedded_graphics_framebuf::FrameBuf is faster than drawing direct to the display - if you've got the RAM available.

Yes. Many display drivers(DrawTarget) implement fill_contiguous, which may be much faster than drawing pixel by pixel.

I had another think about this & I suspect there’s a decent solution where you add another export which the user passes the gif data & a heapless u8 vec which gets used as a color_index “framebuffer” internally.
Then it’d be a 2 stage process of filling the color_indexs to the framebuffer pixel by pixel (which should be fast & will skip over unchanged pixels) then using fill_contiguous on an iter of the framebuffer which maps the index to the actual colour.
Could panic if the vec isn’t big enough with a message saying so etc.
Would lose out only on transparent gifs (since fill_contiguous can never handle transparency, but get the speed improvement & use minimal RAM since it’s a u8 per-pixel rather than the actual full colour framebuffer the end user would have to use.

https://github.com/andelf/tinygif/assets/2095051/e81cb07d-441b-4880-8ae7-ae3383da1049
Just tried to implement an internal frame buffer, only realised at the end that there's a local colour table as well as a global one so it wasn't ever going to work with a u8 array. Used too much RAM too.
Think the embedded_graphics_framebuf::FrameBuf approach is probably the best for big GIFs
I've updated my branch with the internal framebuffer stuff incase there's anything of interest in there, but I'll close this PR off

repo: andelf/tinygif


text:
api loader

Yo, are there any examples of a loader in c++ curently?

Yo, are there any examples of a loader in c++ curently?

Hey there,
Unfortunately, I don't have a fully functional C++ loader, as I primarily work with other languages.
However, I can provide you with a snippet to get started.
Please note that I haven't tested this snippet, so you might need to adjust it.
Additionally, remember that this C++ code relies on the C++ REST SDK for HTTP requests and JSON handling.
I hope it helps you. ;)
#include <iostream>
#include <string>
#include <chrono>
#include <ctime>
#include <Windows.h>
#include <winreg.h>
#include <cpprest/http_client.h>
#include <cpprest/json.h>
#include <cpprest/uri.h>
#include <cpprest/asyncrt_utils.h>

using namespace std;
using namespace web;
using namespace web::http;
using namespace web::http::client;

const string DOMAIN = "anditv.dev";
const string SUB_DIR = "/panel/";
const string API_KEY = "yes";
const string VERSION = "1";

string get_machine_guid() {
    HKEY hKey;
    LPCSTR location = "SOFTWARE\\Microsoft\\Cryptography";
    LPCSTR name = "MachineGuid";
    char machine_guid[1024];
    DWORD size = sizeof(machine_guid);
    if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, location, 0, KEY_READ | KEY_WOW64_64KEY, &hKey) == ERROR_SUCCESS) {
        if (RegQueryValueExA(hKey, name, NULL, NULL, (LPBYTE)machine_guid, &size) == ERROR_SUCCESS) {
            RegCloseKey(hKey);
            return string(machine_guid);
        }
    }
    RegCloseKey(hKey);
    throw "Error getting machine GUID";
}

string send_login_request(string username, string password, string hwid) {
    string encoded_password = utility::conversions::to_base64(password);
    string encoded_hwid = utility::conversions::to_base64(hwid);

    uri_builder builder(U("https"), utility::conversions::to_string_t(DOMAIN));
    builder.append_path(utility::conversions::to_string_t(SUB_DIR + "api.php"));
    builder.append_query(U("user"), utility::conversions::to_string_t(username));
    builder.append_query(U("pass"), utility::conversions::to_string_t(encoded_password));
    builder.append_query(U("hwid"), utility::conversions::to_string_t(encoded_hwid));
    builder.append_query(U("key"), utility::conversions::to_string_t(API_KEY));

    http_client client(builder.to_uri());
    return client.request(methods::GET).get().extract_string().get();
}

int check_subscription(string sub) {
    if (sub.empty()) return 0;
    else {
        chrono::system_clock::time_point now = chrono::system_clock::now();
        time_t now_time = chrono::system_clock::to_time_t(now);
        tm current_time = *localtime(&now_time);
        tm subscription_date;
        istringstream(sub) >> get_time(&subscription_date, "%Y-%m-%d");
        return difftime(mktime(&subscription_date), mktime(&current_time)) / (60 * 60 * 24);
    }
}

int main() {
    string username, password;
    cout << "[Login] Username >> ";
    getline(cin, username);
    cout << "[Login] Password >> ";
    getline(cin, password);

    try {
        string hwid = get_machine_guid();
        string apiresult = send_login_request(username, password, hwid);
        auto json_result = json::value::parse(apiresult);

        if (json_result["status"].as_string() == "failed") {
            cout << "Username or password incorrect." << endl;
            this_thread::sleep_for(chrono::seconds(5));
            return EXIT_FAILURE;
        }

        if (json_result["Systemversion"].as_string() != VERSION) {
            cout << "You are using an outdated version." << endl;
            cout << json_result["Systemversion"].as_string() << endl;
            this_thread::sleep_for(chrono::seconds(5));
            return EXIT_FAILURE;
        }

        string system_status = json_result["Systemstatus"].as_string();
        if (system_status == "0") cout << "Status: Online" << endl;
        else if (system_status == "1") cout << "Status: Offline" << endl;
        else if (system_status == "2") cout << "Status: Maintenance" << endl;

        if (json_result["banned"].as_string() == "1") {
            cout << "Account is banned." << endl;
            this_thread::sleep_for(chrono::seconds(5));
            return EXIT_FAILURE;
        }
        else {
            cout << "Account is not banned." << endl;
        }

        cout << "You have " << check_subscription(json_result["sub"].as_string()) << " day/s sub left." << endl;

        if (hwid == json_result["hwid"].as_string()) {
            cout << "HWID does match." << endl;
        }
        else if (json_result["hwid"].is_null() || json_result["hwid"].is_empty()) {
            cout << "HWID does match." << endl;
        }
        else {
            cout << "HWID does not match." << endl;
            this_thread::sleep_for(chrono::seconds(5));
            return EXIT_FAILURE;
        }
    }
    catch (const exception& e) {
        cerr << "Error: " << e.what() << endl;
        this_thread::sleep_for(chrono::seconds(5));
        return EXIT_FAILURE;
    }

    return EXIT_SUCCESS;
}

Tysm ;3

There is a LOT of errors here. I'll fix them in a few hours and post them here for people to use.

#include
#include
#include
#include
#include <Windows.h>
#include <winreg.h>
#include
#include
#include <cpprest/http_client.h>
#include <cpprest/json.h>
#include <cpprest/uri.h>
#include <cpprest/containerstream.h>
#include <cpprest/producerconsumerstream.h>
using namespace std;
using namespace web;
using namespace web::http;
using namespace web::http::client;
const utility::string_t DOMENA = U("");
const utility::string_t SUB_DIR = U("/");
const utility::string_t API_KEY = U("yes");
const utility::string_t VERSION = U("1.0");
string base64_encode(const string& in) {
DWORD encodedLength = 0;
CryptBinaryToStringA(
reinterpret_cast<const BYTE*>(in.data()),
in.length(),
CRYPT_STRING_BASE64 | CRYPT_STRING_NOCRLF,
NULL,
&encodedLength
);
string out(encodedLength, '\0');
CryptBinaryToStringA(
	reinterpret_cast<const BYTE*>(in.data()),
	in.length(),
	CRYPT_STRING_BASE64 | CRYPT_STRING_NOCRLF,
	&out[0],
	&encodedLength
);

return out;

}
string send_login_request(string username, string password, string hwid) {
string encoded_password = base64_encode(password);
string encoded_hwid = base64_encode(hwid);
uri_builder builder(U("http://") + DOMENA);
builder.append_path(SUB_DIR + U("api.php"));
builder.append_query(U("user"), utility::conversions::to_string_t(username));
builder.append_query(U("pass"), utility::conversions::to_string_t(encoded_password));
builder.append_query(U("hwid"), utility::conversions::to_string_t(encoded_hwid));
builder.append_query(U("key"), utility::conversions::to_string_t(API_KEY));

http_client client(builder.to_uri());
std::wstring wstr = client.request(methods::GET).get().extract_string().get();
std::string str(wstr.begin(), wstr.end());
return str;

}
string get_machine_guid() {
HKEY hKey;
LPCSTR location = "SOFTWARE\Microsoft\Cryptography";
LPCSTR name = "MachineGuid";
char machine_guid[1024];
DWORD size = sizeof(machine_guid);
if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, location, 0, KEY_READ | KEY_WOW64_64KEY, &hKey) == ERROR_SUCCESS) {
if (RegQueryValueExA(hKey, name, NULL, NULL, (LPBYTE)machine_guid, &size) == ERROR_SUCCESS) {
RegCloseKey(hKey);
return string(machine_guid);
}
}
RegCloseKey(hKey);
throw runtime_error("Error getting machine GUID");
}
int check_subscription(string sub) {
if (sub.empty()) return 0;
else {
chrono::system_clock::time_point now = chrono::system_clock::now();
time_t now_time = chrono::system_clock::to_time_t(now);
tm current_time;
localtime_s(&current_time, &now_time);
tm subscription_date;
istringstream ss(sub);
if (ss >> get_time(&subscription_date, "%Y-%m-%d")) {
return difftime(mktime(&subscription_date), mktime(&current_time)) / (60 * 60 * 24);
}
else {
throw runtime_error("Error parsing subscription date");
}
}
}
int main() {
string username, password;
cout << "[Login] Username >> ";
getline(cin, username);
cout << "[Login] Password >> ";
getline(cin, password);
try {
	string hwid = get_machine_guid();
	string apiresult = send_login_request(username, password, hwid);
	auto json_result = json::value::parse(apiresult);

	if (json_result.at(U("status")).is_string() && utility::conversions::to_utf8string(json_result.at(U("status")).as_string()) == "failed") {
		cout << "Username or password incorrect." << endl;
		std::this_thread::sleep_for(std::chrono::seconds(5));
		return EXIT_FAILURE;
	}

	if (json_result.at(U("Systemversion")).is_string() && utility::conversions::to_utf8string(json_result.at(U("Systemversion")).as_string()) != utility::conversions::to_utf8string(VERSION)) {
		cout << "You are using an outdated version." << endl;
		cout << utility::conversions::to_utf8string(json_result.at(U("Systemversion")).as_string()) << endl;
		std::this_thread::sleep_for(std::chrono::seconds(5));
		return EXIT_FAILURE;
	}

	if (json_result.at(U("banned")).is_string() && utility::conversions::to_utf8string(json_result.at(U("banned")).as_string()) == "1") {
		cout << "User is banned." << endl;
		std::this_thread::sleep_for(std::chrono::seconds(5));
		return EXIT_FAILURE;
	}
	else {
		cout << "Account is not banned." << endl;
	}

	if (json_result.at(U("frozen")).is_string() && utility::conversions::to_utf8string(json_result.at(U("frozen")).as_string()) == "1") {
		cout << "License are frozen." << endl;
	}
	else {
		cout << "Licenses are not frozen." << endl;
	}

	if (json_result.at(U("Systemstatus")).is_string()) {
		string system_status = utility::conversions::to_utf8string(json_result.at(U("Systemstatus")).as_string());
		if (system_status == "0") {
			cout << "Status: Online" << endl;
		}
		else if (system_status == "1") {
			cout << "Status: Offline" << endl;
		}
		else if (system_status == "2") {
			cout << "Status: Maintenance" << endl;
		}
	}
	else {
		cout << "System status is not available." << endl;
	}

	auto subscription_days = check_subscription(utility::conversions::to_utf8string(json_result[U("sub")].as_string()));
	std::cout << "You have " << subscription_days << " day/s sub left." << std::endl;

	auto hwid_from_json = utility::conversions::to_utf8string(json_result[U("hwid")].as_string());
	if (hwid == hwid_from_json) {
		std::cout << "HWID does match." << std::endl;
	}
	else if (json_result[U("hwid")].is_null() || json_result[U("hwid")].as_string().empty()) {
		std::cout << "HWID does match." << std::endl;
	}
	else {
		std::cout << "HWID does not match." << std::endl;
		std::this_thread::sleep_for(std::chrono::seconds(5));
		return EXIT_FAILURE;
	}
}
catch (const std::exception& e) {
	cerr << "Error: " << e.what() << endl;
	std::this_thread::sleep_for(std::chrono::seconds(5));
	return EXIT_FAILURE;
}
cout << "Press ENTER to exit...";
cin.get();
return EXIT_SUCCESS;

}
Linker >> Input >> Additional Dependencies >> AdvAPI32.Lib and Crypt32.Lib.
C:\Program Files (x86)\Windows Kits\10\Lib\10.0.20348.0\um\x64\Crypt32.Lib
C:\Program Files (x86)\Windows Kits\10\Lib\10.0.20348.0\um\x64\AdvAPI32.Lib
^^ Their default location. Thank me later. You can put it as an example if you want too.

`#include
#include
#include
#include
#include <Windows.h>
#include <winreg.h>
#include
#include
#include <cpprest/http_client.h>
#include <cpprest/json.h>
#include <cpprest/uri.h>
#include <cpprest/containerstream.h>
#include <cpprest/producerconsumerstream.h>
using namespace std;
using namespace web;
using namespace web::http;
using namespace web::http::client;
const utility::string_t DOMENA = U("thlc2.xyz");
const utility::string_t SUB_DIR = U("/");
const utility::string_t API_KEY = U("yes");
const utility::string_t VERSION = U("1.1");
string base64_encode(const string& in) {
DWORD encodedLength = 0;
CryptBinaryToStringA(
reinterpret_cast<const BYTE*>(in.data()),
in.length(),
CRYPT_STRING_BASE64 | CRYPT_STRING_NOCRLF,
NULL,
&encodedLength
);
string out(encodedLength, '\0');
CryptBinaryToStringA(
	reinterpret_cast<const BYTE*>(in.data()),
	in.length(),
	CRYPT_STRING_BASE64 | CRYPT_STRING_NOCRLF,
	&out[0],
	&encodedLength
);

return out;

}
string send_login_request(string username, string password, string hwid) {
string encoded_password = base64_encode(password);
string encoded_hwid = base64_encode(hwid);
uri_builder builder(U("http://") + DOMENA);
builder.append_path(SUB_DIR + U("api.php"));
builder.append_query(U("user"), utility::conversions::to_string_t(username));
builder.append_query(U("pass"), utility::conversions::to_string_t(encoded_password));
builder.append_query(U("hwid"), utility::conversions::to_string_t(encoded_hwid));
builder.append_query(U("key"), utility::conversions::to_string_t(API_KEY));

http_client client(builder.to_uri());
std::wstring wstr = client.request(methods::GET).get().extract_string().get();
std::string str(wstr.begin(), wstr.end());
return str;

}
string get_machine_guid() {
HKEY hKey;
LPCSTR location = "SOFTWARE\Microsoft\Cryptography";
LPCSTR name = "MachineGuid";
char machine_guid[1024];
DWORD size = sizeof(machine_guid);
if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, location, 0, KEY_READ | KEY_WOW64_64KEY, &hKey) == ERROR_SUCCESS) {
if (RegQueryValueExA(hKey, name, NULL, NULL, (LPBYTE)machine_guid, &size) == ERROR_SUCCESS) {
RegCloseKey(hKey);
return string(machine_guid);
}
}
RegCloseKey(hKey);
throw runtime_error("Error getting machine GUID");
}
int check_subscription(string sub) {
if (sub.empty()) return 0;
else {
chrono::system_clock::time_point now = chrono::system_clock::now();
time_t now_time = chrono::system_clock::to_time_t(now);
tm current_time;
localtime_s(&current_time, &now_time);
tm subscription_date;
istringstream ss(sub);
if (ss >> get_time(&subscription_date, "%Y-%m-%d")) {
return difftime(mktime(&subscription_date), mktime(&current_time)) / (60 * 60 * 24);
}
else {
throw runtime_error("Error parsing subscription date");
}
}
}
int main() {
string username, password;
cout << "[Login] Username >> ";
getline(cin, username);
cout << "[Login] Password >> ";
getline(cin, password);
try {
	string hwid = get_machine_guid();
	string apiresult = send_login_request(username, password, hwid);
	auto json_result = json::value::parse(apiresult);

	if (json_result.at(U("status")).is_string() && utility::conversions::to_utf8string(json_result.at(U("status")).as_string()) == "failed") {
		cout << "Username or password incorrect." << endl;
		std::this_thread::sleep_for(std::chrono::seconds(5));
		return EXIT_FAILURE;
	}

	if (json_result.at(U("Systemversion")).is_string() && utility::conversions::to_utf8string(json_result.at(U("Systemversion")).as_string()) != utility::conversions::to_utf8string(VERSION)) {
		cout << "You are using an outdated version." << endl;
		cout << utility::conversions::to_utf8string(json_result.at(U("Systemversion")).as_string()) << endl;
		std::this_thread::sleep_for(std::chrono::seconds(5));
		return EXIT_FAILURE;
	}

	if (json_result.at(U("banned")).is_string() && utility::conversions::to_utf8string(json_result.at(U("banned")).as_string()) == "1") {
		cout << "User is banned." << endl;
		std::this_thread::sleep_for(std::chrono::seconds(5));
		return EXIT_FAILURE;
	}
	else {
		cout << "Account is not banned." << endl;
	}

	if (json_result.at(U("frozen")).is_string() && utility::conversions::to_utf8string(json_result.at(U("frozen")).as_string()) == "1") {
		cout << "License are frozen." << endl;
	}
	else {
		cout << "Licenses are not frozen." << endl;
	}

	if (json_result.at(U("Systemstatus")).is_string()) {
		string system_status = utility::conversions::to_utf8string(json_result.at(U("Systemstatus")).as_string());
		if (system_status == "0") {
			cout << "Status: Online" << endl;
		}
		else if (system_status == "1") {
			cout << "Status: Offline" << endl;
		}
		else if (system_status == "2") {
			cout << "Status: Maintenance" << endl;
		}
	}
	else {
		cout << "System status is not available." << endl;
	}

	auto subscription_days = check_subscription(utility::conversions::to_utf8string(json_result[U("sub")].as_string()));
	std::cout << "You have " << subscription_days << " day/s sub left." << std::endl;

	auto hwid_from_json = utility::conversions::to_utf8string(json_result[U("hwid")].as_string());
	if (hwid == hwid_from_json) {
		std::cout << "HWID does match." << std::endl;
	}
	else if (json_result[U("hwid")].is_null() || json_result[U("hwid")].as_string().empty()) {
		std::cout << "HWID does match." << std::endl;
	}
	else {
		std::cout << "HWID does not match." << std::endl;
		std::this_thread::sleep_for(std::chrono::seconds(5));
		return EXIT_FAILURE;
	}
}
catch (const std::exception& e) {
	cerr << "Error: " << e.what() << endl;
	std::this_thread::sleep_for(std::chrono::seconds(5));
	return EXIT_FAILURE;
}
cout << "Press ENTER to exit...";
cin.get();
return EXIT_SUCCESS;

}`
Linker >> Input >> Additional Dependencies >> AdvAPI32.Lib and Crypt32.Lib
Make sure to have cpprest installed and that's it
Their default location is
C:\Program Files (x86)\Windows Kits\10\Lib\10.0.20348.0\um\x64\Crypt32.Lib
C:\Program Files (x86)\Windows Kits\10\Lib\10.0.20348.0\um\x64\AdvAPI32.Lib

#include <iostream>
#include <string>
#include <chrono>
#include <ctime>
#include <Windows.h>
#include <winreg.h>
#include <thread>
#include <iomanip>
#include <cpprest/http_client.h>
#include <cpprest/json.h>
#include <cpprest/uri.h>
#include <cpprest/containerstream.h>
#include <cpprest/producerconsumerstream.h>

using namespace std;
using namespace web;
using namespace web::http;
using namespace web::http::client;

const utility::string_t DOMENA = U("thlc2.xyz");
const utility::string_t SUB_DIR = U("/");
const utility::string_t API_KEY = U("yes");
const utility::string_t VERSION = U("1.1");

string base64_encode(const string& in) {
	DWORD encodedLength = 0;
	CryptBinaryToStringA(
		reinterpret_cast<const BYTE*>(in.data()),
		in.length(),
		CRYPT_STRING_BASE64 | CRYPT_STRING_NOCRLF,
		NULL,
		&encodedLength
	);

	string out(encodedLength, '\0');
	CryptBinaryToStringA(
		reinterpret_cast<const BYTE*>(in.data()),
		in.length(),
		CRYPT_STRING_BASE64 | CRYPT_STRING_NOCRLF,
		&out[0],
		&encodedLength
	);

	return out;
}

string send_login_request(string username, string password, string hwid) {
	string encoded_password = base64_encode(password);
	string encoded_hwid = base64_encode(hwid);

	uri_builder builder(U("http://") + DOMENA);
	builder.append_path(SUB_DIR + U("api.php"));
	builder.append_query(U("user"), utility::conversions::to_string_t(username));
	builder.append_query(U("pass"), utility::conversions::to_string_t(encoded_password));
	builder.append_query(U("hwid"), utility::conversions::to_string_t(encoded_hwid));
	builder.append_query(U("key"), utility::conversions::to_string_t(API_KEY));

	http_client client(builder.to_uri());
	std::wstring wstr = client.request(methods::GET).get().extract_string().get();
	std::string str(wstr.begin(), wstr.end());
	return str;
}

string get_machine_guid() {
	HKEY hKey;
	LPCSTR location = "SOFTWARE\\Microsoft\\Cryptography";
	LPCSTR name = "MachineGuid";
	char machine_guid[1024];
	DWORD size = sizeof(machine_guid);
	if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, location, 0, KEY_READ | KEY_WOW64_64KEY, &hKey) == ERROR_SUCCESS) {
		if (RegQueryValueExA(hKey, name, NULL, NULL, (LPBYTE)machine_guid, &size) == ERROR_SUCCESS) {
			RegCloseKey(hKey);
			return string(machine_guid);
		}
	}
	RegCloseKey(hKey);
	throw runtime_error("Error getting machine GUID");
}

int check_subscription(string sub) {
	if (sub.empty()) return 0;
	else {
		chrono::system_clock::time_point now = chrono::system_clock::now();
		time_t now_time = chrono::system_clock::to_time_t(now);
		tm current_time;
		localtime_s(&current_time, &now_time);
		tm subscription_date;
		istringstream ss(sub);
		if (ss >> get_time(&subscription_date, "%Y-%m-%d")) {
			return difftime(mktime(&subscription_date), mktime(&current_time)) / (60 * 60 * 24);
		}
		else {
			throw runtime_error("Error parsing subscription date");
		}
	}
}
int main() {
	string username, password;
	cout << "[Login] Username >> ";
	getline(cin, username);
	cout << "[Login] Password >> ";
	getline(cin, password);

	try {
		string hwid = get_machine_guid();
		string apiresult = send_login_request(username, password, hwid);
		auto json_result = json::value::parse(apiresult);

		if (json_result.at(U("status")).is_string() && utility::conversions::to_utf8string(json_result.at(U("status")).as_string()) == "failed") {
			cout << "Username or password incorrect." << endl;
			std::this_thread::sleep_for(std::chrono::seconds(5));
			return EXIT_FAILURE;
		}

		if (json_result.at(U("Systemversion")).is_string() && utility::conversions::to_utf8string(json_result.at(U("Systemversion")).as_string()) != utility::conversions::to_utf8string(VERSION)) {
			cout << "You are using an outdated version." << endl;
			cout << utility::conversions::to_utf8string(json_result.at(U("Systemversion")).as_string()) << endl;
			std::this_thread::sleep_for(std::chrono::seconds(5));
			return EXIT_FAILURE;
		}

		if (json_result.at(U("banned")).is_string() && utility::conversions::to_utf8string(json_result.at(U("banned")).as_string()) == "1") {
			cout << "User is banned." << endl;
			std::this_thread::sleep_for(std::chrono::seconds(5));
			return EXIT_FAILURE;
		}
		else {
			cout << "Account is not banned." << endl;
		}

		if (json_result.at(U("frozen")).is_string() && utility::conversions::to_utf8string(json_result.at(U("frozen")).as_string()) == "1") {
			cout << "License are frozen." << endl;
		}
		else {
			cout << "Licenses are not frozen." << endl;
		}

		if (json_result.at(U("Systemstatus")).is_string()) {
			string system_status = utility::conversions::to_utf8string(json_result.at(U("Systemstatus")).as_string());
			if (system_status == "0") {
				cout << "Status: Online" << endl;
			}
			else if (system_status == "1") {
				cout << "Status: Offline" << endl;
			}
			else if (system_status == "2") {
				cout << "Status: Maintenance" << endl;
			}
		}
		else {
			cout << "System status is not available." << endl;
		}

		auto subscription_days = check_subscription(utility::conversions::to_utf8string(json_result[U("sub")].as_string()));
		std::cout << "You have " << subscription_days << " day/s sub left." << std::endl;

		auto hwid_from_json = utility::conversions::to_utf8string(json_result[U("hwid")].as_string());
		if (hwid == hwid_from_json) {
			std::cout << "HWID does match." << std::endl;
		}
		else if (json_result[U("hwid")].is_null() || json_result[U("hwid")].as_string().empty()) {
			std::cout << "HWID does match." << std::endl;
		}
		else {
			std::cout << "HWID does not match." << std::endl;
			std::this_thread::sleep_for(std::chrono::seconds(5));
			return EXIT_FAILURE;
		}
	}
	catch (const std::exception& e) {
		cerr << "Error: " << e.what() << endl;
		std::this_thread::sleep_for(std::chrono::seconds(5));
		return EXIT_FAILURE;
	}
	cout << "Press ENTER to exit...";
	cin.get();
	return EXIT_SUCCESS;
}

Make sure to go to linker >> Input >> Additional Dependencies and add Crypt32.Lib and AdvAPI32.Lib
Their default location is:
C:\Program Files (x86)\Windows Kits\10\Lib\10.0.20348.0\um\x64\Crypt32.Lib
C:\Program Files (x86)\Windows Kits\10\Lib\10.0.20348.0\um\x64\AdvAPI32.Lib
You can put it as an example if you want to.

Thanks a lot!


text:
add:dev: add prepublish hook

This ensures the project is built before it's being published.

@j-martin thanks! This was on my to-do list for this week. 😄

No problem!

authors: andjosh j-martin

repo: andjosh/clubhouse-cli


text:
Add extra tests for scrapy.http.request.form._get_form

Implement two additional test cases that tests scrapy.http.request.form._get_form and increases the current branch coverage of the function.

I realised that it is not necessarily the case that each function needs exactly two additional tests. Therefore, I have created a new issue (#9) mentioning that we need to add tests. That issue is just a placeholder, and when we have decided how many tests we need for each function, we can create specific issues for that.


text:
Any issues with Chrome for iOS?

We make use of oauth-ng in our app.  It seems to work fine everywhere except when running the app in Chrome on iOS.
Are there any known issues with using Chrome on iOS?
Thanks very much.

Hi @edamron, we didn't receive any issue about that.
I'll leave this open for a while and see if someone does

repo: andreareginato/oauth-ng


text:
🛑 SCHUNCK is down

In 66cf121, SCHUNCK (https://www.schunck.nl) was down:

HTTP code: 0
Response time: 0 ms

Resolved: SCHUNCK is back up in 0acaf17.

repo: andreesg/intk-upptime


text:
🛑 De Gevangenpoort is down

In 3b4135b, De Gevangenpoort (https://www.gevangenpoort.nl) was down:

HTTP code: 0
Response time: 0 ms

Resolved: De Gevangenpoort is back up in 789b54f.


text:
Fixed the libName that the jni Class tries to load being empty

This happened because the Reflection class was using RustJniExtension.libName directly, but the value could be empty since the libName can be obtained from Cargo.toml.
This use case is missed by the tests because they only test for cases where the rust library is generated by the plugin, so we need to add tests for when the rust library already exists.

I just published a 0.0.19 from here and I updated our samples to use that version. Android Studio does not find a 0.0.19, even if that appears on the grade portal. Maybe this refresh take some time. I will come back soon to check before merging it.
Thanks

repo: andrefigas/RustJNI


text:
🛑 Promo LF is down

In 8693c77, Promo LF (https://promo.lfcomprinhas.com.br) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Promo LF is back up in 95cc817.

repo: andrelug/uptime


text:
Typo's in the ReadMe

I have just seen your post on Reddit, It's come at a great time for me as I've just started using Asp.net Core WebApi. I'll be studying your code in detail over the next week or so.
For now I've spotted these typo's in the ReadMe.

In this project were applied the concepts of:

Suggestions for improvements are very welcome and if you find any bugs or have any questions just open an Issue and I'll take a look as soon as possible =)

Great work though, I've starred for future use!

Hello, Timmoth! Thanks for the reporting the typos, I fixed them in this new batch of adjusts.
Any questions, suggestions or bugs found, just open a new issue =)

authors: Timmoth andresantarosa

repo: andresantarosa/CleanArchitectureExample


text:
🛑 pharmacomms is down

In e458ec1, pharmacomms (https://pharmacomms.tv/) was down:

HTTP code: 0
Response time: 0 ms

Resolved: pharmacomms is back up in 277cc3d after 4 minutes.

repo: andrespitt/uptime


text:
🛑 plexd is down

In 6f5ab7e, plexd ($PLEXD) was down:

HTTP code: 401
Response time: 264 ms

Resolved: plexd is back up in 49e42f5.

repo: andrewdavies-net/upptime


text:
🛑 nhcam is down

In 4f16983, nhcam ($NHIPCAM) was down:

HTTP code: 0
Response time: 0 ms

Resolved: nhcam is back up in 3eb1eca.


text:
Provide buffer-local override for hard line length for particular filetypes

Currently if you flip from soft to hard and back, it goes back to the global line length.

I believe this is fixed in the newly-simplified plugin.

repo: andrewferrier/vim-wrapping-softhard


text:
calc_streak() doesn't actually take a data.frame

The Help for calc_streak() says:
x A data frame or character vector of hits ("H") and misses ("M").

But it won't actually work with a data frame argument.
kobe_basket %>% select(shot) %>% calc_streak()
Error in calc_streak(.) :
  Input should only contain hits ("H") and misses ("M")

Could it?

It could, but actually in the lab we have it use the $ operator, so it doesn't need to. Since it's a one off function just used in this lab, I am not sure if it's worth it to update, but let me know if you disagree.

authors: beanumber mine-cetinkaya-rundel

repo: andrewpbray/oilabs


text:
Configurable GOPATH

Hey, it would be nice if I could override the GOPATH environment variable from the default $HOME/go-work. Do you agree?

sounds reasonable. we'd have to migrate to a template and add a default var for the GOPATH subdir. do you feel comfortable making a pull request?

hehe, sure I'll give it a shot!

I tagged and release v1.0.5 of the role with your improvements to the galaxy. Thanks for your help!

authors: andrewrothstein xaniasd

repo: andrewrothstein/ansible-go


text:
Add support for the Gateway object

The functionality I'm looking for is to iterate over gateways and their data sources:
https://learn.microsoft.com/en-us/rest/api/power-bi/gateways/get-gateways
https://learn.microsoft.com/en-us/rest/api/power-bi/gateways/get-datasources
Thank you and keep doing the great job with this package!

@baruchoxman - Have added Gateways. Feel free to take a look and let me know if there's any issues. To install:
pip install git+https://github.com/andrewvillazon/pbipy@45-add-support-for-the-gateway-object

To retrieve the Gateways there is a couple of new methods on the pbi client object: PowerBI.gateway for a single gateway, and PowerBI.gateways for all Gateways. Both return Gateway objects which have a Gateway.datasources method for all attached datasources.

Thanks, that works, feel free to merge!

Merged and released in: v2.11.0

authors: andrewvillazon baruchoxman

repo: andrewvillazon/pbipy


text:
Allow glob in device and group specifiers of context aware attributes

Checklist

[x] I'm running the latest version of CustomUI (Update guide) or using a specific release that is not marked as "Broken".
[x] I tried to force-refresh (Ctrl+Shift+R / Ctrl+F5) the browser
[x] (Optional, but recommended) I'm using Chrome or tried to reproduce the feature on Chrome.

Browser + Version: 63.0.3239.40
CustomUI version: 20171117
Home Assistant release (hass --version): 0.58.1
Problem-relevant configuration.yaml entries:
domain.object_id:
  device:
    person_*:
      attr1: abc

  group:
    group.glob_*:
      attr2: def

It would be great to allow glob patterns in the selection of device / group names for the context override feature.

Fixed in 20171214 (Added regexp support)

authors: andrey-git mhofman

repo: andrey-git/home-assistant-custom-ui


text:
Is desktop windows application supported?

Hi Is desktop windows application supported by this library? because in documentation home page it featured windows tag

It's supported but unreliable in release mode. Sometimes it prints everything and cuts sometimes it does not.. Even on their Demo app. There is a bug somewhere in the code for Windows. I would not recommend it for production. Until it has been fixed.

yes it work with me
https://www.youtube.com/watch?v=ZjWOiXC3nIk


text:
Whitespaces doesn't expand textarea

Steps to reproduce:

open https://andreypopp.github.io/react-textarea-autosize/
start spamming spaces to any textarea

Expected results:
Textarea's height increases as you type more spaces.
Actual results:
Cursor disappears, nothing else happens.
I was able to track it down to textarea's actual height measurement at calculateNodeHeight.js#L79 just to find out that no matter what white-space value have hiddenTextarea, it's scrollHeight doesnt affected by trailing whitespaces. That's all I've got so far.

Does it differ from the plain in-browser textareas? I remember they behave quite inconsistently in the browsers regarding the white spaces - maybe this is not library's case but the browser's? Could you create a jsfiddle with your expected results achieved with just textarea?

I couldn't find a way to break overflowing trailing whitespace to newline without messing with textarea's value, and I guess the lib shouldn't do that. For now I believe there are no easy good solution. But maybe someone will pull out some clever trick (if the issue worth it).

@Andarist, on Chrome you can recreate the issue with the spacebar and the area where you write your Github comment. It seems that this is how browsers handle textareas by default.

Yeah, it seems so - it's not actionable on our side then. Closing this.
Thanks @chuntley for checking!

authors: Andarist chuntley kengho

repo: andreypopp/react-textarea-autosize


text:
nodemailer no longer working with Node 0.10.xx?

First of all, thank you for creating and maintaining this project. It served us well in the last months!
We observed that no more Emails were sent from our server last week after doing a new release which included a fresh 'npm install'.
OS: Ubuntu Server
Node version: 0.10.25
Transport: SMTP
There is no direct error after sending an email, the connection rather times out after a very long time with an 'ETIMEDOUT' error.
I tinkered around with this a bit on my local windows machine and found out, that the e-mails are sent out with Node 4.2.2, but not with Node 0.10.xx.
I saw some recent commits in the dependency project such as 'smtp-connection'. Can this have something to do with our issue?

UPDATE: I manually reverted the 'smtp-connection' to 1.3.1 and everything works fine again.

Are you using some special configuration? If I try to send mail with latest node v0.10 then everything seems to work as intended

'use strict';
var nodemailer = require('nodemailer');

var smtp = nodemailer.createTransport({
  host: 'our.email.host',
  port: 587,
  secureConnection: false,
  auth: {
    user: 'mail@ourdomain.com',
    pass: '12341234'
  }
});

smtp.sendMail({
  from: 'mail@ourdomain.com',
  to: ['s.metzger@ourdomain.com'], // An array if you have multiple recipients.
  subject: 'Test',
  text: 'Test 123 123 123'
}, function(err, info) {
  if (err) {
    console.log('ERROR SENDING MAIL');
    console.log(err);
  } else {
    console.log('EMAIL SENDING SUCCESS');
    console.log(info);
  }
});

Not really, above is the code of my test case.
It only works when I manually fix the dependency inside the nodemailer-smtp-transport module of smtp-connection to 1.3.1.

Which version of smtp-connection did you downgrade? Have you tried to use the latest, v1.3.6?

Yes, it did not work with v1.3.6
There is no error, the application just hangs and eventually times out. (after several minutes)
Might have to do with some mail server config?

The diff between 1.3.1 and 1.3.6 isn't that big (see here). I haven't been able to reproduce it myself (I tried against Gmail on port 587 where it worked fine with node v0.10.25), so it would be interesting to know what is causing the issue for you.

I have the same problem. Both nodemailer and and nodemailer-smtp-pool stopped working. When i downgraded to smtp-connection 1.3.1, it works.

Found the issue and published fixed version as v1.3.7. There's apparently a 'finish' event set for the socket, so when socket.removeAllListeners() was called for the plaintext socket when upgrading to TLS, the 'finish' event was also cleared and upgrade never finished. https://github.com/andris9/smtp-connection/commit/8fa722a3b207b6ea12484f900b206c658c388762


text:
来回切换，会造成activity 界面定在那里

来回切换，会造成activity 界面定在那里,用法一样的，捕获异常后，返回上页，再进再返回，页面定在那里。

你是怎么引入的？地址多少呀

repo: android-notes/Cockroach


text:
[Bug]: Run Preview on emulator/device not working for core:designsystem

Is there an existing issue for this?

[X] I have searched the existing issues

Is there a StackOverflow question about this issue?

[X] I have searched StackOverflow

What happened?
Android Studio version: Koala Feature Drop | 2024.1.2
Ref: 447cd7eba311c9cb4b4f302bf632fe8bd4e9784c (latest main branch as of this writing)
When trying to run a for example the NiaButtonPreview inside the core:designsystem package, I get this error:
Error: Run configuration NiaButtonPreview - Dark theme is not supported in the current project.
Cannot obtain the package.

The same issue appears for all the other previews in core:designsystem, but the previews in core:ui work fine.
Is this some limitation of Compose and/or Android Studio? As I can't really find any significant configuration changes between core:ui and core:designsystem, they both are direct dependencies of the app module.
Relevant logcat output
No response
Code of Conduct

[X] I agree to follow this project's Code of Conduct

I can't find any errors on it.

I think @andre-krueger is talking about this Run Preview action:

which shows the error in this panel:

Running the previews from the :app module seems to work fine though, so it could be a bug on the expected module type...

And here are the corresponding stacktraces:
Could not get applicationId for nowinandroid.core.designsystem.main. Project type: PROJECT_TYPE_LIBRARY

2024-09-14 10:06:44,209 [ 123860]   WARN - #com.android.tools.idea.run.GradleApplicationIdProvider - Could not get applicationId for nowinandroid.core.designsystem.main. Project type: PROJECT_TYPE_LIBRARY
java.lang.Throwable
	at com.android.tools.idea.run.GradleApplicationIdProvider.getPackageName(GradleApplicationIdProvider.kt:114)
	at com.android.tools.idea.execution.common.applychanges.BaseAction.getDisableMessage(BaseAction.java:211)
	at com.android.tools.idea.execution.common.applychanges.BaseAction.update(BaseAction.java:131)
	at com.android.tools.idea.execution.common.applychanges.CodeSwapAction.update(CodeSwapAction.java:62)
	at com.intellij.openapi.actionSystem.ex.ActionUtil$performDumbAwareUpdate$runnable$1.invoke(ActionUtil.kt:202)
	at com.intellij.openapi.actionSystem.ex.ActionUtil$performDumbAwareUpdate$runnable$1.invoke(ActionUtil.kt:196)
	at com.intellij.openapi.actionSystem.ex.ActionUtil.performDumbAwareUpdate(ActionUtil.kt:220)
	at com.intellij.openapi.actionSystem.impl.ActionUpdater$updateAction$success$1$1$1.invoke(ActionUpdater.kt:561)
	at com.intellij.openapi.actionSystem.impl.ActionUpdater$updateAction$success$1$1$1.invoke(ActionUpdater.kt:560)
	at com.intellij.openapi.actionSystem.impl.ActionUpdater$callAction$2$1.invoke(ActionUpdater.kt:155)
	at com.intellij.openapi.application.rw.InternalReadAction.insideReadAction(InternalReadAction.kt:104)
	at com.intellij.openapi.application.rw.InternalReadAction.access$insideReadAction(InternalReadAction.kt:15)
	at com.intellij.openapi.application.rw.InternalReadAction$tryReadCancellable$2.invoke(InternalReadAction.kt:94)
	at com.intellij.openapi.application.rw.InternalReadAction$tryReadCancellable$2.invoke(InternalReadAction.kt:93)
	at com.intellij.openapi.application.rw.CancellableReadActionKt.cancellableReadActionInternal$lambda$2$lambda$1$lambda$0(cancellableReadAction.kt:31)
	at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.tryRunReadAction(AnyThreadWriteThreadingSupport.kt:291)
	at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:965)
	at com.intellij.openapi.application.rw.CancellableReadActionKt.cancellableReadActionInternal$lambda$2$lambda$1(cancellableReadAction.kt:29)
	at com.intellij.openapi.progress.util.ProgressIndicatorUtilService.runActionAndCancelBeforeWrite(ProgressIndicatorUtilService.java:66)
	at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runActionAndCancelBeforeWrite(ProgressIndicatorUtils.java:155)
	at com.intellij.openapi.application.rw.CancellableReadActionKt.cancellableReadActionInternal(cancellableReadAction.kt:27)
	at com.intellij.openapi.application.rw.InternalReadAction.tryReadCancellable(InternalReadAction.kt:93)
	at com.intellij.openapi.application.rw.InternalReadAction.tryReadAction(InternalReadAction.kt:77)
	at com.intellij.openapi.application.rw.InternalReadAction.readLoop(InternalReadAction.kt:64)
	at com.intellij.openapi.application.rw.InternalReadAction.access$readLoop(InternalReadAction.kt:15)
	at com.intellij.openapi.application.rw.InternalReadAction$runReadAction$3.invokeSuspend(InternalReadAction.kt:35)
	at com.intellij.openapi.application.rw.InternalReadAction$runReadAction$3.invoke(InternalReadAction.kt)
	at com.intellij.openapi.application.rw.InternalReadAction$runReadAction$3.invoke(InternalReadAction.kt)
	at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:62)
	at kotlinx.coroutines.CoroutineScopeKt.coroutineScope(CoroutineScope.kt:261)
	at com.intellij.openapi.application.rw.InternalReadAction.runReadAction(InternalReadAction.kt:34)
	at com.intellij.openapi.application.rw.PlatformReadWriteActionSupport.executeReadAction(PlatformReadWriteActionSupport.kt:38)
	at com.intellij.openapi.application.ReadWriteActionSupport.executeReadAction$default(ReadWriteActionSupport.kt:15)
	at com.intellij.openapi.application.CoroutinesKt.constrainedReadActionUndispatched(coroutines.kt:82)
	at com.intellij.openapi.application.CoroutinesKt.readActionUndispatched(coroutines.kt:69)
	at com.intellij.openapi.actionSystem.impl.ActionUpdater$callAction$$inlined$useWithScope$1.invokeSuspend(trace.kt:163)
	at com.intellij.openapi.actionSystem.impl.ActionUpdater$callAction$$inlined$useWithScope$1.invoke(trace.kt)
	at com.intellij.openapi.actionSystem.impl.ActionUpdater$callAction$$inlined$useWithScope$1.invoke(trace.kt)
	at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:62)
	at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:163)
	at kotlinx.coroutines.BuildersKt.withContext(Unknown Source)
	at com.intellij.openapi.actionSystem.impl.ActionUpdater.callAction(ActionUpdater.kt:939)
	at com.intellij.openapi.actionSystem.impl.ActionUpdater.access$callAction(ActionUpdater.kt:85)
	at com.intellij.openapi.actionSystem.impl.ActionUpdater$updateAction$success$1$1.invokeSuspend(ActionUpdater.kt:560)
	at com.intellij.openapi.actionSystem.impl.ActionUpdater$updateAction$success$1$1.invoke(ActionUpdater.kt)
	at com.intellij.openapi.actionSystem.impl.ActionUpdater$updateAction$success$1$1.invoke(ActionUpdater.kt)
	at com.intellij.openapi.actionSystem.impl.ActionUpdater$updateAction$$inlined$retryOnAwaitSharedData$1.invokeSuspend(ActionUpdater.kt:939)
	at com.intellij.openapi.actionSystem.impl.ActionUpdater$updateAction$$inlined$retryOnAwaitSharedData$1.invoke(ActionUpdater.kt)
	at com.intellij.openapi.actionSystem.impl.ActionUpdater$updateAction$$inlined$retryOnAwaitSharedData$1.invoke(ActionUpdater.kt)
	at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:62)
	at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:163)
	at kotlinx.coroutines.BuildersKt.withContext(Unknown Source)
	at com.intellij.openapi.actionSystem.impl.ActionUpdater.updateAction(ActionUpdater.kt:979)
	at com.intellij.openapi.actionSystem.impl.ActionUpdater.expandGroupChild(ActionUpdater.kt:407)
	at com.intellij.openapi.actionSystem.impl.ActionUpdater.access$expandGroupChild(ActionUpdater.kt:85)
	at com.intellij.openapi.actionSystem.impl.ActionUpdater$doExpandActionGroup$2$expandResult$1$1.invokeSuspend(ActionUpdater.kt:334)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
	at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:111)
	at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:99)
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:608)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:873)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:763)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:750)

Unable to obtain test package

2024-09-14 10:07:17,842 [ 157493] SEVERE - #com.android.tools.idea.run.GradleApplicationIdProvider - [nowinandroid.core.designsystem] Unable to obtain test package.
com.android.tools.idea.run.ApkProvisionException: [nowinandroid.core.designsystem] Unable to obtain test package.
at com.android.tools.idea.run.GradleApplicationIdProvider.getTestPackageName(GradleApplicationIdProvider.kt:129)
at com.android.tools.idea.run.GradleApplicationIdProvider.getPackageName(GradleApplicationIdProvider.kt:98)
at com.android.tools.idea.run.AndroidRunConfigurationBase.validate(AndroidRunConfigurationBase.java:198)
at com.android.tools.idea.run.AndroidRunConfiguration.validate(AndroidRunConfiguration.kt:137)
at com.android.tools.idea.run.AndroidRunConfigurationBase.validate(AndroidRunConfigurationBase.java:137)
at com.android.tools.idea.compose.preview.runconfiguration.ComposePreviewRunConfiguration.validate(ComposePreviewRunConfiguration.kt:143)
at com.android.tools.idea.run.AndroidRunConfigurationBase.checkConfiguration(AndroidRunConfigurationBase.java:115)
at com.intellij.execution.impl.RunnerAndConfigurationSettingsImpl.checkSettings$lambda$10(RunnerAndConfigurationSettingsImpl.kt:359)
at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$OTelMonitor.callWrapped(NonBlockingReadActionImpl.java:840)
at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$OTelMonitor$MonitoredComputation.call(NonBlockingReadActionImpl.java:872)
at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.insideReadAction(NonBlockingReadActionImpl.java:604)
at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.attemptComputation(NonBlockingReadActionImpl.java:551)
at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.executeSynchronously(NonBlockingReadActionImpl.java:492)
at com.intellij.openapi.application.impl.NonBlockingReadActionImpl.executeSynchronously(NonBlockingReadActionImpl.java:220)
at com.intellij.execution.impl.RunnerAndConfigurationSettingsImpl.checkSettings(RunnerAndConfigurationSettingsImpl.kt:366)
at com.intellij.execution.impl.RunManagerImpl$Companion.canRunConfiguration(RunManagerImpl.kt:113)
at com.intellij.execution.impl.RunManagerImpl$Companion.canRunConfiguration(RunManagerImpl.kt:105)
at com.intellij.execution.impl.ExecutionManagerImpl.executeConfiguration$lambda$13$lambda$11(ExecutionManagerImpl.kt:742)
at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$OTelMonitor.callWrapped(NonBlockingReadActionImpl.java:840)
at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$OTelMonitor$MonitoredComputation.call(NonBlockingReadActionImpl.java:872)
at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.insideReadAction(NonBlockingReadActionImpl.java:604)
at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.lambda$attemptComputation$4(NonBlockingReadActionImpl.java:567)
at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.tryRunReadAction(AnyThreadWriteThreadingSupport.kt:291)
at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:965)
at com.intellij.openapi.progress.util.ProgressIndicatorUtils.lambda$runInReadActionWithWriteActionPriority$0(ProgressIndicatorUtils.java:93)
at com.intellij.openapi.progress.util.ProgressIndicatorUtilService.runActionAndCancelBeforeWrite(ProgressIndicatorUtilService.java:66)
at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runActionAndCancelBeforeWrite(ProgressIndicatorUtils.java:155)
at com.intellij.openapi.progress.util.ProgressIndicatorUtils.lambda$runWithWriteActionPriority$1(ProgressIndicatorUtils.java:138)
at com.intellij.openapi.progress.ProgressManager.lambda$runProcess$0(ProgressManager.java:98)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:217)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$13(CoreProgressManager.java:660)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:735)
at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:691)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:659)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:79)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:202)
at com.intellij.openapi.progress.ProgressManager.runProcess(ProgressManager.java:98)
at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runWithWriteActionPriority(ProgressIndicatorUtils.java:135)
at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runInReadActionWithWriteActionPriority(ProgressIndicatorUtils.java:93)
at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.attemptComputation(NonBlockingReadActionImpl.java:567)
at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.lambda$transferToBgThread$1(NonBlockingReadActionImpl.java:466)
at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.lambda$transferToBgThread$2(NonBlockingReadActionImpl.java:481)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Unknown Source)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Unknown Source)
at java.base/java.security.AccessController.doPrivileged(Unknown Source)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)

https://issuetracker.google.com/issues/366411894

authors: Jaehwa-Noh SimonMarquis andre-krueger

repo: android/nowinandroid


text:
MediaSessionService START_STICKY causes flaky restart behavior for apps with other foreground services

Media3 Version
Media3 1.0.2
Devices that reproduce the issue
Emulator API levels 27-33
Devices that do not reproduce the issue
Emulator API 26 & API 34 (Beta 3)
Reproducible in the demo app?
Not tested
Reproduction steps
Minimal repro project at https://github.com/bubenheimer/multifgsvcbugs
This project does not actually use MediaSessionService, but demonstrates the general problem. It has 2 START_STICKY services that, at times, are intended to run as foreground services. DataSyncService runs as a foreground service from onCreate() to onDestroy(), while SoundService does not initially run as a foreground service, but is intended to be running as a foreground service at various times. (The startForeground() code to make it a foreground service is commented out, it's not what I want to demonstrate here.) SoundService is meant to represent a MediaSessionService instance that is not currently running as a foreground service.

Start app.
Tap "Request POST_NOTIFICATIONS permission" for API 33+ (optional, to see foreground service notification).
Tap "Start data sync service".
Tap "Start sound service".
Simulate the system being under memory pressure and killing the process that the 2 services run in (org.bubenheimer:ext). I believe this corresponds to "am kill". There are various ways to do this. ("Force stop" is NOT one of them.) I prefer doing it from the "Device Explorer" tab in Android Studio Giraffe+ ("Kill process" under "Processes"), but it may be possible from Logcat as well. Or "kill -9".

Expected result
In Logcat, observe process being killed and recreated shortly thereafter, and DataSyncService and SoundService logging from onCreate().
Actual result
Intermittently DataSyncService is not restarted automatically, only SoundService is recreated. Sometimes other weird stuff happens, e.g. onCreate() followed by instant onDestroy()`.
This can take several app runs to show up.
This behavior is not really the fault of MediaSessionService, it's an Android framework bug (and seems fixed in API 34). The problematic thing in MediaSessionService is its use of START_STICKY, which is the primary thing triggering the behavior. Of course, an overriding MediaSessionService instance can choose to return whatever it wants from onStartCommand().
Returning START_NOT_STICKY generally helps avoid the issue, at least to some degree. (In my complex production services setup it does not clear up the problem, but it does help.)
Is the use of START_STICKY in MediaSessionService intentional and recommended? Or is it optional or arbitrary and can be replaced?
Does MediaSessionService use START_STICKY because it restores some saved state upon automatic recreation after process death? I have not seen this myself, but I'd be interested in a pointer if it does.
Having more than one foreground service in an app is not so common because they can usually be combined. However, MediaSessionService (and MediaBrowserService, MediaBrowserServiceCompat, etc.) does not lend itself to combining, because it generally is exported. (Also I'd think it is not really designed to be flexibly combined with arbitrary other services that have different bind/unbind/start/stop lifecycles.)
Media
N/A
Bug Report

[ ] You will email the zip file produced by adb bugreport to dev.exoplayer@gmail.com after filing this issue.

This issue has gained prominence for me while working on keeping my MediaSessionService instance running for longer stretches: https://github.com/androidx/media/issues/389#issuecomment-1570991990. I may need to revert to keeping it running only during active playback; in my production use case I actually get crashes due to the foreground state not being the way it should, it's not just services failing to start as in the repro here.

Also, in case someone ends up chatting with the framework team, it would be useful to get confirmation that this issue was specifically addressed in API 34 and not just avoided for now due to general refactoring. A (CTS?) test case similar my repro may help avoid future recurrence.
A more reliable workaround would be of interest, too, if available. Currently my production app still crashes prior to API 34 upon process kill/restore during active playback despite my best workaround efforts (MediaSessionService in foreground state, NOT_STICKY). I've used additional workarounds that seem to help, but so far nothing has completely prevented crashing.

One more potential workaround, at least in my case, may be to never run the MediaSessionService in the foreground, which, technically, I don't really need. However, would I still be able to use the special baked-in system media playback notification thingy in this case? It became even more baked in on recent API levels.

I think a decent way to address this issue would be adding a flag to MediaSessionService to control whether it should go to the foreground at all. I am aware that I can control this myself by completely taking over notification handling via onUpdateNotification(), but then I'd have to redo it all myself.
This flag would be needed (for now) whenever there already is another service controlling foreground behavior in an app, to help work around the framework bug. This suggest that it's general enough to be a part of the API. Even without the framework bug this can be architecturally desirable in an app to consolidate services controlling foreground behavior.
This actually is the behavior I used in the old version of my app based on MediaBrowserServiceCompat (NOT_STICKY & not foreground). I had forgotten about the "not foreground" part.

repo: androidx/media


text:
multiprocess+gevent + redis become slower

Version: redis==3.2.0 gevent==1.4.0
Platform: py2.7 ,   CentOS Linux release 7.4.1708
Description:
This is the synchronous code finish time log , get data very fast.
more log about  kline.zip
kline-log    Tue, 12 Mar 2019 01:41:03 ERROR    Total time running [coinbell_bc_btc_15] redis update_aug: 0.0138018131256 seconds
kline-log    Tue, 12 Mar 2019 01:41:03 ERROR    Total time running [coinbell_bc_btc_15] total kline aug: 0.0759608745575 seconds

This is the asynchronous code finish time log , get data even cost more than 1 sec. Sometimes will cost 4 or 5 sec
kline-log    Tue, 12 Mar 2019 01:51:03 ERROR    Total time running [coinbell_bc_btc_15] redis update_aug: 1.5217051506 seconds
kline-log    Tue, 12 Mar 2019 01:51:04 ERROR    Total time running [coinbell_bc_btc_15] total kline aug: 1.61521601677 seconds

My redis config  kwargs is the connect info just host db port and password. When use redis,  I will get the same redis instance by key from redis_pools
redis_max_connections = 4

def __redis_conn( **kwargs):
    return redis.StrictRedis(connection_pool=redis.ConnectionPool(
        max_connections=config.redis_max_connections,
        # socket_timeout=config.redis_socket_timeout,
        socket_keepalive=True,
        **kwargs
    ))

def _init_redis(platform_name, key, **kwargs):
    redis_pools['{}_{}'.format(platform_name, key)] = __redis_conn(**kwargs)

redis_pools = {}

for platform_name, setting in config.redis_config.iteritems():
    for key, c in setting.iteritems():
        _init_redis(platform_name.lower(), key.lower(), **c)

def _get_redis(platform_name, key):
    return redis_pools['{}_{}'.format(platform_name.lower(), key.lower())]

save_redis = partial(_get_redis, key="save")

My synchronous code
def kline(mod_name='coinbell', run_key='kline_aug:1w', table_name=None):
    while True:
        with t_with_time('finish kline aug', logger.get('kline-log').error):
            mod = util.import_mod("fibo_spider.kline_spiders.%s" % mod_name)
            spider = mod.spiders
            robot = spider(run_key)

            for s in robot:
                flag = True if table_name is None else s.table_name == table_name
                if flag:
                    print s
                    with t_with_time('{} finish kline aug'.format(s.table_name), logger.get('kline-log').error):
                        s.run()

My asynchronous code   I use gevent.poolin multiprocess to speed up
@func_time(logger.get("kline-log").error, "pool")
def pool_func(func, func_list):
    pool = Pool(50)
    try:
        for func_part in func_list:
            pool.add(gevent.spawn(func, func_part))
        pool.join()
    except Exception as e:
        raise

@func_time(logger.get("kline-log").error, "process")
def multi_process(func_part_list, process_num, run_func):
    if func_part_list:
        random.shuffle(func_part_list)
        process = []
        for func_part in util.split_list(func_part_list, process_num):
            # 加快统计效率
            p = Process(target=pool_func, args=(run_func, func_part))
            process.append(p)
            p.start()
        for pro in process:
            pro.join()
        del process[:]

def run(tar):
    tar.run()

def run_kline(program_name, func, key, module_list, process_num=8, run_func=run, wait=5):
    while True:
        try:
            with t_with_time('update-yaml', logger.get('kline-log').error):
                ParseYaml.update_coin_config(program_name)
            with t_with_time('update-func', logger.get('kline-log').error):
                func_par_list = func(key, module_list)
            if func_par_list:
                multi_process(func_par_list, process_num, run_func)
                logger.get("kline-log").info("{} multi_process finish".format(key))
                time.sleep(wait)
            else:
                time.sleep(4)
        except Exception as e:
            logger.get("kline-log").error(util.error_msg())

def get_kline_spider(key, module_list):
    k = []
    for name in module_list:
        with util.reload_mod(IMPORT_PATH_FORMAT % name) as mod:
            k_spider = getattr(mod, 'spiders', None)
            if k_spider:
                k.extend(k_spider(key))
    return k

@cli.command()
@click.argument('program_name')
@click.argument('key')
def aug(program_name, key):
    """更新K线到redis（全量增量）"""
    module_list = [program_name, ]
    spider_key = "kline_aug:{}".format(key)
    run_kline(program_name, get_kline_spider, spider_key, module_list, process_num=2, wait=1)

The important code   just run the run function
class KlineAug(BaseRedis):
    """更新K线到redis"""
    max_k_period = config.max_k_period

    # db = dao.kline()

    def __init__(self, platform_name, table_name, key, field=None, parse_data_func=None, run_key=None):
        super(KlineAug, self).__init__(platform_name, table_name, key, field, run_key=run_key)
        self.parse_data_func = parse_data_func
        self.key = util.redis_key(const.REDIS_KEY_PREFIX.KLINE, self.table_name[:self.table_name.rfind('_')])
        self.redis = dao.save_redis(platform_name)
        self.db = dao.kline(platform_name)
        self.info_db = dao.info(platform_name)

        self.stash = Stash('kline_{}_aug'.format(table_name))
        self.ticker_last_tid_key = 'trade_last_tid'
        self.update_kline_dt_flag = 'kline_update_dt'

    def _update_aug(self):
        key = self.src_key.replace('kline', 'trades')
        with t_with_time('[%s] redis update_aug' % (self.table_name,), logger.get('kline-log').error):
            trade = util.json_loads(util.decompress(self.src_redis.get(key)))
        if trade:
            last_tid = self.stash.get(self.ticker_last_tid_key)
            new_trade = trade[0]
            logger.get('kline-log').error('[{}] {} {}'.format(self.table_name, last_tid, new_trade))
            return last_tid != new_trade['tid'], new_trade
        return False, None

    def run(self, params=None):
        # data = self.src_redis.hget(self.src_key, self.src_field)
        # rows = util.json_loads(util.decompress(data))
        with t_with_time('[%s] total kline aug' % (self.table_name,), logger.get('kline-log').error):
            update_dt = self.stash.get(self.update_kline_dt_flag)
            if update_dt and not util.update_limit_dt(update_dt, config.kline_wait_sec):
                logger.get('kline-log').error(
                    '[{}] {} {}'.format(self.table_name, update_dt, config.kline_wait_sec))
                return
            is_updated, new_trade = self._update_aug()
            try:
                if is_updated:
                    with t_with_time('[%s] kline aug get db' % (self.table_name,), logger.get('kline-log').error):
                        rows = QS(self.db).table(getattr(T, self.table_name)).order_by(
                            F.timestamp, desc=True).limit(0, self.max_k_period).select('*')
                    if rows:
                        # rows = self.parse_data(data[-self.max_k_period:])
                        df = pd.DataFrame(rows)
                        df.sort_values('timestamp', inplace=True)
                        # df = df.iloc[-self.max_k_period:]
                        df['timestamp'] = df['timestamp'].apply(lambda x: x * 1000)
                        self.insert_data(df)
                        logger.get('kline-log').error(
                            '[{}] {} {}'.format(self.table_name, rows[-1]['close'], new_trade['price']))
                        if new_trade and rows[-1]['close'] == util.safe_decimal(new_trade['price']):
                            self.stash[self.ticker_last_tid_key] = new_trade['tid']
                            self.stash[self.update_kline_dt_flag] = util.nowdt()
                    else:
                        self.none_data()

                self.insert_info()
            except Exception:
                logger.get('kline-log').error(util.error_msg())

    def insert_info(self):
        if self.run_key:
            db = self.info_db
            # data_type, _ = self.src_key.split(':')
            platform, symbola, symbolb, _ = self.table_name.split('_')
            with transaction(db) as trans:
                QS(db).table(T.collect_info).insert({
                    'type': self.run_key.lower(),
                    'symbol': '{}_{}'.format(symbola, symbolb).lower(),
                    'time': util.now(),
                    'platform': platform.lower(),
                }, on_duplicate_key_update={
                    'time': util.now(),
                })
                trans.finish()

    def insert_data(self, df):
        last_key = str(self.src_field) + ":last"
        minute = self.src_field
        minute_data = util.compress(self._df2json(df))
        last_key_data = self._df2json(df.iloc[-1])
        with t_with_time('[%s] kline aug send redis' % (self.table_name,),
                         logger.get('kline-log').error):
            self.redis.hmset(self.key, {
                minute: minute_data,
                last_key: last_key_data,
            })

    def _df2json(cls, df):
        rows = df[['timestamp', 'open', 'high', 'low', 'close', 'volume']].values.tolist()
        return util.json_dumps(rows, default=str)

    def parse_data(self, data):
        return self.parse_data_func(data)

    def none_data(self):
        self.redis.delete(self.key)

Thanks for the report. Have you tried the same benchmark with prior versions of redis-py? Was the gevent version faster when testing in prior versions?

I have the same issue, @631068264 did you solve it?

Any solution?
redis==2.10.5
gevent==1.0.2
NewRelic report

You can solve the issue setting the "queue_class" param on the redis.BlockingConnectionPool using the Queue class provided by gevent

class redis.BlockingConnectionPool(max_connections=50, timeout=20, connection_class=<class 'redis.connection.Connection'>, queue_class=, **connection_kwargs)

from gevent.queue import Queue
BlockingConnectionPool(queue_class=Queue)
There are multiple queues classes, choose the one you like most
http://www.gevent.org/api/gevent.queue.html

Wonderful. Glad someone figured out a workaround. Thanks @gabomasi

authors: 631068264 andymccurdy gabomasi tapkain

repo: andymccurdy/redis-py


text:
Adding accordian and configurable fields from a document for display in collections list page.

In most of my use cases I am generally interested in looking at one field, which helps me find the document I want. So, this commit provides the flexibility of specifying a key name for every collection and databse in the config, whose corresponding value is shown in the list documents of collection view.
This also adds an accordian to the list so that more docs can be displayed in lesser space.

Wowsers!!!! That looks great!!!
Any chance you could add this to the documentation as well?

Sure.
Updated the documentation and created a new PR #117

Much appreciated @hemanthmalla!

Hey,
This merge broke my server.
in file collections.js:30:
var defaultKey = config.defaultKeyNames[dbName][collectionName] || '_id';

by default, i didn't change the configuration of defaultKeyNames in config.js, it's still an empty object,
hence you are running [collectionName] of undefined.

Merged! Thanks @rodikh!

authors: hemanthmalla rodikh wulfsolter

repo: andzdroid/mongo-express


text:
Add Rosetta V2 processing functionality

What is the purpose of this PR?
Closes #318.
How did you implement your changes
See #318.
Remaining issues

Need to clarify some of the gaus_rad and norm_const defaults
Need to clarify which variables we want to explicitly specify in the notebook, and which variables we want to leave as explicit params to functions
Need to get @HPiyadasa to test

@HPiyadasa do you have some example data I can do a Rosetta V2 run on?
Also, I think it'd be helpful to discuss which params we want to explicitly document for the user. I think some of the params (ex. percent_norm) should be explained (since you can set it to None to prevent normalization). However, others like output_channels I think are more self-explanatory.

@ngreenwald Hadeesha and I reviewed and made the desired changes to the V2 notebook in lab today. @HPiyadasa I did have to make one change from our discussion today:

norm_const does need to default to 1 for generate_rosetta_test_imgs, reason is because the call to rosetta.rescale_raw_imgs(img_out_dir) already normalizes the images in rosetta_testing_dir by 200.

@HPiyadasa OK the full process is ready for review now. One final question I had about the folder structure: do we want to separate out the compensation matrix/tiled image folder structure for round 1 like round 2 (separate compensation_matrices_round1 and tiled_images_round1 folders) for consistency?

This worked really nicely on Patricia's cohort @HPiyadasa!

Yeah you could.

@HPiyadasa OK the full process is ready for review now. One final question I had about the folder structure: do we want to separate out the compensation matrix/tiled image folder structure for round 1 like round 2 (separate compensation_matrices_round1 and tiled_images_round1 folders) for consistency?

Yeah you could.

@HPiyadasa OK the full process is ready for review now. One final question I had about the folder structure: do we want to separate out the compensation matrix/tiled image folder structure for round 1 like round 2 (separate compensation_matrices_round1 and tiled_images_round1 folders) for consistency?

Yeah you could.

Cool, I'll make a separate issue out of this.

authors: HPiyadasa alex-l-kong

repo: angelolab/toffy


text:
Error in initial_state.mem

Hello !
I have a problem to solve this error:

Based on the error message, I should check my code line in here:
# Create a blank state at the start of check function
initial_state = proj.factory.blank_state(addr=0x804846D, remove_options={simuvex.o.LAZY_SOLVES})

# The flag is a bit vector containing 30 bytes, each byte contains 8 bits
initial_state.mem[0x804B060] = initial_state.se.BVS('flag', 30*8)

# Setup return address
initial_state.mem[initial_state.regs.esp].dword = 0x8049A49

I still practice to use angr. I am so happy if there is someone who want to help me to solve this error.
Thank you.

Hi! If you're trying to store raw, untyped data, i.e. your flag bitvector, you don't want to use state.mem, you want to use state.memory. In this case, you should replace your second statement with initial_state.memory.store(0x804b060, initial_state.se.BVS('flag', 30*8).

Oh my God, It works, man!
Thank you so much. I really appreciate it.

No problem :)

repo: angr/simuvex


text:
Debugging Angular apps created with Angular CLI in WebStorm

[ ] 😎 Ser el próximo speaker
[ ] 😃 Proponer un tema
[x] 😋 Sugerir una idea/proyecto
[ ] 🤠 Convertirme en organizador
[ ] 🤕 Resolver una duda técnica
[ ] 🤡 Otro

Descripción
Saludos!
A las personas que usen WebStorm les recomiendo este articulo: https://blog.jetbrains.com/webstorm/2017/01/debugging-angular-apps/
Ya lo probé y funciona muy bien, espero les sirva!
Si alguien quiere usar WebStorm y no tiene licencia pero actualmente esta estudiando o tiene un correo de alguna universidad o institución educativa, se pueden registrar como estudiante y te dan una licencia por una año para usar todas las herramientas de JetBrains

¡Qué buena recomendación @oscardmg! Muchas gracias, WebStorm es uno de los mejores IDEs, me alegra que lo estés usando, dejaré este issue abierto un tiempo para que a las personas les pueda servir de referencia! 👌 🥇

authors: jdjuan oscardmg

repo: angular-medellin/meetup


text:
up/down arrow key issue with typeahead control

I have implemented typeahead control, By default in type ahead control they are not setting any max-height or height to list, but as per requirement i have to fix height of list to 110px. So, when we have longer list at a time only 4 data will be shown and rest can be seen by scrolling down.
Scrolling is working while user click on scroll up/down arrows, but it's not working with keyboard up/down keys.
The problem is explained in steps:

Type something i.e "a" to get data in typeahead (list will be populated)
Press down-arrow key (focus will be on list item)
Press down-arrow key 4-5 time to go further down () When we traverse down to list, scroll is not getting moved.
It always show top 4 items in list. Ideal behavior is it should shift.
User is able to scroll by clicking on scroll manually but with arrow key it's not scrolling.

Plunker link to to demonstrate problem: http://plnkr.co/edit/grrAxz158PTShzpxz2f0?p=preview

Looks like the same question and the same person. As it had a solution I'll link the answer here for future searchs.
http://stackoverflow.com/questions/27705490/up-down-arrow-key-issue-with-typeahead-control-angular-bootstrap-ui

Thanks for the link

how can i solve the problem using JQuery Please help me.

authors: MohamedHussainSha ankitdadhich karianna serraventura

repo: angular-ui/bootstrap


text:
Want latest ajs ui bs tabs on tabs-left to work with panel data to right side

We cant get out tab panel data to appear to the right of the tabs-left.  they in error appear below.
see attached file

+--------------+ +-------------------------------------+
|              | |                                     |
+--------------+ |                                     |
+--------------+ |                                     |
|              | |                                     |
+--------------+ |                                     |
|                                     |
|                                     |
|                                     |
|                                     |
+-------------------------------------+
+-------------+
|             |
+-------------+
+-------------+
|             |
+-------------+
+--------------------------------------------+
|                                            |
|                                            |
|                                            |
|                                            |
|                                            |
|                                            |
|                                            |
+--------------------------------------------+

This is complete rubbish. Come back when you are able to produce a solid issue description complete with plunkr.

authors: gtesslerge rvanbaalen


text:
Cannot read property 'noTransition' of undefined after upgrade to 0.13.0

Cannot read property 'noTransition' of undefined after upgrade to 0.13.0
function config($compileProvider) {
/*
When it is true then it run correctly.
When it is false then error
TypeError: Cannot read property 'noTransition' of undefined
*/
$compileProvider.debugInfoEnabled(false);
        }

Please visit:
http://plnkr.co/edit/xXSeaKXCxZvTl1bA6u2D?p=preview
Please correct this issue.

Closing as a duplicate of #3794.

authors: balaramm wesleycho


text:
Documentation for version 0.13.4

Hi Team,
First of all, thank you for your incredible works. I'm using angular-ui 0.13.4 and want to use Modal, but I couldn't find the documentation for that. The samples on https://angular-ui.github.io/bootstrap/ are for latest version, and I got error Unknown provider: $uibModalProvider. I think it due to different versions.
So could you please let me know how to view documentation for older version (0.13.4).
Thanks & Best Regards

Sorry, I found that option to select version.


text:
chore(docs): compilation for tooltip and popover

update doc for tooltip and popover to indicate the HTML returned by the
uib-*-html attribute will not be compiled.
address complaints in #4923.

screwed up rebase...


text:
fix(dropDown): removing keydown listener on close

This fixes the issue #6314

LGTM

authors: patricksmms wesleycho


text:
Dropdown should open UP instead of DOWN, when there is not enough space to render fully

When there is not enough space for dropdown to render fully, it should be rendered to the top of the element, as it is default behaviour for select2.

+1

+1 - I would enjoy being able to also force it to render upwards always, if possible.

+1

+1

+1

+1

This would definitely be nice to have.
This could also be a solution for the list falls behind overflow:hidden or overflow:auto containers #591.
"move drop down to base of  to stop it from being cut off (drop.js) #591"

Might want to update the milestone here if this hasn't been addressed yet.

do want

I've created a PR with code that adds an up direction depending on how much vertical space is left for rendering.  This works well for my local build.
Feel free to try it out on your own builds and upvote the PR if it works for you!

:+1:

:+1:
Just a simple question: As this issue is 9 months old, should I

wait hoping that you're going to fix/merge the PR soon
fork this repo (which I really don't want..)

?
Thanks!

@cyrilf brianfeister self-assigned PR #836 about 10 days ago, so it may get merged soon.  Maybe you can leave a comment in the PR itself to generate more activity.

Merged! Thanks again @JeromeLam :wink:

@JeromeLam, hi
offsets calculated wrong when I have scroll on "body" element instead of "html"
offset.top + offset.height + offsetDropdown.height > $document[0].documentElement.scrollTop + $document[0].documentElement.clientHeight
should be replaced with
offset.top + offset.height + offsetDropdown.height > $document[0].documentElement.scrollTop + $document[0].body.scrollTop + $document[0].documentElement.clientHeight

Same issue as @SerjoPepper -- and btw thanks for commenting the issue

Looks like if you use ui-select inside directives, on Chrome browsers the dropdown always goes up instead of dropping down.

@kwantopia I'm having the same issue

Is there any option/setting to disable this feature?

same question than  @danduh : Is there any option/setting to disable this feature?

Seeing the same issue as @kwantopia in Chrome, doing my head in. Any suggested fix?

Would love the ability to force it to always open down. Currently it's opening up no matter what I do.

@hyrumwhite +1

@hyrumwhite +1

@hyrumwhite +1

Same issue here, inside a modal, it always opens up and goes slightly out of the window. Would like to force 'direction-down'.

+1

with @calwi , please add the ability to force 'direction-down'

@hyrumwhite +1

with @hyrumwhite and @calwi  and @pgeez I also want to force either direction-down or direction-up.

I also really need the option to force "direction-down".

Related to https://github.com/angular-ui/ui-select/pull/1212

Just for anyone who found this issue looking for a way to force dropdowns to go down, this is now possible with #1213 :relaxed: - you just need to add position='down' to your <ui-select-choices> or globally:
yourApp.config(function(uiSelectConfig) {
  uiSelectConfig.dropdownPosition = 'down';
})

@alexpeattie :+1: thanks

select2 dropdown position want to down only display

authors: ArulselviArangasamy BunsenMcDubbs FFelling JeromeLam JoshSGman ManuelPutallaz SerjoPepper alexpeattie andywunderlich anonomis calwi cyrilf danduh dimirc fxck gitnik greenwebdev hyrumwhite jraguilo kedarbe kwantopia np82 onemenny oshai pgeez rachellej sbedulin sdir456 seiyria slavinskas tandrianoff vladferix wald-tq

repo: angular-ui/ui-select