text:
ansible: replace ciao-compute and ciao-network with ciao-launcher role

There is no need to have separate roles for ciao-compute and ciao-network since both are
starting the same binary. The role gets determined by the certificate

If the ansible scripting will do any node prerequisite software install/setup (versus osprepare in the binary), then we should keep two roles.  The network nodes only run VM appliances, not containers.  This means no need to install all of the container management system dependencies on those nodes and decreases the security attack surface of those nodes.

ciao-launcher role would have a way to differentiate between a network node and a controller node either with a variable or checking if the host is under [computes] or [networks] group in the inventory file.

source: gharchive/issue

authors: albertomurillo tpepper

license_type: permissive

license_source: github-api


text:
ssntp/certs: Add handling for certificate requests

This PR provides the certificate request and signing framework that enables the new deployment tooling. Although the deployment tooling is still complete the commits herein are mature enough to be ready to merge in preparation. The functionality is covered by a newly added unit test.

Coverage decreased (-0.01%) to 65.771% when pulling ea4ef07fdddc18e8473f8ab6e766c5d65b52290e on rbradford:ssntp-cert-request into d521860ec96c7f7881285817d7881c6b75ea9862 on 01org:master.

@markdryan All changes done. Thanks!

Coverage decreased (-0.01%) to 65.789% when pulling d9e37befca9d22cd5aaf129144bea164d5cd6cd5 on rbradford:ssntp-cert-request into 2df9eaab55bb51ef664de88133d3403c89eec693 on 01org:master.

Coverage decreased (-0.01%) to 65.789% when pulling d9e37befca9d22cd5aaf129144bea164d5cd6cd5 on rbradford:ssntp-cert-request into 2df9eaab55bb51ef664de88133d3403c89eec693 on 01org:master.

source: gharchive/pull-request

authors: coveralls rbradford


text:
initramfs-framework-ima: run head with busybox-friendly options.

Run head with the more standard option of -n 1 instead of -1 as
the latter is not understood by busybox.

Looks sane and the failure in Jenkins is unrelated -> merging.

authors: klihub pohly

license: mit

license_source: bigquery


text:
Update tpm2_rc_decode

short argument for the version

Good catch. Pushed with a few changes:

Added a more complete commit message
Removed unnecessary changes to the license header
Removed unnecessary changes to the help message

authors: DamienMolina flihp


text:
remove non-wpa targets and update README

I'm abandoning hybrid apps and focusing on pwa apps (where it makes sense, like in this calculator). It needs some cleanup and simplification.

Fixed in 8148242a4dff7be5c4eada30998247485d48fdf4


text:
Error: local variable 'can_swap' referenced before assignment

I try to use peewee async with peewee proxy:
import peewee
from peewee_async import Manager, PostgresqlDatabase

_database = peewee.Proxy()

class BaseModel(peewee.Model):
    class Meta:
        database = _database

class KeyValue(BaseModel):
    key = peewee.CharField(max_length=40, unique=True)
    value = peewee.TextField(default='')

def init_database(database=None, loop=None):
    if not database:
        database = PostgresqlDatabase('test')

    _database.initialize(database)

    # create table synchronously
    KeyValue.create_table(True)
    database.close()

    manager = Manager(database, loop=loop)
    # disable any future syncronous calls
    # raise AssertionError on ANY sync call
    manager.database.allow_sync = False

    return manager, KeyValue

Test:
from asyncio import new_event_loop
from models import init_database

def test_sync():
    loop = new_event_loop()
    models, KeyValue = init_database(loop=loop)

    async def handler(key='qwe', value='qwe'):
        obj = await models.create(KeyValue, key=key, value=value)
        return obj

    r = loop.run_until_complete(handler())

Result:
$ python -m pytest
====================================================================================== test session starts ======================================================================================
platform darwin -- Python 3.5.1, pytest-3.0.3, py-1.4.31, pluggy-0.4.0
rootdir: /Users/pahaz/PycharmProjects/ructfe-2016/services/cross-social-science, inifile:
collected 3 items

test_models.py F

=========================================================================================== FAILURES ============================================================================================
___________________________________________________________________________________________ test_sync ___________________________________________________________________________________________

    def test_sync():
        loop = new_event_loop()
        models, KeyValue = init_database(loop=loop)

        async def handler(key='qwe', value='qwe'):
            obj = await models.create(KeyValue, key=key, value=value)
            return obj

>       r = loop.run_until_complete(handler())

test_models.py:18:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/lib/python3.5/asyncio/base_events.py:337: in run_until_complete
    return future.result()
/usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/lib/python3.5/asyncio/futures.py:274: in result
    raise self._exception
/usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/lib/python3.5/asyncio/tasks.py:239: in _step
    result = coro.send(None)
test_models.py:15: in handler
    obj = await models.create(KeyValue, key=key, value=value)
../../../../.virtualenvs/cross-social-science/lib/python3.5/site-packages/peewee_async.py:177: in create
    pk = yield from self.execute(query)
../../../../.virtualenvs/cross-social-science/lib/python3.5/site-packages/peewee_async.py:264: in execute
    query = self._swap_database(query)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <peewee_async.Manager object at 0x11002b1d0>, query = <class 'models.KeyValue'> INSERT INTO "keyvalue" ("key", "value") VALUES (%s, %s) RETURNING "id" ['qwe', 'qwe']

    def _swap_database(self, query):
        """Swap database for query if swappable. Return **new query**
            with swapped database.

            Check manager database and model database match. If model
            database is `auto`, manager's one will be used.

            If query database can't be swapped and differs from manager's
            database, it's **WRONG AND DANGEROUS**, so assertion is raised.
            """
        if query.database == self.database:
            return query
        elif self._subclassed(peewee.PostgresqlDatabase,
                              query.database,
                              self.database):
            can_swap = True
        elif self._subclassed(peewee.MySQLDatabase,
                              query.database,
                              self.database):
            can_swap = True

