Post your code and be judged

Post your code and be judged.

Attached: scrot.png (613x361, 33K)

Other urls found in this thread:

github.com/babel/babel/issues
twitter.com/NSFWRedditVideo

javascript is such a retarded language

your redarded

that's really mean friend

Router router = Router.router(vertx);
router.route().handler(routingCtx -> {
routingCtx.response().putHeader("content-type", "text/html").end("Hello, Router!");
});

vertx.createHttpServer().requestHandler(router).listen(8080);

>vertx
based

t. cuck without a job

js is based on C, so you're essentially saying that C is a bad language

>void *

What is this bullshit?

nobody has ever used that in a situation other than making operating systems, same with pointers in general

>literally unreadable
statically typed languages in a nutshell

That logic is neanderthalic.

#include
#include

/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int main(int argc, char *argv[]) {

int cx,cy,xo,yo,vz,vr,tz,tr;
printf("These are the robots Zendy and Robby \n");
printf("Zendy is in position:X=10 e Y=5 \n");
printf("Robby is in position:X=15 e Y=10\n");
printf("Input coordinates of X \n");
scanf("%d",&cx);
printf("Input coordinates of Y \n");
scanf("%d",&cy);
printf("Insert Zendy's speed \n");
scanf("%d",&vz);
printf("Insert Robby's speed \n");
scanf("%d",&vr);


for(cx!=0,cy!=0;xo==cx,yo==cy;cx+=vz,cy+=vz){

yo=5;
xo=10;
tz=cx-xo/vz;
printf("");
}
return 0;
}

Attached: code.png (851x1147, 62K)

>not initializing variables
>e
>printf("")

_________(You)

kek

actually, you just made me realized I fucked up badly with replacing stuff. Thanks, only local variables were supposed to start with "_".

for(cx!=0,cy!=0;xo==cx,yo==cy;cx+=vz,cy+=vz)
wait what the fuck is even happening here

that is enterprise(tm) for you, young one.

I wrote this during a C# game jam for a XCOM clone.
I'm pretty proud of what I did with this team system, although it's not much.

Attached: team code.jpg (1108x886, 106K)

do you actually need to explicitly pass this to class methods in C#?

What do you mean?

no.
that's what we in C# call "extension methods".
you can have a
public static RemoveFaggot(this string) {}

method that removes all instances of "OP" from strings
string op = "OP is a faggot";
op.RemoveFaggot();

don't use that, though, that's just polluting the namespace

Oh now I get.
Yeah, enums need their own extension methods to add methods to them. You can't just inherit from an enum AFAIK.

Attached: Screenshot from 2019-03-17 22-33-03.png (562x701, 12K)

Reading the Craft of Prolog and giving writing a pseudo-lisp interpreter a go.

bump

require 'viewmat'

xmax =. 0.6
xmin =. _2.2

ymax =. 1.2
ymin =. _1.2

size =. 1080 1920

