Why do the Java code samples create a CountDownLatch, but never call await()?

[Enter feedback here]
I am writing a JMS client that runs in a Function App. It will run every 15s and continue to get messages from a queue until the queue is empty (even if it takes more than 15s). The messages get transferred onto a Service Bus queue.
I am very puzzled by the use of CountDownLatch in the code samples on this page. I have read the Java docs. Based on the docs, there is no point in creating a CountDownLatch unless there is a call to its await() method somewhere. But none of the code on this page calls await()!
Is this redundant code, or am I missing something important?

Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

ID: f0bd1414-d29f-fe3b-503f-365692c77ca5
Version Independent ID: 8627b318-bd95-0176-bfd5-6cb20f661692
Content: Get started with Azure Service Bus queues (Java) - Azure Service Bus
Content Source: articles/service-bus-messaging/service-bus-java-how-to-use-queues.md
Service: service-bus-messaging
GitHub Login: @spelluru
Microsoft Alias: spelluru

@TKProlifics
Thanks for your feedback! We will investigate and update as appropriate.

spelluru Can you please review it.
It looks like the sample code can be modified to remove the CountDownLatch and still achieve the same result. Let me know in case I have missed anything.

@MayankBargali-MSFT - Yes. It's not needed. I will update and publish the article today. Thanks.

The update is live now.
#please-close


Issues with Eltrade A1

Hi Guys,
Is there anything special you need to configure with Eltrade A1?
I'm successfully printing on Datecs DP-25, but when using the same request for Eltrade A1, I receive:
E199 Device general error followed by E599 NRA link general error.

Operator defaults are 1 / no password. However there is no difference if I provide wrong operator or not.
The device is production one and working well in manual mode - connected with the NRA device successfully.
The device is discoverable
I'm able to print Z report from http://localhost:8001/

Full request/response log: log.txt
Any thoughts?

Hello,
Please check the Bulgarian fiscal printer setup:
https://github.com/erpnet/ErpNet.FP/blob/master/BGFiscalPrinterSetup.md

@iveivanov
Did check it now. The BaudRate is 115200 and the device is in mode „1.Регистрация“ selected.
Any other suggestions?

Please read your error codes and messages: "type":"error","code":"E599","text":"The internal terminal is not working"...
So, you do not have working NRA Terminal. Contact your Eltrade service.


Can't pull Docker images listed in Quick Start Guide

Describe the bug
The Quick Start Guide provides docker-compose.yml content to use. It contains two images that can't be pulled due to permission errors or nonexistent repository: ds/websight-cms-luna and ds/nginx-luna:latest.
WebSight CMS version
N/A
To Reproduce
Steps to reproduce the behavior:

Go to the Quick Start Guide
Copy docker-compose.yml content locally
Run docker compose up
See error

Expected behavior
Docker images being pulled and started.
Screenshots
Error response from daemon: pull access denied for ds/websight-cms-luna, repository does not exist or may require 'docker login': denied: requested access to the resource is denied
...
Error response from daemon: pull access denied for ds/nginx-luna, repository does not exist or may require 'docker login': denied: requested access to the resource is denied

Desktop (please complete the following information):

OS: Linux

Thank you @lcharkiewicz . The issue has been fixed in https://github.com/websight-io/docs/pull/70


Remove unused enb information

eNB information seems not be used anywhere in the source code, but
it generates ERROR messages when it is not set.

These parameters are there for historic reasons. Not used anymore and can be removed.


Incompatibility with Inventory Profiles Next

This is just a post for someone if you found this incompatibility. Its on IPN and its an issue open there #124 but maybe there is someone that can help.

I still need to know why this happens.
The "fix" is adding a method call to all my mixins just to be sure the mod was initialized. I don't really want to do that.
This mod introduces the unexpected behaviour and I would like to know why should I make all my mixins slower.

Doesn't happen in dev env loading from fabrication repo, with InventoryProfiles
if that somehow helps figure it out

SFort: k (Kind) tags are mutually exclusive. Incompatibility > Not Our Defect.
blackd: I can't read whatever Kotlin magic is going on here to initialize what I assume is a method reference. Your mixins would be slower by one IFNULL insn, which will get optimized out basically instantly. (The log lines mean you're already doing this check, anyhow.) My best reading of what is happening is that a Screen is being initialized by Fabrication code before your mod initializer has been invoked. Fabric Loader randomizes mod load order, so this is fairly likely to happen with any mod that uses screens. Mixins load before mods, and there's no way to know when the first time your mixin will be called relative to mod initialization (i.e. whether it will be before or after) — in Java, I would use a static initializer. In general, Kotlin has an idealized view of the JVM world that doesn't line up as soon as runtime patching comes into play.

Doesn't happen in dev env

Load order is aggressively randomized in dev envs — in prod, it's randomized based on installed mods, so it doesn't change between launches. This may be related.

The code that logs the problem is only executed if the init was not performed. In the normal situation when the mod entry point is executed all the methods that do the checking and logging are swapped with the real counterparts. So there no checks.

Anyway the difference with normal minecraft start is that there is a Screen instance shown (rendered) before my mod entry point is executed.
I guess your does something that cause it. Which probably is a valid case but I prefer to be sure before deciding how to proceed.

You cannot under any circumstances assume that your mod initializer has been called in a mixin. Doesn't matter if you're using Forge, Fabric, or BananaLoaderPro.

You cannot under any circumstances assume that your mod initializer has been called in a mixin. Doesn't matter if you're using Forge, Fabric, or BananaLoaderPro.

I know that but I've done a lot of checking before considering the assumption that no Screen instance is rendered before the game main menu. In none of my comments have I even implied that the problem is not caused by my assumption.
I just need to know what caused the assumption not to hold so I know how to fix the problem with minimal impact.

may be "This mod introduces the unexpected behaviour" sounds like I blame you. I didn't intend it to sound like that .

I figured a way to bring the checks down to if null. I guess this will handle all other potential cases where my my assumptions about the start sequence is not true.
I guess you can close this.

may be "This mod introduces the unexpected behaviour" sounds like I blame you. I didn't intend it to sound like that .

It did sound like that, yes.

I'll leave the issue open until a fix is released for visibility.

It did sound like that, yes.

I just think that changing the startup is not a good idea unless you have very good reasons.
I've pinned it down to a rendering of a Screen instance is done before game starts ticking. The vanilla behaviour is the game start to tick and then renders the active Screen instance.

Whether the game renders or ticks first is not guaranteed. It depends on the framerate.
If it's less work to change Fabrication to not do this than to make Inventory Profiles Next handle this, then you can open a PR. Keep in mind I'm on soft-hiatus and it could be a while before a release.

caused by use_items_while_riding

If it's less work to change Fabrication to not do this than to make Inventory Profiles Next handle this, then you can open a PR. Keep in mind I'm on soft-hiatus and it could be a while before a release.

I need to fix the possibility of this happening again so I'll fix it.

i test out some more mods and turns out that Tweak My Client and Inspecio don't work with Fabrication either.

Tweak My Client

Please open a new issue.

Inspecio

#431

Fixed by 64341b4

Released: https://github.com/unascribed/Fabrication/releases/download/v2.3.0/fabrication-1.18.2-2.3.1-exp3.jar


RPCs can be invoked from a background thread

Describe the bug
It turned out to be possible to invoke an RPC from a background thread using C# Tasks Task.Run() API. This is not an issue on it's own, but the crash that happened was as follows:
UnityException: get_realtimeSinceStartup can only be called from the main thread.
Constructors and field initializers will be executed from the loading thread when loading a scene.
Don't use this function in the constructor or field initializers, instead move initialization code to the Awake or Start function.
MLAPI.NetworkBehaviour.__beginSendServerRpc (MLAPI.Messaging.ServerRpcParams serverRpcParams, MLAPI.Messaging.RpcDelivery rpcDelivery) (at Library/PackageCache/com.unity.multiplayer.mlapi@ddf9d9baf8/Runtime/Core/NetworkBehaviour.cs:75)

Which to me reads as "MLAPI probably isn't guarding in it's APIs against being invoked from non-main thread". This probably warrants some exploration.
Expected behavior
The crash does occur as soon as we touch Unity API, but in reality it should happen way sooner in the invocation chain.

Added to bug backlog for triaging, https://jira.unity3d.com/browse/MTTSDK-8

no longer applies after 1.x release


A question about staged implementations?

So, I really want to use this for my ACPI library, it looks great! However, I curious how stage-based implementation might work. That is, if I want to pull in the library and only implement parts at a time (for instance, maybe I don't have a scheduler, or no concept of threads). What's the best strategy for handling cases like this one? Is it required that an OS have all of this functionality before implementing uACPI?

Hey there and thanks for the feedback, I'm glad you like it!
As for your question: you can stub out a lot of the helpers and it will work just fine! There's a UACPI_STAUTS_UNIMPLEMENTED error code for such cases.
Mutexes might be required though, but you can totally "fake" them if you don't have a scheduler nor any sort of concurrency.
Example:
uacpi_handle uacpi_kernel_create_mutex(void)
{
    // any non-null value should work
    return (uacpi_handle)1;
}

uacpi_bool uacpi_kernel_acquire_mutex(uacpi_handle, uacpi_u16)
{
     return true;
}

void uacpi_kernel_release_mutex(uacpi_handle)
{
}

Hope this answers your question.

Mutexes and such I believe I have implemented via my languages stdlib, it's just threads I'm concerned about. Was thinking I could make threads as processor-based for now, but I need to flesh out that implementation strategy (was thinking of a virtual ISA of sorts... Might get complex though lol). Thanks so much, I love this library -- so, so much simpler than ACPICA! :)


Cordova File URI

Can we pass either DATA_URL or FILE_URI from Cordova's navigator.camera.getPicture to the first parameter of uploader.send?
Right now it seems that we need to pass the file object from an input with type="file"

Can't you construct a blob from DATA_URL or FILE_URI?
I don't know much about cordova, but there has to be a way to read file contents. And if you can read file contents, then you can read blobs.

From here I gather:
function onInitFs(fs) {
 fs.root.getFile(fileURL, {}, function(fileEntry) {

    // Get a File object representing the file,
    // then use FileReader to read its contents.
    fileEntry.file(function(file) {
        //file is someting you can send through slingshot.
    }, errorHandler);

  }, errorHandler);
}

window.requestFileSystem(window.TEMPORARY, 1024*1024, onInitFs, errorHandler);

I was curious about this as well and I found out that you can construct the object from the file uri in cordova using the following:
window.resolveLocalFileSystemURL(file.uri, function(fileEntry) {
fileEntry.file(function(fileObj) {
var uploader = new Slingshot.Upload("myFileUploads")
uploader.send(fileObj, function (error, downloadUrl) {
if (error) console.log(error)
console.log(downloadUrl)
})
})
Slingshot accepts the file object fine and it goes ahead with the upload and returns the file url with success but when I view any files uploaded like this from cordova on my s3 bucket they are all 15 bytes large and obviously corrupted somewhere in the process.
If I could get some help with this issue that would be great. I have some code to upload a file to my s3 bucket from cordova with just the uri which works fine but I would prefer to just use the slingshot package for both cordova and web.

Also just noticed testing in the iOS simulator that the object doesn't get a type assigned with is an issue
I'll see if I can figure these out

@danecando thanks for sharing this. Did you check if fileObj.size matches the size that you are looking for? Also did you try the method I've posted above?

@gsuess I couldn't get the fileEntry using the code you provided.
The file sizes in the object are correct before the upload.

@danecando did you adjust the file size accordingly in code I've provided? In that sample it was limited to 1MB (1024*1024), which is not very high.
As for your method, 15 bytes sounds like a URI string itself. Did you check the contents of the file that is uploaded to the bucket? Also note that S3 will not overwrite files if you provide the same key as an already existing file. Instead it will silently ignore your upload.

I'm wanting to know as well. I'm trying to take the data from mdg:camera and upload as a normal jpg to S3.

@gsuess this is what the files contain
[object Object]

Wonderful.
Check file objects contents with the FileReader:
var reader = new FileReader()

reader.onload = function (event) {
  var contents = event.target.result;
  console.log(contents);
};

reader.readAsText(fileObject);

the onload event doesn't fire

@danecando did you check the onerror handler then? Looks like we are getting to the bottom of it.

{"type":"error","bubbles":false,"cancelBubble":false,"cancelable":false,"lengthComputable":false,"loaded":0,"total":0,"target":{"_readyState":2,"_error":{"code":5},"_result":null,"_localURL":"cdvfile://localhost/temporary/cdv_photo_027.jpg","_realReader":{"result":null}}}

the first is what the file object looks like and the second is the readastext error
I20150119-11:23:22.806(-5)? (ios) {"name":"cdv_photo_030.jpg","localURL":"cdvfile://localhost/temporary/cdv_photo_030.jpg","type":null,"lastModified":1421684596000,"lastModifiedDate":1421684596000,"size":1396725,"start":0,"end":1396725}
I20150119-11:23:22.808(-5)? (ios) {"type":"error","bubbles":false,"cancelBubble":false,"cancelable":false,"lengthComputable":false,"loaded":0,"total":0,"target":{"_readyState":2,"_error":{"code":5},"_result":null,"_localURL":"cdvfile://localhost/temporary/cdv_photo_030.jpg","_realReader":{"result":null}}}

So the file comes from the camera? Perhaps should not load images as text...
Use .readAsDataURL() instead.

it looks like readAsDataURL returns successfully with: data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/......... <- really long string

I think your platform doesn't support sending files with FormData.

Was anyone able to construct a blob from base64 in mobile devices? I tried a few methods but they only seem to work with desktop browsers.

this would be really great to implement!

@geritol what are you referring to?

to make somehow possible to post pictures from cordova apps.

@geritol it is possible to post pictures: https://github.com/CulturalMe/meteor-slingshot/issues/24

Hey guys...
Has anyone found a good solution? I´m currently using resolveLocalFileSystemURL, but get the "[object Object]" uploaded as well...

@thomasf1 I'm getting the cordova file with fileEntry.file, turning that into a data uri, and then turning the data uri into a blob

@danecando Thanks! I´ll try that :)
Could you share some of your code? :)

@thomasf1 something like this: https://gist.github.com/danecando/92ef9240c6ab715f35c4

@danecando Thanks, that helped me a lot :)... Got it almost working, some filename stuff remaining...

@danecando Funny thing: It worked perfectly on iOS (it was our last issue, submitted to the app store), but doesn´t seem to work on Android - there the uploaded File on S3 is empty... Did you have similar issues?

@thomasf1 it works fine for me on my galaxy s4. I haven't really tested on any other android devices. I'm also sending mine through another function that resizes the image and spits out a data URI

@danecando Ah, in what cases was the build-in "targetWidth:" not quite working/satisfactory?

When using mdg:camera
https://github.com/meteor/mobile-packages/tree/master/packages/mdg:camera
you get back a DATA_URL, which can be converted to a blob with
function dataURItoBlob(dataURI) {
    var binary = atob(dataURI.split(',')[1]);
    var array = [];
    for(var i = 0; i < binary.length; i++) {
        array.push(binary.charCodeAt(i));
    }
    return new Blob([new Uint8Array(array)], {type: 'image/jpeg'});
}