>       if can_swap:
E       UnboundLocalError: local variable 'can_swap' referenced before assignment

../../../../.virtualenvs/cross-social-science/lib/python3.5/site-packages/peewee_async.py:367: UnboundLocalError

@pahaz Hello!
It's designed that so Manager instance and Model should be initialized with the same database instance.
So this should work:
manager = Manager(_database, loop=loop)
database .set_allow_sync(False)

authors: pahaz rudyryk

license: MIT


text:
🛑 QR Event is down

In a594a6b, QR Event (https://qr.unej.ac.id) was down:

HTTP code: 404
Response time: 1336 ms

Resolved: QR Event is back up in 111c0e0 after 14 hours, 58 minutes.


text:
🛑 MMP is down

In 2dab4b4, MMP (https://mmp.unej.ac.id) was down:

HTTP code: 0
Response time: 0 ms

Resolved: MMP is back up in 62e7159 after 32 minutes.


text:
🛑 SIREMUN is down

In 6aa2c73, SIREMUN (https://siremun.unej.ac.id) was down:

HTTP code: 0
Response time: 0 ms

Resolved: SIREMUN is back up in aa34138 after 12 minutes.


text:
add home link for mobile screens in lioness project

solved issue #40
I've made your Lioness project's navigation more responsive for small screens. It now features a hamburger menu for easy access to the "Home" button on mobile devices. I've added screen shots to illustrate these changes. Please have a look and let me know if you have any further questions or need additional assistance.

Nicely done! And thanks !

thank you !


text:
Plugin completely crashes from device all of a sudden

Prerequisite

[X] Yes, I've read the readme completely.

Cache

[X] Yes, I've cleaned accessory cache and the issue still exists.

Version
1.7.0-beta.54
Device Infomation JSON File
Not available

Device Control Mode
None
Logs
[11/3/2024, 11:49:43 PM] Homebridge v1.8.5 (HAP v0.12.3) (Homebridge 819E) is running on port 51274.
[11/3/2024, 11:49:43 PM]

NOTICE TO USERS AND PLUGIN DEVELOPERS
> Homebridge 2.0 is on the way and brings some breaking changes to existing plugins.
> Please visit the following link to learn more about the changes and how to prepare:
> https://github.com/homebridge/homebridge/wiki/Updating-To-Homebridge-v2.0

[11/3/2024, 11:49:45 PM] [Tuya] [TuyaOpenAPI] Response:
path = /v1.0/iot-01/associated-users/actions/authorized-login
data = {
  "result": {
    "access_token": "XXXXXXXXXXXX",
    "expire_time": 7200,
    "platform_url": "https://openapi.tuyaeu.com",
    "refresh_token": "XXXXXXXXXXXX",
    "uid": "eu1693254885394qufBT"
  },
  "success": true,
  "t": 1730670585276,
  "tid": "8a0c80419a2d11ef894136243096d294"
}
[11/3/2024, 11:49:45 PM] [Tuya] Start MQTT connection.
[11/3/2024, 11:49:45 PM] [Tuya] Fetching home list.
[11/3/2024, 11:49:45 PM] [Tuya] [TuyaOpenAPI] Request:
method = post
endpoint = https://openapi.tuyaeu.com
path = /v1.0/iot-03/open-hub/access-config
query = null
headers = {
  "t": "1730670585641",
  "client_id": "XXXXXXXXXXXX",
  "nonce": "d0eb8e73-cd00-48dd-8235-029679a8f92a",
  "Signature-Headers": "client_id",
  "sign": "B992E65D03077E564B5CB184DD4A99AF56E5DD088E3C2E3192260D5157CF78BE",
  "sign_method": "HMAC-SHA256",
  "access_token": "XXXXXXXXXXXX",
  "lang": "en",
  "dev_lang": "javascript",
  "dev_channel": "homebridge",
  "devVersion": "1.7.0-beta.54"
}
body = {
  "uid": "eu1693254885394qufBT",
  "link_id": "04de9f54-2fc8-4888-b16c-fb7cd1ef08a9",
  "link_type": "mqtt",
  "topics": "device",
  "msg_encrypted_version": "1.0"
}
[11/3/2024, 11:49:45 PM] [Tuya] [TuyaOpenAPI] Request:
method = get
endpoint = https://openapi.tuyaeu.com
path = /v1.0/users/eu1693254885394qufBT/homes
query = undefined
headers = {
  "t": "1730670585643",
  "client_id": "XXXXXXXXXXXX",
  "nonce": "2d2d9b7b-1e34-4893-b8a8-6dcf37be4486",
  "Signature-Headers": "client_id",
  "sign": "0B47FA12B2D38405F890989F265599CDA6AB40BBC55FAABCCA16F2BB620755DD",
  "sign_method": "HMAC-SHA256",
  "access_token": "XXXXXXXXXXXX",
  "lang": "en",
  "dev_lang": "javascript",
  "dev_channel": "homebridge",
  "devVersion": "1.7.0-beta.54"
}
body = null
[11/3/2024, 11:49:45 PM] [Tuya] [TuyaOpenAPI] Response:
path = /v1.0/iot-03/open-hub/access-config
data = {
  "result": {
    "client_id": "cloud_newa89fd52ebd6add44e842cdf169f6efdb",
    "expire_time": 7200,
    "password": "XXXXXXXXXXXX",
    "sink_topic": {
      "device": "cloud/token/out/{device_id}"
    },
    "source_topic": {
      "device": "cloud/token/in/new7d5d31af85cdfe9ccc01e027b034965e"
    },
    "url": "ssl://m1.tuyaeu.com:8883",
    "username": "cloud_new7d5d31af85cdfe9ccc01e027b034965e"
  },
  "success": true,
  "t": 1730670585712,
  "tid": "8a54cd309a2d11efbfa92a8db75a9554"
}
[11/3/2024, 11:49:45 PM] [Tuya] [TuyaOpenAPI] Response:
path = /v1.0/users/eu1693254885394qufBT/homes
data = {
  "result": [
    {
      "geo_name": "Kalaniyot Commercial Center Ashdod",
      "home_id": 164818273,
      "lat": 31.783594190070936,
      "lon": 34.65404930312776,
      "name": "Yakinton",
      "role": "OWNER"
    }
  ],
  "success": true,
  "t": 1730670585900,
  "tid": "8a7317809a2d11efbfa92a8db75a9554"
}
[11/3/2024, 11:49:45 PM] [Tuya] Got home_id=164818273, name=Yakinton
[11/3/2024, 11:49:45 PM] [Tuya] Fetching device list.
[11/3/2024, 11:49:45 PM] [Tuya] [TuyaOpenAPI] Request:
method = get
endpoint = https://openapi.tuyaeu.com
path = /v1.0/homes/164818273/devices
query = undefined
headers = {
  "t": "1730670585947",
  "client_id": "XXXXXXXXXXXX",
  "nonce": "93fd7300-fccb-4a43-bb0f-b561c17a8de0",
  "Signature-Headers": "client_id",
  "sign": "EF3C6CA3F8B0D2D9E87CDB7542E9E53EDFAD687CA1559204E07738076E7C56A2",
  "sign_method": "HMAC-SHA256",
  "access_token": "XXXXXXXXXXXX",
  "lang": "en",
  "dev_lang": "javascript",
  "dev_channel": "homebridge",
  "devVersion": "1.7.0-beta.54"
}
body = null
[11/3/2024, 11:49:46 PM] [Tuya] [TuyaOpenAPI] Response:
path = /v1.0/homes/164818273/devices
data = {
  "code": 501,
  "msg": "request fail with unkown error",
  "success": false,
  "t": 1730670586060,
  "tid": "8a8228709a2d11ef894136243096d294"
}
[11/3/2024, 11:49:46 PM] TypeError: Cannot read properties of undefined (reading 'map')
    at TuyaHomeDeviceManager.updateDevices (/homebridge/node_modules/@0x5e/homebridge-tuya-platform/src/device/TuyaHomeDeviceManager.ts:21:51)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at TuyaPlatform.initHomeProject (/homebridge/node_modules/@0x5e/homebridge-tuya-platform/src/platform.ts:397:21)
    at TuyaPlatform.initDevices (/homebridge/node_modules/@0x5e/homebridge-tuya-platform/src/platform.ts:154:17)
    at HomebridgeAPI.<anonymous> (/homebridge/node_modules/@0x5e/homebridge-tuya-platform/src/platform.ts:128:7)
[11/3/2024, 11:49:46 PM] Got SIGTERM, shutting down Homebridge...

Other Infomations
Been using the plugin for over a year now with no issues, suddenly today my light switch appeared as unavailable on HomeKit. Trying to toggle it showed it was offline on homebridge logs (which was not true as it was controllable on the smart life app). Restarting the commenting server eventually lead to the plugging repeatedly crashing with error message TypeError: Cannot read properties of undefined (reading 'map')
Only way I have managed to get out to stop crashing was completely removing the light switch from the smart life app, but adding it again immediately causes the plugin to crash… I’m really not sure what could cause this as I haven’t touched the homebridge configuration at all before this started, maybe server side issue/update on Tuya API?
Either way any help would be greatly appreciated 🙏

Possibly related, I've noticed that even when connected to the smart life app (and again, fully working with the app), it does not appear at all under the Tuya developer platform devices tab, where I am 100% sure it did show up before this issue started...
This is the switch in case this helps (1 gang version) -
https://a.aliexpress.com/_oknuc5d

Must've been a weird server-side issue... After removing the device from my account and waiting a few hours, it finally cleared from my cloud account, and then adding it again it got back to working!


text:
Create a basic Dockerfile

Created a basic Dockerfile to run the bot inside the alpine container with the python 3.10
This makes the bot more independent of the host system and maybe easier to run ¯\(ツ)/¯

Closes #3

I haven't tested it and run it, because of a problem I have in the kernel of my system, but it should work without problems


text:
cargo update

Run cargo update for the cargo audit security alerts

Or we can just update the specific deps if we want fewer changes


text:
adds lt, gt, le, ge

closes #52
:checkered_flag:

//cc @tomekwi @hemanth how do you like the names of this functions? Expressive enough?

yup :)

I prefer explicit names like lessThan to cryptic shortcuts like lt inherited from the dawn of the Unix epoch.
This makes it easier to read code. And with a decent text editor typing lessThan is no more labor than lt.
But I’m fine either way.

Should we give the user a privilege to alias them?

IMO Users can just do:
var lt = require('1-liners/lowerThan');
var lowerThan = require('1-liners/lowerThan');

I moved to lessOrEqual and lessThan since its 1 character less :smile:

:checkered_flag:

:+1:

authors: hemanth stoeffel tomekwi


text:
How do you even use this?

How do i setup the agents properly, what are these locations, and what the heck is this improv thing? I know i am new, but can you please give a more detailed explanation on how to actually setup the agents with different prompts/roles? Do i have to edit the config file directly and rewrite it every time?

and i get this error when I run it for a little bit with my own prompts painstakingly hard coded into the config:
raceback (most recent call last):
File "C:\Users\marin\GPTeam\src\main.py", line 46, in run_world_async
await world.run()
File "C:\Users\marin\GPTeam\src\world\base.py", line 113, in run
await asyncio.gather(*tasks)
File "C:\Users\marin\GPTeam\src\world\base.py", line 101, in run_agent_loop
await self.run_next_agent()
File "C:\Users\marin\GPTeam\src\world\base.py", line 96, in run_next_agent
await agent.run_for_one_step()
File "C:\Users\marin\GPTeam\src\agent\base.py", line 1072, in run_for_one_step
await self._do_first_plan()
File "C:\Users\marin\GPTeam\src\agent\base.py", line 973, in _do_first_plan
await self._act(current_plan)
File "C:\Users\marin\GPTeam\src\agent\base.py", line 876, in _act
if plan.related_message
^^^^^^^^^^^^^^^^^^^^
AttributeError: 'LLMSinglePlan' object has no attribute 'related_message'
Exception ignored in: <coroutine object ChatOpenAI._agenerate at 0x000001C035763810>
Traceback (most recent call last):
File "C:\Users\marin\GPTeam\env\Lib\site-packages\langchain\chat_models\openai.py", line 318, in _agenerate
response = await acompletion_with_retry(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\marin\GPTeam\env\Lib\site-packages\langchain\chat_models\openai.py", line 63, in acompletion_with_retry
return await completion_with_retry(**kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\marin\GPTeam\env\Lib\site-packages\tenacity_asyncio.py", line 88, in async_wrapped
return await fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\marin\GPTeam\env\Lib\site-packages\tenacity_asyncio.py", line 47, in call
do = self.iter(retry_state=retry_state)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\marin\GPTeam\env\Lib\site-packages\tenacity_init.py", line 314, in iter
return fut.result()
^^^^^^^^^^^^
File "C:\Users\marin\AppData\Local\Programs\Python\Python311\Lib\concurrent\futures_base.py", line 449, in result
return self.__get_result()
^^^^^^^^^^^^^^^^^^^
File "C:\Users\marin\AppData\Local\Programs\Python\Python311\Lib\concurrent\futures_base.py", line 401, in __get_result
raise self._exception
File "C:\Users\marin\GPTeam\env\Lib\site-packages\tenacity_asyncio.py", line 50, in call
result = await fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\marin\GPTeam\env\Lib\site-packages\langchain\chat_models\openai.py", line 61, in _completion_with_retry
return await llm.client.acreate(**kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\marin\GPTeam\env\Lib\site-packages\openai\api_resources\chat_completion.py", line 45, in acreate
return await super().acreate(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\marin\GPTeam\env\Lib\site-packages\openai\api_resources\abstract\engine_api_resource.py", line 217, in acreate
response, _, api_key = await requestor.arequest(
^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: coroutine ignored GeneratorExit
Exception ignored in: <coroutine object ChatOpenAI._agenerate at 0x000001C035762D60>
Traceback (most recent call last):
File "C:\Users\marin\GPTeam\env\Lib\site-packages\langchain\chat_models\openai.py", line 318, in _agenerate
response = await acompletion_with_retry(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\marin\GPTeam\env\Lib\site-packages\langchain\chat_models\openai.py", line 63, in acompletion_with_retry
return await completion_with_retry(**kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\marin\GPTeam\env\Lib\site-packages\tenacity_asyncio.py", line 88, in async_wrapped
return await fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\marin\GPTeam\env\Lib\site-packages\tenacity_asyncio.py", line 47, in call
do = self.iter(retry_state=retry_state)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\marin\GPTeam\env\Lib\site-packages\tenacity_init.py", line 314, in iter
return fut.result()
^^^^^^^^^^^^
File "C:\Users\marin\AppData\Local\Programs\Python\Python311\Lib\concurrent\futures_base.py", line 449, in result
return self.__get_result()
^^^^^^^^^^^^^^^^^^^
File "C:\Users\marin\AppData\Local\Programs\Python\Python311\Lib\concurrent\futures_base.py", line 401, in __get_result
raise self._exception
File "C:\Users\marin\GPTeam\env\Lib\site-packages\tenacity_asyncio.py", line 50, in call
result = await fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\marin\GPTeam\env\Lib\site-packages\langchain\chat_models\openai.py", line 61, in _completion_with_retry
return await llm.client.acreate(**kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\marin\GPTeam\env\Lib\site-packages\openai\api_resources\chat_completion.py", line 45, in acreate
return await super().acreate(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\marin\GPTeam\env\Lib\site-packages\openai\api_resources\abstract\engine_api_resource.py", line 217, in acreate
response, _, api_key = await requestor.arequest(
^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: coroutine ignored GeneratorExit

hey @cranyy, there are a few solutions you could try in this issue for that problem you came across.

authors: MoHayat cranyy


text:
new的时候如果能摆脱gopath路径就好了

RT，提个建议

开启GO111MODULE 就可以了：
export GO111MODULE=on

authors: chennqqi qloog


text:
Not supported in swift 5

Testing this in Swift 5 and this seems to crash on
deflate(&stream, Z_FINISH) line 212
Is this library going to be compatible with Swift 5 at all
Thanks

Oops, it's just because I don't have time yet. I'll try it later.

I've found replacing this
`   var data = Data(capacity: DataSize.chunk)
while stream.avail_out == 0 {
if Int(stream.total_out) >= data.count {
data.count += DataSize.chunk
}
data.withUnsafeMutableBytes { (bytes: UnsafeMutablePointer) in
stream.next_out = bytes.advanced(by: Int(stream.total_out))
}
stream.avail_out = uInt(data.count) - uInt(stream.total_out)
        deflate(&stream, Z_FINISH)
    }

    deflateEnd(&stream)
    data.count = Int(stream.total_out)`

with this
`  var data = Data(capacity: DataSize.chunk)
while stream.avail_out == 0 {
if Int(stream.total_out) >= data.count {
data.count += DataSize.chunk
}
        data.withUnsafeMutableBytes { (buffer) in
            let base = buffer.baseAddress as? UnsafeMutablePointer<Bytef>
            stream.next_out = base?.advanced(by: Int(stream.total_out)) as? UnsafeMutablePointer<Bytef>
        }

//            UnsafeMutableBufferPointer
//
//            data.withUnsafeMutableBytes { (bytes: UnsafeMutablePointer) in
//                stream.next_out = bytes.advanced(by: Int(stream.total_out))
//            }
stream.avail_out = uInt(data.count) - uInt(stream.total_out)
        deflate(&stream, Z_FINISH)
    }

    deflateEnd(&stream)
    data.count = Int(stream.total_out)`

Fixes the crash I do however get a warning.
there also other warnings
'withUnsafeBytes' is deprecated: use withUnsafeBytes<R>(_: (UnsafeRawBufferPointer) throws -> R) rethrows -> R instead
Hopefully this points you in the right direction. Feel free to test what I've tried.

Any progress with that?
To make the things worse both gzipped gunzipped crash with XCode 10.2 even if I leave the code untouched and have it as 4.2 compilant, while with XCode 10.1 the same code works without any problems. Is it a bug in either compiler, or Swift library? Probably,  this is how it is meant to be in the future releases.
I converted to Swift 5 and did a replacement very similar to what philmartin83 suggested
   stream.next_out =   data.withUnsafeBytes({
        (bytes: UnsafeRawBufferPointer)-> UnsafeMutablePointer<Bytef> in
            UnsafeMutablePointer(mutating:
                bytes.bindMemory(to: Bytef.self).baseAddress!.advanced(by: Int(stream.total_out)))
     })

for gzipped and gunzipped
No compiler warnings  and no crashes at runtime, however the restored data are different from the original.
I can't use libcompression, as it supports ios 10+, while my app runs with ios 9+ . (I keep an old  iphone and wish it to run there as well)
Unfortunately I am quite new to Swift and never dealt with zlib.  Also, zlib targets C, where working with pointers is much simpler than in Swift.
Hopefully, someone will find time to fixed that. I really need it to work.

same here!
deflate(&stream, Z_FINISH) //Thread 1: EXC_BAD_ACCESS (code=1, address=0x196ddfa00)

Sorry for the pending.
However, I couldn't found the clue so far and am recently too busy to work with this.
I'll reseach between whiles, but a PR is welcome.

How about this?
data.withUnsafeMutableBytes { (buffer) in                 let base = buffer.baseAddress                 let next_out = base?.advanced(by: Int(stream.total_out)).assumingMemoryBound(to: UnsafeMutablePointer<Bytef>.self).pointee                 stream.next_out = next_out             }

Any progress with that?
To make the things worse both gzipped gunzipped crash with XCode 10.2 even if I leave the code untouched and have it as 4.2 compilant, while with XCode 10.1 the same code works without any problems. Is it a bug in either compiler, or Swift library? Probably, this is how it is meant to be in the future releases.
I converted to Swift 5 and did a replacement very similar to what philmartin83 suggested
   stream.next_out =   data.withUnsafeBytes({
        (bytes: UnsafeRawBufferPointer)-> UnsafeMutablePointer<Bytef> in
            UnsafeMutablePointer(mutating:
                bytes.bindMemory(to: Bytef.self).baseAddress!.advanced(by: Int(stream.total_out)))
     })

for gzipped and gunzipped
No compiler warnings and no crashes at runtime, however the restored data are different from the original.
I can't use libcompression, as it supports ios 10+, while my app runs with ios 9+ . (I keep an old iphone and wish it to run there as well)
Unfortunately I am quite new to Swift and never dealt with zlib. Also, zlib targets C, where working with pointers is much simpler than in Swift.
Hopefully, someone will find time to fixed that. I really need it to work.

same here!
Something goes wrong with XCode 12.2 and/or libraries shipped with it.

Any progress with that?
To make the things worse both gzipped gunzipped crash with XCode 10.2 even if I leave the code untouched and have it as 4.2 compilant, while with XCode 10.1 the same code works without any problems. Is it a bug in either compiler, or Swift library? Probably, this is how it is meant to be in the future releases.
I converted to Swift 5 and did a replacement very similar to what philmartin83 suggested
   stream.next_out =   data.withUnsafeBytes({
        (bytes: UnsafeRawBufferPointer)-> UnsafeMutablePointer<Bytef> in
            UnsafeMutablePointer(mutating:
                bytes.bindMemory(to: Bytef.self).baseAddress!.advanced(by: Int(stream.total_out)))
     })

for gzipped and gunzipped
No compiler warnings and no crashes at runtime, however the restored data are different from the original.
I can't use libcompression, as it supports ios 10+, while my app runs with ios 9+ . (I keep an old iphone and wish it to run there as well)
Unfortunately I am quite new to Swift and never dealt with zlib. Also, zlib targets C, where working with pointers is much simpler than in Swift.
Hopefully, someone will find time to fixed that. I really need it to work.

same here!
Something goes wrong with XCode 12.2 and/or libraries shipped with it.

When I've got this setup for Swift 4.2 in XCode 10.2 it works fine its when I set it Swift 5 it crashes.

Same issue here... would be thankful for a fix as I have no idea about gzip and can't contribute... sorry...

this doesn't help anyone but I've tired this on a device running iOS 12.2 and iOS 12.1.4, on the 12.2 its works ok for me on the device running 12.1.4 its crashes has anyone else found this?

this doesn't help anyone but I've tired this on a device running iOS 12.2 and iOS 12.1.4, on the 12.2 its works ok for me on the device running 12.1.4 its crashes has anyone else found this?

Yep.. exact same behaviour for me.
Also the code you provided on top seems to make invalid gzipped data? Again... I don't know much about zipping, but my server at least is rejecting my gzipped data using your workaround :(

I'm not an expert in this, its just something I read.

Sure... was just an observation :) thank for sharing anyway!

ok I think I've worked it out.....(I think).... I think its to do with the exclusive memory access.
try this for the gzipped
public func gzipped(level: CompressionLevel = .defaultCompression) throws -> Data {
    guard !self.isEmpty else {
        return Data()
    }

    let contiguousData = self.withUnsafeBytes { Data(bytes: $0, count: self.count) }
    var stream = contiguousData.createZStream()
    var status: Int32

    status = deflateInit2_(&stream, level.rawValue, Z_DEFLATED, MAX_WBITS + 16, MAX_MEM_LEVEL, Z_DEFAULT_STRATEGY, ZLIB_VERSION, Int32(DataSize.stream))

    guard status == Z_OK else {
        // deflateInit2 returns:
        // Z_VERSION_ERROR  The zlib library version is incompatible with the version assumed by the caller.
        // Z_MEM_ERROR      There was not enough memory.
        // Z_STREAM_ERROR   A parameter is invalid.

        throw GzipError(code: status, msg: stream.msg)
    }

    var data = Data(capacity: DataSize.chunk)
    while stream.avail_out == 0 {
        var copyOfStream = stream
        if Int(copyOfStream.total_out) >= data.count {
            data.count += DataSize.chunk
        }
        //            if #available(iOS 12.2, *) {
        data.withUnsafeMutableBytes { (bytes: UnsafeMutablePointer<Bytef>) in
            copyOfStream.next_out = bytes.advanced(by: Int(stream.total_out))
        }

        copyOfStream.avail_out = uInt(data.count) - uInt(stream.total_out)
        deflate(&copyOfStream, Z_FINISH)
        stream = copyOfStream
    }

    deflateEnd(&stream)
    data.count = Int(stream.total_out)

    return data
}

This still crashes for me under iOS 10

@georgebachman is it at the same point?
I didn’t test on iOS 10 because I don’t have a device running that. I have a iOS 9 device I’ll try agains that later.

@georgbachmann I cannot replicate your issue with iOS 10, I've tested on a iOS 10.3.3, iOS 9.3.5, iOS 11.3, iOS 12.1.4 and iOS 12.2 it all works fine since the change above.
I am however only using the .swift file I'm not installing via cocoa pod or using the framework. So as to why this doesn't work has exhausted my knowledge now sorry.

@philmartin83 did you run the tests with your suggested change? It seems to produce empty data for me, and so testGZip() fails.

I tested using the above yes, the data reported to our server seems to be correct. Again I’m not an expert on this matter.

Do you have a fork I can test out?  On Xcode 10.1 the tests pass. On Xcode 10.2 they crash in the same way described in the initial report.
Applying your changes and running the tests in the project and they fail because it products empty data. (Maybe a typo in the posted code, I'm not sure)

No I don’t, I just fixed it in the file in my project and then copy and pasted the above into this post.

@philmartin83 If you could fork the project and make the changes there it would be really helpful to the rest of us (and you'd be able to verify your fix via the tests).

@georgbachmann @subdigital
Thanks for the feed back @subdigital unfortunately I've exhausted all my knowledge on this now, but I've come up with this..... It doesn't crash on iOS version's I mentioned above (not tested on iOS11) the data isn't empty and when the data is gzipped and gunzipped the data is the same. I literally don't know any more now, anything else is well above my league. But hope this works...
public func gzipped(level: CompressionLevel = .defaultCompression) throws -> Data {
    guard !self.isEmpty else {
        return Data()
    }

    let contiguousData = self.withUnsafeBytes { Data(bytes: $0, count: self.count) }
    var stream = contiguousData.createZStream()
    var status: Int32

    status = deflateInit2_(&stream, level.rawValue, Z_DEFLATED, MAX_WBITS + 16, MAX_MEM_LEVEL, Z_DEFAULT_STRATEGY, ZLIB_VERSION, Int32(DataSize.stream))

    guard status == Z_OK else {
        // deflateInit2 returns:
        // Z_VERSION_ERROR  The zlib library version is incompatible with the version assumed by the caller.
        // Z_MEM_ERROR      There was not enough memory.
        // Z_STREAM_ERROR   A parameter is invalid.

        throw GzipError(code: status, msg: stream.msg)
    }

    var data = Data(capacity: DataSize.chunk)
    // create buffer
    var compressBuffer = [Bytef](repeating: 0, count: DataSize.chunk)
    // new part of the while loop
    while stream.avail_out == 0 {
        stream.next_out = UnsafeMutableRawPointer(mutating: compressBuffer).assumingMemoryBound(to: Bytef.self)
        stream.avail_out = uint(DataSize.chunk)

        deflate(&stream, Z_FINISH)

        data.append(&compressBuffer, count: DataSize.chunk-Int(stream.avail_out))
    }

    deflateEnd(&stream)
    data.count = Int(stream.total_out)

    return data
}

my fix doesn't work. I've forked it and it doesn't work.

@philmartin83 thanks for taking a stab. I appreciate your attempts, even if they don't work!
I'm just going back to Xcode 10.1

@samjohn no problem, the unit test fails on the gzip test as the uncompressed data converted to string is nil which is odd because the data before being compressed is 3 bytes and the uncompressed data is 3 bytes string is nil. You're more then welcome to take a look at my fork and see I'll push my changes now to my forked version

@1024jp any chance you can give us an ETA for when you plan on working on the migration to Swift 5?

Thanks @philmartin83, you made my day

@philmartin83 Great job! Thanks!

Hi guys, I have an alternate fix which fixes other areas of code that are broken in a similar way (and fixes unit tests).
I'm testing it at the moment but will push a branch and PR shortly.

@mjholgate amazing work thanks.

Branch is here:
https://github.com/mjholgate/GzipSwift/tree/fix-issue-34-xcode-10.2
I still need to check this over again, and when I'm happy I'll submit a PR. Any comments/testing much appreciated.

Podfile runes to use the fork:
pod "GzipSwift" , :git => 'https://github.com/mjholgate/GzipSwift', :branch => 'fix-issue-34-xcode-10.2'

@mjholgate - The gzipped() function is still crashing for me in my Swift 5 project. Started debugging it but it wouldn't stop on my exception breakpoint. I'm at work so don't have time debugging any further. Perhaps not a super helpful comment but thought I'd mention it.

@RobertGummesson  :-(. Just. checking - you definitely have the right branch?

If people haven't time to investigate and require a quick-fix, this library does the same job (amongst other compression functions), has a very similar API, and has been successfully ported to Swift 5 without any warnings.
https://github.com/mw99/DataCompression

Hi, sorry for my late.
But I improved my code based-on @philmartin83's fork (Thank you!).
I've committed them to develop branch.
Could you somebody test it?
If it works, I'll merge it to the main branch.

@1024jp I’m glad it was some sort of help.

If just tested in my project, and it works

Thanks for checking.
I've released v5.0.0 that supports Swift 5 🚀.

@1024jp
I'm still encountering the error. Same crash on deflate(&stream, Z_FINISH) line 212`

Thanks! v5.0.0 fixed it.
@sunnyleeyun make sure to specify the new version in Podfile as CocoaPods still fetches v4.1.0:
pod 'GzipSwift', :git => 'https://github.com/1024jp/GzipSwift.git', :tag => '5.0.0'

I think you have to change the pod version to be 5.0.0,
because now we have version 4.1.0 with tag 5.0.0

Thank you for fixing this! I thought I was going insane when I started seeing crashes pointing to deflate.

I use GzipSwift with tag 5.0.0 Still crash in Swift 5.0 (iOS 12.2) :(

Still crashing. 11.0 beta 2 iOS 13

authors: 1024jp ArchieR7 KomarovEV RobertGummesson adamwaite anthann diegotl dszakon georgbachmann hopy11 kwawrzyniak ldrr mjholgate palmcrust pbush25 philmartin83 pouty18 samjohn subdigital sunnyleeyun zhs2472


text:
🛑 Tables MDS Auth IVDD (fr) is down

In 3bf817e, Tables MDS Auth IVDD (fr) (https://tables.hres.ca/mdiol/IVDD-auth/auth-ivdd-fr.html) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Tables MDS Auth IVDD (fr) is back up in 9108d9e after 3 minutes.


text:
<style webc:scoped @html> doesn’t process scoped content

<style webc:scoped @html="`:host {}`">

Returns :host {} in the CSS bundle.

<style webc:scoped @html="`:host {}`">

Returns :host {} in the CSS bundle.

Would we also be able to link stylesheets as scoped?

@cssandstuff this was added in https://github.com/11ty/webc/issues/53

authors: cssandstuff zachleat


text:
这项目是已经不维护了吗？

看了很多问题都没人回复，有些问题是几年前提的，到现在了也没解决

项目应该是挂了，我的PR现在都还没处理，自己fork来用吧

authors: Datey captain-black


text:
Release with typst 0.11.1

Thank you for providing the image, I have been using it for my thesis all the time so far.
As of today, typst 0.11.1 has been released.
It includes some important fixes for me, I would be really glad if the image could be rebuilt any time in the next two weeks.
Cheers!

Thanks, the image is being built automatically now and will be pushed to the Docker hub. It should be online in <2 hours, probably.


text:
Remove explicit width and height

Please remove the explicit width and height attributes. Let CSS handle this.

I believe the width and height attributes are explicit due to them being required by the YouTube API: https://developers.google.com/youtube/iframe_api_reference
I see fundipper went for passing the attribute values via parameters to a NewExtender constructor:https://github.com/fundipper/goldmark-videos
Some other interesting discussions around more responsive youtube embeds include this one:
https://stackoverflow.com/questions/35814653/automatic-height-when-embedding-a-youtube-video
These examples still contain the hard-coded width and height iframe attributes, but use CSS on an encapsulating div to get better behaviour.

My thought thus: perhaps just adding an encapsulating div would at least enable doing these useful things with the resulting HTML.

authors: hugovdm prologic


text:
404 not found - looks API change

Hi,
I try run the project but fail when calls post.php, can you verify?
and there is any official documentation?
Thanks!

pache/2.4.53 (Win64) OpenSSL/1.1.1n PHP/8.1.4 Server at localhost Port 80
me pasa lo mismo

authors: Jbrandan raulgonve


text:
Grammar corrections on the main page

170 Mentee should be 170 Mentees

20 Mentor should be 20 Mentors

'An a interactive platform....' should simply be 'An interactive platform.....'. Also, G & M should not be capitals in the 'Growth Mindset' at the end of the sentence.

In about Sushiksha: Lets expand the first mentions of VKSSF and VAA and link it to its website. Please see the re-written version
"Sushiksha Mentoring Program is organized for scholars of Vishwa Konkani Student Scholarship Fund (VKSSF) by members of VKSSF Alumni Association(VAA). Sushiksha was started in 2018 by Royal Denzil Sequeira, a member of VAA since 2015, with 20 mentees. Since then Sushiksha.. "


text:
Publish to NPM

Are you planning on publishing sklad to NPM? Would be useful.
This is a great library. Why do you think it has not deserved the attention it deserves?

Please reconsider this. It's very common to install clientside modules with npm and bundle them with Browserify or Webpack. You already have a valid package.json; all you need to do is run npm publish.

@quarterto yep, you're right. I'll do this today

Finally: https://www.npmjs.com/package/sklad

Fantastic, thanks.

authors: 1999 cadorn quarterto


text:
Issue with array response

Hi,
I have issue with the generated JSON response. It seems that it doesn't respond well with array related prompt instruction.
from transformers import AutoModelForCausalLM, AutoTokenizer

print("Loading model and tokenizer...")
model_name = "databricks/dolly-v2-3b"
model = AutoModelForCausalLM.from_pretrained(model_name, use_cache=True, device_map="auto")
tokenizer = AutoTokenizer.from_pretrained(model_name, use_fast=True, use_cache=True)
print("Loaded model and tokenizer")

Prompt:
from jsonformer.format import highlight_values
from jsonformer.main import Jsonformer

stock2 = {
  "type": "object",
  "properties": {
    "stocks": {
        "type": "array",
        "items": {"type": "string"}
      }
   }
}

builder = Jsonformer(
    model=model,
    tokenizer=tokenizer,
    json_schema=stock2,
    debug=True,
    prompt="generate 10 stocks code",
)

print("Generating...")

output = builder()

highlight_values(output)

Response:
Generating...
[generate_object] generating value for stocks
[generate_string] generate 10 stocks code
Output result in the following JSON schema format:
{"type": "object", "properties": {"stocks": {"type": "array", "items": {"type": "string"}}}}
Result: {"stocks": ["
[generate_string] |ABC",|
[generate_string] generate 10 stocks code
Output result in the following JSON schema format:
{"type": "object", "properties": {"stocks": {"type": "array", "items": {"type": "string"}}}}
Result: {"stocks": ["ABC", "
[generate_string] |XYZ",|
[generate_string] generate 10 stocks code
Output result in the following JSON schema format:
{"type": "object", "properties": {"stocks": {"type": "array", "items": {"type": "string"}}}}
Result: {"stocks": ["ABC", "XYZ", "
[generate_string] |PQR",|
{
  stocks: [
    "ABC",
    "XYZ",
    "PQR"
  ]
}

The response only respond with 3 data not 10 as in the prompt. I am not sure if it is issue with the model or not.
Also, you may notice that the memory used for 3b model is at 23GB of RAM. Is this normal?

Any help would be appreciated. Thank you.

@rhzs  Check this out, should solve your array issue #47


text:
파일 올리기 버그 있는 듯

아 이런

OK


text:
합의 거꾸로 링크 걸었음

ㅇㅇ

고쳤음


text:
Split MPI and ADIOS2 IO

The objective of the present PR is to split the MPI and ADIOS2 IO.

[X] Define MPI IO in dedicated files (io_mpi.f90 and io_object_mpi.f90)
[x] Define ADIOS2 IO in dedicated files (io_adios.f90 and io_object_adios.f90)
[X] Test MPI IO in a dedicated folder (examples/io_mpi)
[x] Test ADIOS2 IO in a dedicated folder (examples/io_adios)
[x] Remove all #ifdef ADIOS2
[x] Add a parameter allowing the external code to check if ADIOS2 is available (variable decomp_2d_with_adios2 in the module decomp_2d_io_adios)
[x] Update the Changelog

The functionalities of the new MPI IO framework are slightly enhanced compared with the previous version.

All MPI IO operations are compatible with both single and double precision real / complex, but also integers and logicals
4 kind of MPI IO operations are clearly defined (read/write_one, read/write_var, read/write_plane, read/write_scalar)

The new MPI IO framework is working and ready for review.
The new ADIOS2 IO framework is working and ready for review.

I just would like to test this on multiple GPUs and after I'll merge

I cannot install ADIOS2 with CUDA support on SCARF. It is ok on the VM. I need to do all the updates on the multi-GPUs VM. I ll merge and check the multi-GPUs with ADIOS later


text:
Create step for response even if exception happens

handle exception in add_sub_step
create first session_step in helpers.get_session
fix RequestHelper repr

!test

Refer to this link for build results (access rights to CI server needed):
http://jenkins.2gis.local/job/vmmaster.staging.regression/374/
Test PASSed.

:+1: вот бы тест еще на это

@sh0ked пожалуй, стоит добавить.

:+1: