Code looks fine to me. There might be a hidden race condition. The p.Count++ and p.Count-- are atomic ops. For every ++ it's corresponding -- should be called TBD.
package pool
import (
import gleam_cowboy | |
import gleam/http.{Request, Response} | |
import gleam/http/response.{ok} | |
pub fn main() { | |
gleam_cowboy.start(fn(_req: Request) { | |
ok("Hello, Gleam!") | |
}, on_port: 3000) | |
} |
Code looks fine to me. There might be a hidden race condition. The p.Count++ and p.Count-- are atomic ops. For every ++ it's corresponding -- should be called TBD.
package pool
import (
// Using this code, we can retrieve an image from a user's filesystem, resize the image, and then upload the image | |
// to a server using AJAX. Because we use base64 encoding, we can just include the image data as just another string value | |
// in a JSON payload. | |
// So we can use AJAX to send the file to a server, which is convenient. | |
// We have one line of relevant html | |
// get file in the first place => <input type="file" custom-on-change="onAcqImageFileChange" class="form-control"> |
by Sebass van Boxel, Solutions Engineer at GitHub (2018-present)
First of all, I would try less destructive ways to clean up disk space in your git project. If you're collaborating on a repository with others, it's considered a bad practice to rewrite published history. If you’ve already decided that this is what you want to do, please skip the first part. One of the great powers of Git is that it preserves all history. Often you only realize that you really needed that history when it isn’t there anymore. For new people that join your project, it can be of great value to know what happened for what reason, by “removing” those old commits, they'll lose that context. My advice, before anything else, would be to run Git’s built-in housekeeping task:
we can use this domain middleware
const Domain = require('domain');
app.use((req,res,next) => {
const getBBBMeetingInfo = async (meetingID) => { | |
const getMeetingInfo = api.monitoring.getMeetingInfo(meetingID); | |
const result = await bbb.http(getMeetingInfo); | |
result.meetingID = meetingID; | |
if(result.returncode == 'FAILED'){ | |
updateNotificationCallStatus(meetingID) | |
} |
This is some bad code, but illustrates the difficulty, futility, and pointlessness of implementing map/filter with Iterables.
Note that these are lazy (not eager). Nothing runs until the for..of
is called on an instance, etc.
class IterableWMapFilter<T> {
vals : T[]= [];
const http = require('http'); | |
const server = http.createServer((request, response) => { | |
response.end(` | |
<html> hello world this is julian, here is an image: <br> | |
<img src="https://static.wikia.nocookie.net/history/images/6/6a/Classical_greece..jpg"></img> | |
</html> |
this code does what you'd expect and useful for avoiding unnecessary arrays (although a standard for-loop is usually fine...)
export class IterableInt {
point = 0;
start: number = 0;
end: number = 0;