@danecando this doesnt work for me with video file :/
im getting this problem : http://stackoverflow.com/questions/26733070/cordova-capture-video-and-retrieve-base64-data
basically returns " data:video/mp4;base64," but there isn't any encoded data after the filetype.
any thoughts guys ? @gsuess @danecando @lorensr @thomasf1
Thanks

For future reference this is what i did , i had to recreate the file object from media-capture plugin with resolveLocalFileSystem

      captureSuccess = (mediaFiles) ->

        path = mediaFiles[0].fullPath
        window.resolveLocalFileSystemURL path, (fileEntry)->

          fileEntry.file((data)->

            reader = new FileReader()

            reader.onloadend = (e)->
              console.log e.target.result
              blob = b64toBlobAlt(e.target.result, 'video/mp4')
              console.log blob

              if blob
                uploader = new Slingshot.Upload('myVideoUpload')
                uploader.send blob, (error, downloadUrl) ->
                  if error
                    console.error 'Error uploading', uploader.xhr.response
                  else
                    console.log downloadUrl
                    Meteor.users.update Meteor.userId(), $set: 'profile.videoUrl': downloadUrl
                  return

            reader.readAsDataURL(data)

          )

        return

Same issue with me too. The file argument of the callback in FileEntry.file ( ) is accepted by uploader.send but the file uploaded is exactly of 15 bytes, corrupted and the checksums don't match

@kevohagan Sorry, we didn´t try/use Videos...

@thomasf1 How did you resolve your file naming issues if they are (resolved that is) ?

@kevohagan : Were you able to upload videos successfully? I am not with these code.
var captureSuccess = function(mediaFiles) {
var b64toBlobAlt = function(dataURI, contentType) {
var ab, byteString, i, ia;
byteString = atob(dataURI.split(',')[1]);
ab = new ArrayBuffer(byteString.length);
ia = new Uint8Array(ab);
i = 0;
while (i < byteString.length) {
ia[i] = byteString.charCodeAt(i);
i++;
}
return new Blob([ab], {
type: contentType
});
};
var path = mediaFiles[0].fullPath;
window.resolveLocalFileSystemURL(path, function(fileEntry) {
fileEntry.file(function(data) {
var reader = new FileReader();
reader.onloadend = function(e) {
var blob = b64toBlobAlt(e.target.result, 'video/mp4');
if (blob) {
var uploader = new Slingshot.Upload("myFileUploads");
alert(uploader);
uploader.send(blob, function(error, downloadUrl) {
if (error) {
alert('Error uploading', uploader.xhr.response);
} else {
alert(downloadUrl);
}
});
}
};
reader.readAsDataURL(data);
});
});
};
}