cPlane =. (j.@(+&ymin)@(*&(ymax - ymin))@>@{. +/ (+&xmin)@(*&(xmax - xmin))@>@{:) (i.

require 'trig'
viewmat (*:@sind +/ *:@cosd) i.360

>same with pointers in general
You've really never done a genuine project solution in C/C++ have you?

>semicolons on their own line
dont care what language this is, kys

Not sure if I like the idea of maintaining a dictionary of all the ServiceContracts a specific service implements. Haven't implemented all the proper exception handling, but it's currently operational for any Service that implements one or more ServiceContracts.

Attached: WCF_Service.png (699x961, 49K)

>var
>not using the one-var rule
>not using optional parameters
>bad formatting
>single quote
>loose equality
>inline regex
retard

Attached: unknown.png (657x982, 37K)

what's the output of this?

I don't have a J compiler installed

What's the difference in Throttle and de-bounce in JS?

the throttler class here makes sure only concurrency number of promises are in-flight at a given time, while de-bounce just puts an operation on a timer and if you call it again then the timer is refreshed. The latter is useful when dealing with autocompletion so you don't hammer the server after every keystroke.

why are you implement this from scratch? aren't there already libraries that do that?

Is this what a good JS dev does?

I had just finished up for the day, but here's a snippet of what I've been working on. Part of a code generator for an IDL.

Attached: 2019-03-17-204207_645x1124_scrot.png (645x1124, 46K)

if you spent 10 seconds in google then you'd know that Bluebird is a polyfill only library, but the API has some neat stuff like map with concurrency limit option. this is simply a modern rewrite of the API to make working with promises even better

>no syntax highlight

>var
>function

fuck you. fuck you so much. disgusting scum.

>what is backwards compatibility
>thinks let, const, arrow functions are supported everywhere

retard detected

found the retard. kill yourself.

it's a small sacrifice to make for the other advantages of the editor.

>what is babel
or, even better, use typescript. or even better than that let es5 die.

such as? i bet every modern editor has those features you want.

>thinks babel can solve all problems
>doensn't about the special cases where you have to do manual tuning
retard detected

alright you fucking genius, name one case that would come up.

get a job and find out

babel does solve every problem
that's literally its only purpose
why are you not just writing everything in asm if you are this retarded

i do have one, and it hasn't happened yet.

this.

>github.com/babel/babel/issues
>675
Ok, kid

>number of issues is proportional to popularity
wow who would have thought

>No comments
Still in college detected

>people in real life comment code
jobless detected

If your code needs more than docstrings, your code is shit. Good code, 99% of the time, explains itself. Pic related is you.

Attached: when_girls_kode.png (287x261, 46K)

function to compute C = AB + C, fairly efficient when used with tiling

Attached: ugleh.png (742x685, 101K)

Seems I hit a nerve.
Stay mad
T. QA

>QA
lmfao

it's not about more/less features, it's about how those features are implemented. Besides syntax highlighting, Sam does just about everything you'd expect from a text editor, plus a few extra things because of the way its command language interacts with the outside world. However, it uses the mouse differently from any other editor (besides acme, of course) and its command language is very powerful.
Something about it just clicked with me. the first time I used Sam, it felt like I had been using it for years. I know it isn't for everyone, but I like it.

d = "".join([chr(i[0]^i[1]) for i in zip(bytearray(hashlib.sha256(k).digest())*((len(d))+1),bytearray(d))]) where d is some data and k is a key.
Crude, obtuse XOR encryption. Intentionally weak.

>Sam
Brought me some memories, what a good editor. Have a nice day.

how's that life, boomer?

I'm doing well. How are you? Have talked to that girl you like lately?

I was sitting next to this really hot Thai girl on the bus and all I could think to myself was, “Don’t get an erection, don’t get an erection”… But she did.

you too, user

>exposes your shit code in action every sprint.
Stay mad front end cuck

>agile
I'll take "how to detect a wagie" for 100, alex

>Lives with his parents
>hardly gets gets jobs because of sperg like behavior

Enjoy that 20,000 a year due to getting outsourced by pajeets you anti social fuck.

seething lmao

>seething
>wagie
I rest my case.

cope

I work in an office that actually creates things, instead of grooming mountains of pajeet shit. If you did too, you'd know that agile is disastrous for actual innovation, and is only useful for maintaining existing systems

Imagine someone implying that C isn't a clusterfuck...

autism

Is the joke that it's unreadable do to the pic being smaller than your dick?

Attached: 1550383816902.png (623x450, 35K)

A simulator to solve pic related from a /v/ thread that died.

My loop felt inelegant, how could I have improved it?

import random

def generate_births_one_generation(citizenry_family_count):
families = []
for i in range(citizenry_family_count):
families.append([])

all_boys = False
while all_boys == False:
all_boys = True
for family in families:
if family != [] and family[-1] == 'b': #Has kids and they had a boy; this family's done.
pass
else: #No boy yet. Assumption: People will keep having kids, because medieval times.
all_boys = False
gender_int = random.randint(0,1)
if gender_int == 0:
family.append('b')
else:
family.append('f')

girl_count = 0
boy_count = 0

for family in families:
for person in family:
if person == 'f':
girl_count += 1
else:
boy_count += 1

return [girl_count, boy_count]

Attached: plan_testing.png (1000x1024, 925K)

>>>>>

hehehehehehe

Attached: perhaps.png (60x60, 8K)

that gml?

I agree that you shouldn't like that, it's a big dependency and it's a code smell.

You probably should make your dictionary a dependency injection which you'd initialize via config and set up at your solution's entry point; you'll be a much happier person when your boss tells you it's time to implement either a new or modified service base OR contract #87 and it's a one-liner.

kek

Attached: smug.jpg (4800x4800, 1.44M)

by writing it in nim

Attached: 1550885097585.jpg (720x723, 173K)

>scanf

Attached: In_the_Court_of_the_Crimson_King_-_40th_Anniversary_Box_Set_-_Front_cover.jpg (300x300, 85K)

#include
#include
#include

int procreate(int n)
{
int girls = 0;
for (int i = 0; i < n;) {
if (drand48() < 0.5)
++girls;
else
++i;
}
return girls;
}

int main()
{
srand48(time(NULL));

int girls = 1000;
int boys = 1000;

for (int i = 0; i < 1000; ++i) {
boys = girls;
girls = procreate(girls);

printf("Iteration %d: %d boys, %d girls (%.2f%%)\n", i, boys, girls,
girls ? (double)girls / (double)(girls + boys) * 100.0 : 0.0);

if (girls == 0) {
printf("Population died out\n");
break;
}
}
}
(The answer is that it does not affect the proportion of girls to boys)

What's kinda fun is trying to take the problem a little further by imposing rules for realism.

For example, neither of our models include incest prevention, since all that's used to iterate is a boy-girl count (the next batch of families must be formed from non-family pairings). This might mess with the final result, and I'm not sure how.

#include
#include
#include

int main( )
{
Display * dpy = XOpenDisplay( nullptr );
if ( !dpy )
{
std::cerr

>2019
>Xlib
If you're going to write something for a deprecated display sever, at least don't use the deprecated library for it too. Use XCB.
>C++
Don't use that garbage either.

hehehe was already looking forward to complaints on c++ :3

I hear bubbling in my brain when I read this

If you needed to write a simulator to get that answer, you're an idiot. Assuming that every birth has a 50/50 chance of being a girl, obviously it wouldn't raise the ratio of girls. If, on the other hand, some woman are more likely to have girls, then it would raise the ratio.

It's obvious that the ratio wouldn't change, but it doesn't hurt to check. It takes like a couple of minutes to write something like that.
Sometimes the intuitive answer turns out to be the wrong one, like in the monty hall problem.

The answer to the monty hall problem is intuitive.