/dpt/ - Daily Programming Thread

Previous thread: What are you working on, Cred Forums?

Other urls found in this thread:

github.com/microsounds/akari-bbs/tree/master/img/banner
spacemacs.org/
w3fools.com/
youtu.be/Iv5qc0RpBk0?t=2m33s
w3schools.com/js/js_window.asp
onlinetonegenerator.com/
youtu.be/lgCs4BmKWBs?t=807
developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API
w3schools.com/jsref/obj_window.asp
bigmachine.io/products/the-imposters-handbook?variant=29234251143
tuksons-icon-trade.tumblr.com/post/140844619165/629-akari-akaza-icons-yuru-yuri-manga
twitter.com/SFWRedditGifs

Following a terrible video tutorial to learn C#.

Any better resources?

...

MSDN

I'm learning emacs lisp.

>C
>Quality

>google "good c# books"
>find a good one
>torrent it

vim > emacs > np++ > sublime > atom

I need step by step tutorials. Not documentation.

You're right, I forgot
>Trash
>C#

sublime > *

why not just look on library genesis senpai

Wew

kindof similiar to torrenting tbqhf

MSDN has a tutorial.

I would agree if I could fucking figure out how to compile c with sublime. Til then it's vim

t. webdev on wangblows

How is vim better than emacs?

What's the problem with a proper IDE?

name a proper IDE

>I would agree if I could fucking figure out how to compile c with sublime.

Tools -> Build System -> C
or
Ctrl + b

dont even use windows

emacs

#define u8 uint8_t
#define u16 uint16_t
#define u32 uint32_t
#define u64 uint64_t
#define i8 int8_t
#define i16 int16_t
#define i32 int32_t
#define i64 int64_t

vim

you have passed the test

i just think it's a better experience, at least for the books i read
there isn't a popcorn time-type thing for books, is there?

you may cross the bridge

What do I win?

emacs

passage across the bridge

there's a fat bearded man guarding the entrance

what do

I don't want to cross the bridge though.

ask him to name a proper IDE
if he fails, he will be cast into the depths

Sing the FSF song and pass safely.

C-xC-c

He said i need a special item to enter. but i don't have that

what do

>forgetting your programmer license
How did you even get into this thread?

Wait.... what?

Akari-bbs has more than 500 rotating banners:
github.com/microsounds/akari-bbs/tree/master/img/banner

How the fuck can you waste this amount on time and some random trivial thing?.?

Just say "me too i'm not glad he's dead, but I'm glad he's gone"

>the images are not even optimized

TOP KEK

Learning Java, and they tell me:

>Now, you probably start to wonder why does the value of the parameter get copied and the original variable stay intact when the parameter is of int type, but the original list is given to the method when the parameter is of ArrayList type? In Java only the values of primitive data types (which are int, double, char, boolean and a couple of others that we have not yet discussed) get copied to the method.

Why did they do this?

Akari confirmed masterrace

There is no C build system in sublime. I tried building one by getting code from stack overflow but it's all shit

Larger types, like objects are passed by reference (hence they are reference types). It's an optimization.
it works the same in e.g. C# or Python.

is pokemon go good for losting fat after my programming sesh's?

of course, it's an text editor.

Just don't be a fatty in the first place lardo

Are you really this stupid or are you self-promoting this way?

> It's an optimization
I understand. Thanks for the explanation.

well im trying not to be ... duh.....

But vim is sooooo fucking annoying. Memorising all the shortcuts through vim tutor takes too much time

>are passed by reference
wrong

...

Not related and am stupid

What's your point?

To do that you had to build system, it's not default for C only cpp

Why make an int main and return 0 instead of making a void main if your only purpose is to puts?

Lol?

Elaborate.

Am I the only one programming on the most basic Linux text editor? (MousePad)

Because if you compiled with -Werror and -Wall you still have to return 0 or you get ab error (at least in vim) which is why I hate it

Oh, so that's how it is in C.
(Javafag here.)

>most basic Linux text editor?
>(MousePad)

try ed

>in vim
Jeezus.

static void newInteger (Integer x)
{
x = new Integer(4);
}

public static void main()
{
Integer i = new Integer(5);

newInteger(i);

if (i == 5)
printf("pass by value");
else if (i == 4)
printf("pass by reference");
}


run this

>muh macro
egoinflating oldshits like vi are useless if your programming style is good

why do people put `void` where the args are supposed to go in functions that dont take args when it works without?

is it something wizardy for the compiler like const?

Because they're gay

Old versions of C required this, because empty argument list meant the function was taking variable argument list. I.e.
foo()

Meant the same as
foo(...)

In C:
>void foo() means "a function foo taking an unspecified number of arguments of unspecified type"
>void foo(void) means "a function foo taking no arguments"

In C++:
>void foo() means "a function foo taking no arguments"
>void foo(void) means "a function foo taking no arguments"

only does matter with prototypes.

It's was required back when there were still compilers that parsed K&R C code. It signified that the function doesn't take any arguments instead of filling in the first n variables declared in the function like in K&R C. It's unnecessary now, and it's mostly there as an anachronistic 'style'.

Is there a way to generate default views from models in django in the way ASP MVC does it?

vim or emacs?

notepad++

no

post better 2d and i might tell you

actual question is: atom or sublime?

Vim. Evil mode is shit. Spacemacs is bloated. All I need it an editor, a terminal, and a debugger.

VS Code

Waht's wrong with Noire-sama?

/dpt/-chan, daisuki~

Ask your much beloved programming literate anything (IAMA).

spacemacs.org/

It's still required with prototype/pointer.

Java has primitive types and reference types but everything is passed by value.

>gif
Thank you for using an anime image but you should have posted the webm version; This is the technology board so we expect some decent use of the said technology.

C99 and C11 use the second set of definitions.

whats a good source for kissu animes?

vim

>everything is passed by value
But value of reference types is a reference.

is it weird that this gave me ab oner

>>>/global/rules/13

WebM Source?

The reference is passed by value, so you cannot assign a variable for a reference type to a new value, as in
void swap(int &x, int &y)
{
int temp = x;
x = y;
y = temp;
}

>you should have posted the webm version

say no more familia

>>>/global/rules/6
>>>/global/rules/7

>quality of posts
>/dpt/

Been reading up on html and JS on w3schools for the past few day. Finally get up to the window BOM chapter. "Oh, so this is where the fun stuff happens". Not a fucking mention of window.AudioContext.

Fuck everything. I hate programing. It's just language constructions this and language abstractions that. No one ever fucking teaches you how to actually work with your hardware, so you don't learn do do anything useful. Every programing course is just a load of wanking.

This has been my screen saver for over 6 years.

First of all use MDN instead of W3Schools.
Second why the fuck do you expect low level hardware programming with JavaScript?

I think you meant DOM. Also don't read w3schools. See: w3fools.com/

If you learn the difference between references and objects, you'll see that Java 100% always copies all parameters.

>>>/global/rules/2

Where was the code taken from ?

Neon genesis impacts. it's a short movie.

youtu.be/Iv5qc0RpBk0?t=2m33s

Yes

Passing by reference does mean you pass the reference of the variable, not it's value.

Cred Forums

>w3schools.com/js/js_window.asp
BOM

I want to do something similar to onlinetonegenerator.com/
It's only from looking at the source code that i even have an idea about looking for an audio context in the window object.

I want to include little dots floating across the screen like pic and link related.

Should I just create 50 or so vector2s, and render textures moving independently?

I have literally no idea regarding how many objects and calculations you can have before lag becomes a problem.

I'm using Java.

youtu.be/lgCs4BmKWBs?t=807

lets just say if you can have thousands of them there's something seriously wrong with your code

it's a relatively new api that few people use. i don't know why you would expect a basic tutorial to introduce it immediately

developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API

I need to learn:

SQL
C++
Visual Basic
Java
Oracle

What are the best resources for learning these? I've fallen ass first into a systems analyst role and need to git gud.

>lets just say if you can
is that meant to be can't?

w3schools

yes

that show was gay af yo

okay, thank you user

Lesbians are pretty gay.

Derek Banas? I like his tutorials. He has tutorials on most popular languages.

I expected it to at least be mentioned in their window object reference.
w3schools.com/jsref/obj_window.asp

A basic tutorial is useless if it doesn't help guide you onward to the actually useful stuff. Then it's just language masturbation.
I find this to be a problem with beginner programming courses in general.

microsoft's step-by-step book

I see it comes highly regarded. Thank you.

A USB authentication tool.

You want to render them in bulk and avoid allocating and deallocating them.

Could be a cool idea

Someone explain pointer aliasing to me. I don't get it.

Why is opengl such a nightmare.

I just wanna make video games ;_;

They will be rendered in the same spritebatch, all at once.
Can you explain allocating and reallocating? It doesn't have to be in depth.

>I just wanna make video games
If you're not interested in the internal workings of a game engine, use Unity or Unreal or fucking GameMaker.

Does anyone else pronounce aliasing as analysing when reading it in your head?

Honestly the real problem is that I am, it's just that opengl is so unpleasant to write. I was working on a wrapper for love2d in moonscript, but got fed up w/ that project.

no

Don't constantly create and remove dot objects.

Anyone here use nim? I've been playing around with it the past few days and I really like it

Used vim exclusively for years in college and afterward. Last job forced us to use Eclipse because muh standard toolset. Four years later and now I have to learn vim again. Muscle memory is gone. God fucking damnit. At least I'm free of Java and eclipse.

Rendering ~50 sprites individually wont have any noticeable performance impact. If that's the only thing you wanna do go for it user.
But if you're interested here are some way you can create a better sprite renderer.

> 1
You count how many sprites you have and calculate the size of your vertex buffer. do the vertex transformations on the CPU and send it allover to the GPU and render it all at once.

> 2
Use instanced rendering.

> 3
Just send single points to the GPU and use the geometry shader to create the quads.

Keep in mind that if you use a lot of textures or if Z order matters you want to record the draw commands in a buffer first and then sort it before drawing.

>I'm using Java.
O-oh, I'm sorry.

Of course he should do object pooling. But that's a given right?


Use unity, unreal, godot, ect...

Looking for a dev with real experience with AngularJS

Will pay

Define "real experience"

I have real experience with plain JS. Angular shouldn't be much different

either currently employed as a webdev or has a decent github with projects

Are you in the Boston area?

Yeah, want to meet up at the Starbucks by the train station?

No

this isn't me

>using /dpt/ as a job board
>web programming job also

Is it really that hard to stick an ad on Indeed or Craigslist? And would you seriously trust us to get anything done from all the shit we do here?

Unfortunately, I'm not a webdev and most people here I doubt are also. Have you tried /wdg/?

Yup

you use opengl to program a renderer then you use that renderer to program a game. if you want to program a game, not a renderer, then bypass opengl by using a already existing renderer (ogre3d, panda3d, udk, ...).

A-user, aren't you moving a bit to quickly. My heart isn't ready for that yet.

oh

i'm down even if you're not a dev

we can meet in the commons

oh

this is for an MIT startup btw

you'll never find if you don't ask

this role isn't serious enough for a listing on those sites

cool, where at?

I use a tripcode,

don't call me user

I use a script that replaces all trips with user.

...

Providence.

College dropout here.
Is this book worth it? I can't find a torrent for it. Are there any alternatives?
bigmachine.io/products/the-imposters-handbook?variant=29234251143

...

i can't even tell whos shitposting who anymore

Umm.

I've seen a lot of shops in my time
I can tell from the pixels

How can you say a role isn't serious enough for a listing? Even if it's a temp job and a one time thing, it's not those sites have some guidelines against that kind of thing.

If you want to gamble on the quality of the work you will receive, be my guess.

If you're serious about the role, please use a stupid trip and stop posting stupid screenshots of (You) replies that mean absolutely nothing when we have photo editing software and an actual designated way to tell users apart. You're just wasting brain cells and bandwidth otherwise.

Yeah? You got proof? All I used was snipping tool.

I'd take much more pleasure in screwing over someone from Cred Forums than someone from craigslist

jk

but they'd be better overall as a person, imo

i need someone i can chug 40s with and blast trap music with

Why would you need some sucker from Cred Forums if you're at MIT? Do people not jump at the chance to get on random startups anymore?

you funny guys

I didn't really make them tho.
tuksons-icon-trade.tumblr.com/post/140844619165/629-akari-akaza-icons-yuru-yuri-manga

i need them to do a buttload of work based only off of mockups for equity pay (aka nothing)

Nice tripcode

What you're telling us is that you're playing capitalist, but you don't even have the money to hire someone else. Do they really let any retard into MIT?

The parameter x initially is a reference to the i in main(), but you assign to it a reference to a different object. This doesn't change what i refers to back in main.

Try this:

public class A {
public int a;

public A(int a) {
this.a = a;
}

static void a(A a) {
a.a = 4;
}

public static void main(String[] args) {
A a = new A(5);
a(a);

if (a.a == 5) {
System.out.println("Pass by value");
} else if (a.a == 4) {
System.out.println("Pass by reference");
}
}
}

go read Stirner you ugly fuck

>Stirner

Oh wow, Mr. Spookman

What """features""" would JavascriptScript have?

I don't know but they would be bad

ok i just found out C# is pronounced C sharp instead of C#
and that Java isn't pronounced Jeyva

yeah I'd like to define an INTERCAL of the modern age

Even weaker typing

>"I made this cool program in C-Hashtag."
kekkles

i thought its C hash

>hashtag
Hello twitter

I was thinking about something like only one type: strings

case insensitivity for keywords, variable names and strings

How the operators work depends on the sign of the arguments

i looked into bash and how you make scripts using it

it's kind of cool that functions are commands and the way they return

And CSS is not pronounced "ksss."

could you give an example?

No one will do your homework, research, or job for free.

I always called it iava, like a nordic name

3 + 4 = "34"
-3 + 4 = "1"
3 + -4 = "3-4"
-3 + -4 = "-7"

what happens when two programmers meet

do they talk about programming and what do they talk about

ive neve rmet a programmer

They collide and annihilate one another

oh boy

Even functions are strings.

var factorial = "if the input is one or zero, then the result is one, otherwise multiply the input by the factorial of the input minus one."


Lambdas are just string literals concatenated with other functions.

They talk about their favorite color of striped socks and show off their pantsu.

Sounds a lot like PHP.

They annihilate each other in an explosion of gamma ray photons.

lacking strlen as function hashing mechanism

would PHPscript be even more awful than JavascriptScript?

yes
javascript was designed in a few days
php wasn't designed
rasmus just "kept adding the next logical step"

I'm a little messed, please help.

I tried learning C and then python, but I can't understand C, so I'll do the opposite, python first. but
what python? I remember being problems between python 2.x and python 3.
any advice here? I don't mind reading but there is an awful lot of books out there and I don't want to spend time with an useless manual.

Hard to tell. PHP is shit because it was designed as an HTML template language, or more accurately not designed at all. JS has been shit until recently because it was designed in 10 days. If both are given several years of development from zero, we will certainly get much better languages out of both.

learn some python 2 syntax do some simple scripts and then do 6.00 course at mit ocw

Learn C or give up on programming.

I don't understand it. I want to, but it does not make sense for me.

>until recently

it still has all the shit parts, only that devs try to pretend they don't exist anymore. have you ever looked inside the window object?

Is there a specific thing you don't get, so that we could help you with it? Is it pointers?

Then give up.
C is the lowest barrier to programming.

what part exactly doesn't make sense?

The window object is part of the DOM API, not JS. Most browser APIs are still absolute garbage.

I'll try more and come back with specific questions. thanks.

I'm following the advice of an actuall game developer.
>give up.
why should I? most of the basic stuff is always the most difficult (martial arts, music...)

>game developer
oh ok
you wanting to "make apps" is just a passing phase
bye now

reality is, I just want to learn. even if I learn a little, I'll know more than I do now.
If I can do useful things better, but that's not in my mind at this moment. neither hacker-stuff, games or whatever

>ok i just found out C# is pronounced C sharp instead of C#
What the hell do you even mean? What do you think C# sounds like? Are you pronouncing # like an H? You think it's Ch?

If you can't even learn C, you have no future in software development.

You could become a webdev if you want, they're basically retarded and get paid mad dosh to glue together other people's software because their clients don't know any better.

>try a little.
>can't get it
>get the fuck out.

well, that was what you learned the last time you went to a gym?

I had written up this huge reply to your initial post but then I read this and deleted it.

Sorry!

c hash

I need a method that takes a user-set weight, compares it to a set max weight and substracts a percentage from a set max speed depending on the percentage of usage of the max weight.
For example:
>100 km/h
>1 ton max weight
>0.5 ton used
>speed is decreased by 4% for every 10% of the max weight used
>20% is cut from the max speed in this case
>return new edited speed 80 km/h

How can I accomplish this? I'm on java.

epic trolling pal
wild sex with your waifu tonight.

>How can I accomplish this?
Translate the instructions(read homework) into java code.

...

learning C as my first language, just made a console IRC client

suggest some vim plugins /dpt/

not a plugin, but if you're not using hybrid line numbers you're wasting time

How do sneaker bots work.

they are just scrapers

how do i go about making one

youcompleteme

i didn't know what this was so i looked it up
seems simple enough
>$130
holy shit

thats a cool

Can I use Python to automate boring stuff?

" General
Plug 'Raimondi/delimitMate'
Plug 'chrisbra/SudoEdit.vim'
Plug 'mbbill/undotree', { 'on': 'UndotreeToggle' }
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-git'
Plug 'vim-scripts/The-NERD-tree', { 'on': 'NERDTreeToggle' }

" Development
Plug 'Valloric/YouCompleteMe', { 'do': './install.sh' }
Plug 'benekastah/neomake'
Plug 'bling/vim-airline'
Plug 'ctrlpvim/ctrlp.vim'

" Haskell
Plug 'dag/vim2hs', { 'for': 'haskell' }
Plug 'eagletmt/neco-ghc', { 'for': 'haskell' }
Plug 'raichoo/haskell-vim', { 'for': 'haskell' }
Plug 'godlygeek/tabular', {'for': 'haskell'}
Plug 'itchyny/vim-haskell-indent', {'for': 'haskell'}

" Web Development
Plug 'ElmCast/elm-vim', { 'for': ['elm'] }
Plug 'pangloss/vim-javascript', { 'for': ['javascript', 'html', 'htmldjango'] }
Plug 'posva/vim-vue', { 'for': ['vue'] }
Plug 'mxw/vim-jsx'
" Web Templates
Plug 'digitaltoad/vim-pug', { 'for': ['jade', 'pug'] }
Plug 'mustache/vim-mustache-handlebars', { 'for': ['moustache', 'html.handlebars'] }
Plug 'pbrisbin/vim-syntax-shakespeare',
\ { 'for': ['haskell', 'shakespeare', 'cassius', 'hamlet', 'julius'] }
" Web Design
Plug 'hail2u/vim-css3-syntax', { 'for': ['css', 'scss', 'less'] }
Plug 'cakebaker/scss-syntax.vim', { 'for': 'scss' }


" Other FileTypes
Plug 'chase/vim-ansible-yaml', { 'for': 'ansible' }
Plug 'plasticboy/vim-markdown', { 'for': 'mkd' }
Plug 'klen/python-mode', { 'for': 'python' }
Plug 'wlangstroth/vim-racket', { 'for': 'racket' }
Plug 'cypok/vim-sml', { 'for': 'sml' }
Plug 'rust-lang/rust.vim', { 'for': 'rust' }
Plug 'elixir-lang/vim-elixir', { 'for': 'elixir' }
Plug 'JesseKPhillips/d.vim', { 'for': 'd' }

No.

im trying to make a program that finds what integers satisfy a^2 +b^2=c^2 in FORTRAN95

I almost have it, just have to rework the nested IF statements because for some reason the program doesnt do the loops and just ends

yea i wanna try to make one but i have no idea where to start

Just took a quick peek at what you're talking about, but look into Selenium, or web scraping & requests making. The network tab in browser dev tools is useful for seeing what requests are made to do stuff like adding products to carts, submitting payment info, etc.

Golang?

What can python be used for then

Anything that doesn't need to be fast. Or safe/reliable, but shit tons of tests can hold that at bay for a bit.

import Data.Ix (range)
import Data.List (nubBy)

eq2of3 (a,b,c) (x,y,z) = (c == z) && (a == x && b == y) || (a == y && b == x)
pythag (a,b,c) = (a^2 + b^2 == c^2)
onlyTriples = nubBy eq2of3 . filter pythag

sample = range ((1,1,1),(100,100,100))
trips = onlyTriples sample

Is there a place I can download tons of programming books in pdf? Thanks

Python is never worth using

Throwing absolutes out like that is the quickest way to get people to ignore you.

Should I just learn COBOL or C then?

the lambda board on [spoiler]lainchan[/spoiler]

Learn C

Just learning C#/Unity
I'm making a puzzle game, in which you solve 3D nonograms. I've spent the last half an hour trying to figure out how to to shoot a ray through multiple collides (cubes), and upon right clicking, delete one.
My problem was trying to delete the cube the ray had went through first. It seems simple now, feel a bit silly.

void Update()
{
RaycastHit[] hits;
hits = Physics.RaycastAll(Camera.main.ScreenPointToRay(Input.mousePosition), 100.0F);

for (int i = 0; i < hits.Length; i++)
{

RaycastHit hit = hits[i];
Renderer rend = hit.transform.GetComponent();

lastCube = hits[0].transform.gameObject;

if (lastCube.tag == "cube")
{
if (Input.GetMouseButtonDown(1))
{
Destroy(lastCube);
}
}
}
}
}

libgen.io

but i'm a noob
and that stuff is for operating systems and shiz

C is for n00b neckbeards fapping to fizzbuzz all day and night. Real programmers that want to get things done use Java and C#.

just learn python holy shit it doesn't matter
just start coding

do automate boring stuff with python as you intended

youll have to learn c at some point, its not now

dont listen to this guy, he's just meming you right now

...

...

Writing old thread cleanup for an imageboard. What would be a decent algorithm for calculating the dynamic "page" number of a board? Trying to think of something that will work for both big slow threads and lots of small ones.

Learning programming with C Programming a modern approach 2nd edition, and I was wondering how long does it typically take for somebody to finish all the exercises and programming projects? There are a ton of them and I feel like some of them are just kind of tedious. I just finished the chapter 7 exercises and programming projects and it took a fairly long time, not because I had to think of how to make it work, because of all the switches and if's (i literally just laughed and skipped the question that asked me to use goto)

number of posts/ time multiplied by some constant

I usually just do one or two exercises per concept

reminder to store the time and number of posts, not store the number of posts / time

Can anyone give me a script that greps the only "192.168.**" part from the following output?


; DiG 9.10.3-P4-Ubuntu tertiary
;; global options: +cmd
;; Got answer:
;; ->>HEADER

>i literally just laughed and skipped the question that asked me to use goto
The goto statement is a valid part of the language. You better learn how to use them correctly instead of being ignorant.
Albeit deprecated by some people, the equivalent of the goto statement is
used frequently by compilers in form of the unconditional jump instruction.

The goto statement comes in handy when a function exits from multiple
locations and some common work such as cleanup has to be done. If there is no
cleanup needed then just return directly.

Holds your hand like a little baby

no lol

defer is a better solution for multiple return point functions and you only have to use it once.

>Start to write a question to ask /dpt/
>Realise I could turn the subject of the question into a future application
>Don't want anyone to steal my idea
>Ctrl+A and Del
>Go on Google and struggle to find an answer

>C++ assignment
>you spend 90% of the time guessing what the teacher meant by this

It's like, 5 hours assignment, with 4 hours of it guesswork, and 1 hour on the actual problem

But defer is non-standard, so it's less portable.

odds are your idea is nothing revolutionary, but even if it was some groundbreaking shit, /dpt/ is the last place you'd have to worry about someone stealing it fampai. nobody here does anything

> went to a gym
> posting in Cred Forums

sometimes I wish /dpt/ was a bit more like /agdg/
I think this general would benefit from people posting and commenting about their projects,
because currently this general consists to 90% of language wars, what language should I learn, debugging requests, homework requests and other bullshit that will never end.

Cred Forums is shit-tier for actual discussion, who'd a thought?

If you want to actually talk about useful shit find a relevant slack or irc channel.

/agdg/ is in Cred Forums too.

>sometimes I wish /dpt/ was a bit more like /agdg/
c a n c e r

This.

There should be some type of encouragement for people to actually post pics of "What are you working on, Cred Forums?"

what irc channels do you guys hang out in

None. Don't go in any.

Express.js question, /wdg/ is dead at the moment.

Extremely simple, but I can't for the life of me see what is going wrong here.

I've got two routes, GET and POST for '/newnote'.

// GET newnote
router.get('/newnote', function(req, res) {
return standupCtrl.getNote(req, res);
});

// POST newnote
router.post('/newnote', function(req, res) {
return standupCtrl.create(req, res);
});


They deal with requests via a method attached to standupCtrl, which is required into the routes file. The get request for '/newnote' works fine. It's hunky dory. It serves a jade template via a standupCtrl method. The template looks like this:

extends layout

block content
form(method="POST", action="/newnote")
btn.btn.btn-info(type="submit") Submit


It couldn't be any more simple. This should hit the POST route. Something should happen, but it just isn't. The .create method within that POST method only contains the following code:

res.redirect(301, '/');

Any ideas? What is it that I'm missing?

i hear you, though let's be honest, /agdg/ is pretty shitty overall too. i do like that people actually discuss their projects and post "progress", but it's also largely a dramatic circlejerk. i think the difference with /dpt/ is that people try really hard to sound knowledgeable and love doling out loud criticism despite frequently being painfully wrong, which probably discourages some people from sharing their work. most people here are way better at arguing pointless semantics and reading language specifications than they are at actually programming

>javascript

Hey guys, laugh at this person

can't listen to his faggot voice for more than 5 seconds

Find one for whatever language/framework you're coding in atm. And maybe one for your OS/distro.

you're sure the post is getting called? tell me you've checked this

Can you even OO in js?
Before i knew what OO was, I wrote several thousands of lines in one mess of a class for an audio visualiser in js

It isn't getting called, that's the issue. Console.log statements are getting triggered in the route callback or the method, res isn't being redirected.

Fortunately that's one virus js is immune to

can't post images on irc and slack seems to be a tool to communicate with members of your team instead of talking with people that have a fresh mindset about your project.

I agree, /agdg/ is not working as well as it could. But at least they have recaps, jams and other community events.

Right now the most "programing community" thing going on here is that stupid raven poster with a challenge.
Most posts that answer the "What are you working on, Cred Forums?" are either "learning language/framework/library X" or which will never be followed up on.

OOP IN OOL

don't you dare talk about the bird that way

cat+sed+awk

>making guis in Java

fucking end it all
this shit should not be this difficult to work with

ed

>J*va

Tried for the first time yesterday to use JFrames and JPanels.
Almost started to cry.

Went back to making games instead

did you refactor it into 20k lines of oop

anime or kpop

anime by far

kpop by far

western animation or music by far

kanime by far

What status code does POST return?

Nope. I left JavaScript and learnt Java.

My life is full of mistakes

To those who have developed both iOS and Android apps, which one did you prefer?

anyone with more experence in python know why I'm getting a syntax error on line 16?

from influxdb import InfluxDBClient

json_body = [
{
"measurement": "cpu_load_short",
"tags": {
"host": "server01",
"region": "us-west"
},
"time": "2009-11-10T23:00:00Z",
"fields": {
"value": 0.64
}
}

client = InfluxDBClient('localhost', 8086, 'root', 'root', 'example')
client.create_database('example')
client.write_points(json_body)
result = client.query('select value from cpu_load_short;')
print("Result: {0}".format(result))

pluralsight has some decent video tutorials. Requires membership after trial tho

lol

Say

> I'd just like to interject for a moment. What you're referring to as Linux, is in fact, GNU/Linux, or as I've recently taken to calling it, GNU plus Linux. Linux is not an operating system unto itself, but rather another free component of a fully functioning GNU system made useful by the GNU corelibs, shell utilities and vital system components comprising a full OS as defined by POSIX.

Many computer users run a modified version of the GNU system every day, without realizing it. Through a peculiar turn of events, the version of GNU which is widely used today is often called Linux, and many of its users are not aware that it is basically the GNU system, developed by the GNU Project.

There really is a Linux, and these people are using it, but it is just a part of the system they use. Linux is the kernel: the program in the system that allocates the machine's resources to the other programs that you run. The kernel is an essential part of an operating system, but useless by itself; it can only function in the context of a complete operating system. Linux is normally used in combination with the GNU operating system: the whole system is basically GNU with Linux added, or GNU/Linux. All the so-called Linux distributions are really distributions of GNU/Linux.

How babby tier is designing an algorithm to find if a value appears only once in an array?

You forgot to close the json_body line.
from influxdb import InfluxDBClient

json_body = [
{
"measurement": "cpu_load_short",
"tags": {
"host": "server01",
"region": "us-west"
},
"time": "2009-11-10T23:00:00Z",
"fields": {
"value": 0.64
}
}
]

client = InfluxDBClient('localhost', 8086, 'root', 'root', 'example')
client.create_database('example')
client.write_points(json_body)
result = client.query('select value from cpu_load_short;')
print("Result: {0}".format(result))

this should work.

Can't believe I missed that, cheers

gooks forever

omo

Crosseyed cunt

Pretty babby tier.
You can just sort the array and check how many times a number is duplicated.

What's the best book for learning algorithms & data structures?

delete this

i deleted my cookies already

we shall not question the work of god...

clrs intro to algorithms or algorithm design manual

mousepad > everything else > slublime/atom

Fuck it's seems obvious after you said that. I was thinking of shifting the values of the array whenever I can't across the "target" number until the start was empty or the counter was 1 at the end of one cycle.

My uni let me take this 2nd year data structures and algos course directly without the 1st year CS courses so I have no experience implementing basic data structures or even sorting algos. Seemed like a good idea to graduate faster but I might've fucked up.

I meant "whenever I came across" and "until the array was empty"

I'm not even in college, cs degrees are a literal scam.

Not efficient, sorting would take O(n log n) time but checking duplicates only requires O(n) time and space, by recording instances as you go through the array.

New thread

nano > >np++ vim > atom > emacs > sublime

real thread:

#include
#include
#include
#include

int main(){
int welcomeSocket, newSocket;
char buffer[1024];
struct sockaddr_in serverAddr;
struct sockaddr_storage serverStorage;
socklen_t addr_size;
FILE *fp;

welcomeSocket = socket(PF_INET, SOCK_STREAM, 0);

serverAddr.sin_family = AF_INET;
serverAddr.sin_port = htons(7891);
serverAddr.sin_addr.s_addr = inet_addr("127.0.0.1");
memset(serverAddr.sin_zero, '\0', sizeof serverAddr.sin_zero);

bind(welcomeSocket, (struct sockaddr *) &serverAddr, sizeof(serverAddr));

if(listen(welcomeSocket,5)==0)
printf("Listening\n");
else
printf("Error\n");

addr_size = sizeof serverStorage;
newSocket = accept(welcomeSocket, (struct sockaddr *) &serverStorage, &addr_size);

recv(newSocket,buffer,3,0);

if(strncmp(buffer,"put",3)==0){

recv(newSocket, buffer, 1024, 0);
fp = fopen(buffer,"w");
while(1){
recv(newSocket, buffer, 1024, 0);
if(strncmp(buffer,"-!-",3) == 0)
break;
fprintf(fp,"%s",buffer);
}

fclose(fp);

}else if(strncmp(buffer,"get",3)==0){

recv(newSocket, buffer, 1024, 0);

fp = fopen(buffer, "r");
if(fp!=NULL){
while(fgets(buffer, 1024, fp) != NULL){
send(newSocket,buffer,1024,0);
}
send(newSocket,"-!-", 3, 0);

}
}
close(newSocket);
close(welcomeSocket);

return 0;
}


first try a server with put and get files, in c

muh game

i love webgl

object oriented programming has been supported by javascript for years, plus with es6's new features its even sexier

inb4 sued by harmony gold