I'm stuck at this, too. Tried the Blob conversion (using both code I found somewhere else and the @lorensr version), but I always get the following error message:
processMessage failed: Stack: Error: Match error: Expected particular constructor
    at checkSubtree (http://meteor.local/packages/check.js?ac81167b8513b85b926c167bba423981b0c4cf9c:287:11)
    at check (http://meteor.local/packages/check.js?ac81167b8513b85b926c167bba423981b0c4cf9c:67:5)
    at _.extend.send (http://meteor.local/packages/edgee_slingshot.js?83a247b1bf011050d107d9d4e4ac2b3c0ae4ab34:110:7)

Files uploaded using a file-input field are working fine with my code. It's the data URI's I'm struggling with (BTW: had the same problem with CollectionFS, so I hoped it would work better with slingshot).

Does anyone have an example that works on the iOS simulator?

None of the example work for me.
The code below works for me on<EMAIL_ADDRESS>hope will help someone i don't try on iOS simulator just on actual device.
function videoCaptureSuccess(mediaFiles) {

  var file = '/local-filesystem' + mediaFiles[0].fullPath;

  getBlobURL(file, "video/mp4", function(url, blob){
    uploader.send(blob, function (error, downloadUrl) {
      alert(downloadUrl);
    });
  });
}

function getBlobURL(url, mime, callback) {
  var xhr = new XMLHttpRequest();
  xhr.open("get", url);
  xhr.responseType = "arraybuffer";

  xhr.addEventListener("load", function() {
    var arrayBufferView = new Uint8Array( this.response );
    var blob = new Blob( [ arrayBufferView ], { type: mime } );
    var url = window.URL.createObjectURL(blob);

    callback(url, blob);
  });
  xhr.send();
}

+1

Same problem here: the file stored on AWS S3 is 15 bytes long and contains:
[object Object]
I still don't understand why exactly. It would be cool to patch Slingshot instead of using a hack. After all the goal of Slingshot is to avoid these sort of pains.

While working on Ionic 2 app I encountered same issue with FIleReader events not firing. Turned out to be an issue with zone.js and after long hours I got an workaround here: https://github.com/driftyco/ionic-native/issues/505#issuecomment-243434491


Move notebook controller state to 'status'

This PR moves the notebook controller state to the status stanza. It also adds the necessary code to the backend and frontend
Resolves: #309

@andrewballantyne @DaoDaoNoCode Since environment variables are unused in dashboard config, should I remove them (and secrets) as part of this PR?

I prefer not, I already updated that in my PR https://github.com/opendatahub-io/odh-dashboard/pull/331.

Yeah, I agree -- this PR does not need to try and clean anything up within' the block. It should handle the status change and that's it. The contents within' have other obligations in the UI and shouldn't be removed without @DaoDaoNoCode's PR's extra work.

Reverted the deletion of secrets and envvars cc @andrewballantyne  @DaoDaoNoCode

Could you rebase this PR? @maroroman

Looks like your branch has conflicts -- can you rebase?


Revisiting pin inheritance

We've had additional discussions about Pin inheritance, and I've consulted the book SQL Antipatterns by Bill Karwin for some additional context. To summarize our work so far, we started with a single table for Pin objects, and we were relying on application code in our front end to differentiate between dataset pins and note pins. Our goal was to reduce this overhead, and eliminate the need for a sparse table.
One pattern we discussed briefly but never implemented is discussed in the book and called Single Table Inheritance. It basically takes our single, sparse Pin table with columns for all possible subtypes, and adds a column for pin_type. With this approach, we don't need to add application code to infer pin types on the front end. This could be a viable solution for Pins, because we currently only have 2 types of Pins with 3 fields that belong to one type or the other. One potential drawback of this approach is that our back end code needs to properly set pin_type whenever a new Pin is created. Additionally, if we decide to add new Pin types in the future, we need to modify the table by adding any columns needed for the new Pin type, increases the number of null values we keep in the Pin table. This is probably not an issue at this point in the project, but something to keep in mind.
On Monday we discussed a different pattern outlined in the book. The Concrete Table Inheritance pattern would define a table for each Pin type, with common attributes duplicated across both tables. The tradeoff here is that we don't have a sparse table and we don't need a pin_type column, but we double the work if we need to add columns that apply to all Pins, and we have to deal with multiple queries to get all Pins. According to SQL Antipatterns, the best application of this pattern is in situations where we don't often need to query all subtypes at once. In Atlascope, we currently ask for all pins that belong to a given investigation. Django and its ORM might ease this burden somewhat (the book is strictly a SQL/relational design perspective), so this option might be worth exploring, at lease in a draft PR.
Our currently solution implements the Class Table Inheritance pattern through Django's model inheritance. It eliminates the sparsity of the Single Table pattern by keeping attributes common to all Pins in one table, and using foreign key relationships to store subtype-specific information. This pattern is best used when we're frequently interested in the common Pin attributes. This is a query that we do often. We want to get all pins that belong to a particular investigation, and then we want to get all of the properties of the subtypes by joining the tables together. I think this pattern is actually the best fit for our needs, but we might need to revisit our initial approach.
Initially when exploring django-polymorphic I was turned off by the number of outstanding issues and seeming lack of activity from contributors. On closer inspection it seems that the bugs that people are complaining about have workarounds when they crop up, and they weren't manifesting when I explored using the package in PR #170. That plus our team having experience with the package makes me more confident with bringing in the packages. Using vanilla Django worked fine, but using django-polymorphic gives us a more battle-tested tool to accomplish the same thing.
@waxlamp @annehaley I'd like to know if you have any additional thoughts here. Based on what I've been reading, I think our current approach (Class Table Inheritance) is the best fit, but maintaining our own watered down version of django-polymorphic isn't worth it, and we should just bring that package in.

I think your concluding thought that we should use django-polymorphic is sound (and matches my initial intuitions). It solves the problem in a way that lets us get on with our work, and it gives us exposure to this way of dealing with table inheritance.
The only downside to this approach is that we simply don't have enough experience to know that this is good/bad, and we don't have the scale in this Phase 1 of the project to gather that experience now. So, I would treat this as a learning experience rather than a positive discovery of the right way to do this in general.
If there's a Phase 2, we can revisit this approach (and the whole problem space) much more critically, with more input from seasoned veterans of Django/Postgres based projects, and we can bring this analysis and our limited experience from Phase 1 to bear on that discussion.
I still have not read the mentioned chapters of Karwin, but I will do so and follow up with any addition thoughts when I do.
Thanks, @naglepuff, for thinking hard about this topic.


Allow for multiple users

It would be nice to have multiple RStudio users on the same droplet. I tried working around this with the following commands:
d %>% droplet_ssh("adduser --disabled-password --gecos '' testuser")
d %>% droplet_ssh('echo "testuser:testpass" | sudo chpasswd')
Even though I don't get errors with these commands, the users are not created (i.e. I cannot login to RStudio with testuser/testpass).
On that note, is there a way to get the default root password that supposedly DO returns when the droplet is created?

@jbryer how did you get rstudio installed?  manually on the command line?  using docklet_rstudio() ?

We recommend using ssh keys instead of passwords. If you use a password after setting up droplet, you should get the password in an email. Does that not happen?

Here's the full R code I am using:
d <- docklet_create(name = "EPSY530Summer2015",
size = getOption("do_size", "512mb"))
d %>% docklet_pull("rocker/hadleyverse")
d %>%
droplet_ssh("adduser --disabled-password --gecos '' testuser", verbose=TRUE) %>%
droplet_ssh('echo "testuser:testpass" | sudo chpasswd', verbose=TRUE)
d %>% docklet_run("-d",
" -p 8787:8787",
" -e USER=rstudio",
" -e PASSWORD=rstudio ",
"rocker/hadleyverse"
) %>% docklet_images()
d %>% droplet_ssh('ls -la /home') # This shows testuser, but not rstudio user
I do not get the password via email when I start the droplet from R. I can get it if I do a password reset from the DO website.
Thanks, Jason

thanks @jbryer I'll have a look

Just another data point. I manually installed R and RStudio using the instructions here: http://applyr.blogspot.com/2015/05/teaching-r-course-use-analogsea-to-run.html?showComment=1432855375259#c8441958524220453981
The droplets() function returns my droplet and I can create users using the droplet_ssh calls I included above and it works. We'll see how this works tomorrow for my class (just 13 students so we'll see how many I can support on one droplet.

hey @cboettig - I imagine you've solved this issue before. How can we get a bunch of users added to the Rstudio server being created via docker?

@cboettig looks like this is helpful https://github.com/rocker-org/rocker/wiki/Using-the-RStudio-image#multiple-users - Although from analogsea, I'd like to do this non-interactively, and allow users to do this from this pkg, perhaps when they setup their droplet.
We have docklet_rstudio(). Could add function docklet_rstudio_addusers() or similar

yup -- there's a function we added on the rstudio-based images called add-students that adds up to 100 student accounts with user name = user password of the form "user1", "user2" etc.  The script has to be run as root, e.g. at runtime:
docker run -d -p 8787:8787 rocker/rstudio add-students && supervisord

should do it.  Of course these aren't the most secure name and password combinations.
For a smaller group of students for longer term use, you might want to run the droplet with root access e.g.: docker run -d -p 8787:8787 -e ROOT=TRUE rocker/rstudio and then just add them with a system call and custom user names and passwords; e.g. from inside R:
# replace USERNAME and PASSWORD appropriately
system("sudo useradd user$u && echo "USERNAME:PASSWORD" | chpasswd")
# make a home folder for user:
system("sudo mkdir /home/USERNAME && chown USERNAME:USERNAME /home/USERNAME")
## Optionally, let user install R packages into the global library:
system("sudo  addgroup USERNAME staff")

Clearly that could be more elegantly wrapped by analogsea.

Alternatively, we could spin up an nginx proxy, serve over (self-signed if no professional cert is available) https.  This means you could just use the add-students script because the real security layer would be before then in signing into the https, and the script just lets students have separate workspaces and all sign in at the same time.
My understanding is that https isn't critical since rstudio encrypts passwords anyway with client-side libraries, but this approach would be easier particularly in contexts where the students already have logins for some proxy host -- e.g. when deploying on campus infrastructure rather than in the cloud.

nice, thanks @cboettig !  Playing with these now

hmmm, i can spin up rstudio like
docker run -d -p 8787:8787 -e USER=rstudio -e PASSWORD=rstudio  rocker/rstudio
but this is erroring with exec format error
docker run -d -p 8787:8787 -e USER=rstudio -e PASSWORD=rstudio rocker/rstudio add-students && supervisord

Whoops, my bad.  Have to pass as a command string to bash.  I think this
should work
docker run -d -p 8787:8787 -e USER=rstudio -e PASSWORD=rstudio
rocker/rstudio bash -c "add-students && supervisord"
On Mon, Jun 1, 2015 at 4:53 PM Scott Chamberlain<EMAIL_ADDRESS>wrote:

hmmm, i can spin up rstudio like
docker run -d -p 8787:8787 -e USER=rstudio -e PASSWORD=rstudio
rocker/rstudio
but this is erroring with exec format error
docker run -d -p 8787:8787 -e USER=rstudio -e PASSWORD=rstudio
rocker/rstudio add-students && supervisord
—
Reply to this email directly or view it on GitHub
https://github.com/sckott/analogsea/issues/101#issuecomment-107749029.

@cboettig sweet! that worked,
now to make it useable for others...

@jbryer How did the class go today, if it was today?

@jbryer reinstall, then try this
d <- docklet_create()
d %>% docklet_rstudio() %>% docklet_rstudio_addusers()

@sckott The class went well, thanks for asking. I had 13 students on a 1gb working on the first lab from the OpenIntro book and didn't have issues until the end of class. I was able to quickly restart with a 2gb instance and seems are working well for now. It is nice to change the server as needed.
Back to this issue, adding users through analogsea still doesn't work. Here is the code and error I am getting:
d <- docklet_create(name='TestRStudio')
d %>% docklet_rstudio()
d %>% docklet_rstudio_addusers(user='test', password='test')

Error:
time="2015-06-02T17:00:26-04:00" level=fatal msg="Error response from daemon: Cannot start container 7c0affadb6539b65df4e1c433033e81b725e2d0e71150fde6276f37d8c95a9e5: Bind for <IP_ADDRESS>:8787 failed: port is already allocated"
Error: ssh failed
ssh -o BatchMode=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/var/folders/68/1b6hk5t941gc2p97nsvkslpw0000gn/T//Rtmpm6dGdr/hosts<EMAIL_ADDRESS>'docker run  -d -p 8787:8787 -e USER=test -e PASSWORD=test rocker/rstudio bash -c "add-students && supervisord"'

Hmm, looks like analogsea isn't shutting down previous docker instances.  A
previous docker instance probably has port 8787 already assigned to it.
you could of course just use a different port, but it would be better to
close down the previous instance first.
On Tue, Jun 2, 2015 at 2:03 PM Jason Bryer<EMAIL_ADDRESS>wrote:

@sckott https://github.com/sckott The class went well, thanks for
asking. I had 13 students on a 1gb working on the first lab from the
OpenIntro book and didn't have issues until the end of class. I was able to
quickly restart with a 2gb instance and seems are working well for now. It
is nice to change the server as needed.
Back to this issue, adding users through analogsea still doesn't work.
Here is the code and error I am getting:
d <- docklet_create(name='TestRStudio')
d %>% docklet_rstudio()
d %>% docklet_rstudio_addusers(user='test', password='test')
Error:
time="2015-06-02T17:00:26-04:00" level=fatal msg="Error response from daemon: Cannot start container 7c0affadb6539b65df4e1c433033e81b725e2d0e71150fde6276f37d8c95a9e5: Bind for <IP_ADDRESS>:8787 failed: port is already allocated"
Error: ssh failed
ssh -o BatchMode=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/var/folders/68/1b6hk5t941gc2p97nsvkslpw0000gn/T//Rtmpm6dGdr/hosts<EMAIL_ADDRESS>'docker run  -d -p 8787:8787 -e USER=test -e PASSWORD=test rocker/rstudio bash -c "add-students && supervisord"'
—
Reply to this email directly or view it on GitHub
https://github.com/sckott/analogsea/issues/101#issuecomment-108098267.

@jbryer Thanks for the feedback! I think @cboettig is right on that point. I'll see if I can help prevent that from happening.

hey @jbryer if you get a chance give the most recent version a try.
devtools::install_github("sckott/analogsea")
You can add users when installing rstudio
e <- docklet_create()
e %>% docklet_rstudio(add_users = TRUE) # false by default

Or, add users after installing rstudio, requires shutting down rstudio container, and starting a new one
e %>% docklet_rstudio_addusers()

@sckott Do you happen to be at useR? This still doesn't work for me and would love to meetup (buy a beer), and take a look.

@jbryer Hi! I decided not to go this year - wish I could meet up with you. when you get a chance, let me know what errors you run into, or is it the same as above https://github.com/sckott/analogsea/issues/101#issuecomment-108098267

@jbryer id be happy to do a call with you if you want to see if we can get this sorted

@jbryer happy to do a call if you want to chat about this, otherwise closing for now


JVM-based procedural scheduler prototype

Create a demo-able prototype for procedural scheduling, where the user code is written in Java (or Kotlin!). It will probably be similar to Adrien's external scheduler in a lot of ways. The main differences for the demo will be a more streamlined profiles/activities interface and a revised goal interface.
### Tasks
- [ ] meet with @adrienmaillard to see what parts of the external scheduler can be reused
- [ ] basic timeline objects (profiles, activities, conflicts)
- [ ] connect to database
- [ ] revisit interface (simulation control, should be able to return conflicts or directives)

Other tasks, such as using the mission model's value mappers, feature-complete profile operations, integration into the schedule action, and providing a template build.gradle file for compiling multiple jars are not included in the prototype.

will replace with smaller tickets


Not Secure

Seems we have an expired certificate or something for www.threefold.tech it's flagged as not secure.

fixed


[YouTube] Add new age-gate bypass

Before submitting a pull request make sure you have:

[x] At least skimmed through contributing guidelines including yt-dlp coding conventions
[x] Searched the bugtracker for similar pull requests
[x] Checked the code with flake8

In order to be accepted and merged into yt-dlp each piece of code must be in public domain or released under Unlicense. Check one of the following options:

[x] I am the original author of this code and I am willing to release it under Unlicense
[ ] I am not the original author of this code but it is in public domain or released under Unlicense (provide reliable evidence)

What is the purpose of your pull request?

[x] Bug fix
[x] Improvement
[ ] New extractor
[ ] New feature

Description
In a research project (https://github.com/zerodytrash/YouTube-Internal-Clients) I hammered the Innertube API with 8k requests in order to find a new age-gate bypass client. Turns out the client TVHTML5_SIMPLY_EMBEDDED_PLAYER with version 2.0 has no age restrictions in place and it seems to have the same success rate as  clientScreen:EMBED.
Request:
POST /youtubei/v1/player?key=AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8 HTTP/2
Host: www.youtube.com

{
    "context": {
        "client": {
            "clientName": "TVHTML5_SIMPLY_EMBEDDED_PLAYER",
            "clientVersion": "2.0"
        },
        "thirdParty": {
            "embedUrl": "https://www.youtube.com/",
        }
    },
    "videoId": "dqRZDebPIGs",
    "racyCheckOk": true,
    "contentCheckOk": true
}

Not sure if it still makes sense to try the clientScreen:EMBED clients (are they completely broken?)
I added the new bypass beside the existing one.

for future reference, is this the only client without age-gate that you found?

for future reference, is this the only client without age-gate that you found?

Yes

Not sure if it still makes sense to try the clientScreen:EMBED clients (are they completely broken?)

afaik, yes
@coletdjnz

Yeah they seem completely broken rn. Might as well remove them from being automatically added (and from docs?) for now. But keep the definitions in code for the time being so they can be used just in case.
I'm thinking we add this client (and then embedded if it fails) for age gated videos.

Like this?
Users can still use the old bypass via --extractor-args "youtube:player-client=web_agegate"

Not quite. But I'll fix that

Not quite. But I'll fix that

yeah. need to make sure the creator bypass works as well

Just wanted to let you know that I've finished compiling yt-dlp since this update is not in the release version yet. I'm successfully able to watch age-restricted videos now. Thank you @zerodytrash for finding this fix! Let's hope NewPipe catches on soon.

They are aware of the solution https://github.com/TeamNewPipe/NewPipe/issues/8102#issuecomment-1081085801. It is likely only a matter of time before a fix is implemented


Installing to production

Having issues installing to production because of getting .env file to server. Any suggestions?

was able to add these during deployment usin


corrected spelling 'differnt' to 'different' on line 181

[x] I have read freeCodeCamp's contribution guidelines.
[x] My pull request has a descriptive title (not a vague title like Update index.md)
[x] My pull request targets the master branch of freeCodeCamp.
[x] None of my changes are plagiarized from another source without proper attribution.
[x] My article does not contain shortened URLs or affiliate links.

If your pull request closes a GitHub issue, replace the XXXXX below with the issue number.
Closes #XXXXX

Closed and Reopened this PR to attempt to resolve a specific Travis build failure.


JSON support

Support for querying / writing JSON values, similar to SQLite's support (https://www.sqlite.org/json1.html) and PG's support (https://www.postgresql.org/docs/14/functions-json.html).
Ideally should be built as a separate crate (e.g. datafusion-json / seafowl-datafusion-json) that defines DataFusion UDFs/UDAFs to manipulate JSON data, but if it isn't implementable as that, we can keep it in Seafowl or contribute as a patch to DataFusion.
Minimum useful set of functions

json_extract (SQLite-style) / json_extract_path (PG-style): get a value out of a JSON value
json_set: replace/add a value inside of a JSON value
json_group_array+json_group_object (SQLite-style) / json_agg+json_object_agg (PG-style): aggregation function that turns a table into a JSON object/array
json_object/json_array: create an inline JSON object/array from the function arguments

Investigate how to "tag" a JSON value using Arrow's type system
SQLite tries to get away with treating JSON values as strings, but sometimes we do need to distinguish between a string and a string that is actually a JSON object.
There's a difference between
json_set('{"a":2,"c":4}', '$.a', '{"b": 42}')

and
json_set('{"a":2,"c":4}', '$.a',  json('{"b": 42}'))

In the first case, we're setting the value of a to be the string {"b": 42}. In the second case, we're setting it to a JSON object. We might need to define an equivalent function / Arrow datatype (even if we ultimately store JSON values as strings in the Parquet file, we need to occasionally distinguish between strings and strings that are JSON values in our type system).
We could use the Arrow struct type (https://github.com/apache/arrow-rs/blob/master/arrow-schema/src/datatype.rs#L169), though it requires the types of the values to be predefined. We could instead make the struct have a single field, json: Utf8, that Seafowl will know to treat as JSON.
Some inspiration from Snowflake? https://docs.snowflake.com/en/sql-reference/data-types-semistructured.html
Table-valued functions (set-returning functions)
SQLite JSON functions like json_each/json_tree and PG JSON functions like json_each/json_array_elements (that return SETOF) actually return a table that we can then join on.
User-defined table functions are currently unsupported in DataFusion (https://github.com/apache/arrow-datafusion/issues/1604 / https://github.com/apache/arrow-datafusion/issues/1608): we could contribute support for them and then build JSON support on top of that, or implement it using DataFusion's custom logical plan / optimizer rules if possible.

User-defined table functions are currently unsupported in DataFusion (https://github.com/apache/datafusion/issues/1604 / https://github.com/apache/datafusion/issues/1608)
Just updating because this is still open, user defnied table functions are supported now and should be capable of being used to implement a json_each
https://github.com/apache/datafusion/blob/main/datafusion-examples/examples/simple_udtf.rs


Add sample that uses the advanced rendering mode (not auto-stereo)

We only provide samples that use auto-stereo. ANGLE-holographic has an advanced rendering mode where the stereo effect can be controlled by the script; we should have a sample on how to achieve this.

Closing without fixing the issue. Stereo through instanced drawing is not a standard and further complicates the script samples.


Compton puts shadow under window

I can tell compton to cease and desist with compton --shadow-exclude 'bounding_shaped' , but I saw a comment in the source which mentioned disabling shadows. Unfortunately, it doesn't seem to be working without configuration on compton's side.
compton --version
v0.1_beta2.5

From memory, I believe there isn't really a standard way of disabling this for all composite managers. Someone reported this before on the (now-deleted) BitBucket repo, after which I made the fix you mentioned. Pretty sure it worked for that person at that time, though. Not sure why it doesn't now.

Actually, looking through the commit history it may be the case that I was working on this and simply never quite finished it. I don't remember (it was over a year ago...).

Ah well, certainly not a big deal. Disabling shadows on shaped windows sounds like a generally fine idea anyway, heh.

Added a note in the README for now; I'll leave this open for investigation later ("soon™").


Clean up CSP of next js

Description

This PR cleans up the CSP of our NextJS app.
Risk

Deploy Plan

:+1: