[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

/dpt/ - Daily Programming Thread

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 335
Thread images: 26

File: regex.png (231KB, 1752x1195px) Image search: [Google]
regex.png
231KB, 1752x1195px
Old thread is auto-saging: >>60469874

Can somebody help me debug my regex to validate URLs? It isn't working on some of the new TLDs
>>
File: 1495164379024.jpg (126KB, 331x510px) Image search: [Google]
1495164379024.jpg
126KB, 331x510px
You have been visited by the the elusive programmer (male)!

A deep and abiding understanding of void * pointers and triple indirection will come to you, but only if you post "Thanks Chihiro!" in this ITT!
>>
>>60477315
there is nothing confusing about n-indirection

what are you, a web developer?
>>
Dpt is dead. F"P" autists and pajeets killed this thead
>>
File: dlang_chan.jpg (139KB, 470x545px) Image search: [Google]
dlang_chan.jpg
139KB, 470x545px
Threadly reminder that dlang-chan is not dead; she's going to have her GC tumor removed (eventually); and she's super duper cute and easy to prototype in! Say something nice about her, /dpt/!
>>
>>60477346
>/dpt/
>Dead programming thread
>>
>>60477250
what's that regex supposed to match?
>>
>>60477364
zalgo desu
>>
File: DAJ7NEiW0AE1yQq.jpg:large.jpg (51KB, 611x709px) Image search: [Google]
DAJ7NEiW0AE1yQq.jpg:large.jpg
51KB, 611x709px
im updating my resume. do you think i can get 6 figures off this?
>>
File: seija_delet.png (224KB, 912x848px) Image search: [Google]
seija_delet.png
224KB, 912x848px
>>60477348
Stop.
>>
File: 1495172750849.gif (1MB, 320x213px) Image search: [Google]
1495172750849.gif
1MB, 320x213px
>>60477387
>mfw I get who this is referencing and I don't like it
>>
>>60477387
You'll only get 75% of that 6 figures because that's all you deserve
>>
>>60477387

>Took 6 years to complete master's degree
>Took 1 year to complete PhD
Yeah, I don't believe this at all.
>>
reptilianking still looking for mindslaves to make computers work.
must desire: open source operating system that can be configured to optimal personal settings by even the most dense simpleton.
link in the place where nothing should be.
>>
dead as d hours
>>
can you nigs point me in the direction of good resources for beginning C? I have a lot of free time this summer, want to pick up programming as a hobby, starting with C. Don't really know what I'm doing.
>>
>>60477627
installing gentoo never hurts
>>
>>60477627
K&R, that's all you need
>>
>>60477627
K&r the c lang, then "modern c"
>>
>>60477652
>>60477657

What about online resources? Not that I have a problem buying books, I'd just rather have my material right now. And isn't that book outdated? I just looked it up and its from 1978, has C changed since then?
>>
>>60477761
Yes it became C++ and C#
>>
>>60477761
Ofc, some things chaneged, but those are very easy to learn afterwards, just read some articles about what's new in c11. K&r is a very good book, with good exercises. Also there are pdfs of it everywhere online, you don't have to buy it.

I heard that this is pretty good also, but I never read it
https://www.amazon.com/C-Programming-Modern-Approach-2nd/dp/0393979504
>>
A Cyclical Redundancy Check function for Distributed Network Protocol version 3.0

https://godbolt.org/g/OsZ549
>>
>>60477761
>buying book
>not torrenting them
the last edition of the K&R is perfectly fine, don't fall for the muh modern language meme, you WILL need this knowledge, unless you want to work as a code artisan in a meme startup for a month before it fails
>>
>>60477652
>>60477657
C is already outdated and you are recommending a book which doesn't even use modern C.

He won't even get the first example to compile, lel.
>>
>>60477346
I wish /prog/ was still around.
>>
>>60478039
>C is already outdated
>>>/g/wdg
>>
>>60478039
You know how I can tell this is a bo>>60478074
t or a homo?

No typos and always needs to cum.
>>
>>60478039
>Outdated
>Book
Your right, books are outdated.
>>
>>60478024
It's not a meme, you underaged faggot. You want to be well versed in both ANSI C and modern C.
>>
File: 1495126576804.gif (3MB, 460x418px) Image search: [Google]
1495126576804.gif
3MB, 460x418px
How ready is wasm?
>>
>>60478928
It's ready, but there's nothing to do with it.
>>
>>60478938
>there's nothing to do with it
What do you mean?
>>
>>60478950
You can't even access the DOM from it, it's useless for now. Well, unless you want to make 3D games or shit like this.
>>
>>60479011
DOM sucks. wasm webgl GUI library when?
>>
>>60479039
Hopefully never.
>>
File: stuffblah.png (15KB, 1328x131px) Image search: [Google]
stuffblah.png
15KB, 1328x131px
Why isn't this working? I'm new to header files.

Error codes are pic related


class cpp
#include "MyClass.h"
#include "stdafx.h"
#include <iostream>
#include <string>
#include <fstream>

using namespace std;

MyClass::MyClass(string name, string message)
{
ofstream outFile;
outFile.open("Book.txt");

outFile << name << endl;
outFile << message << endl;
}



main cpp
// GuestBook.cpp : Defines the entry point for the console application.
//

#include "MyClass.h"
#include "stdafx.h"
#include <iostream>
#include <string>
#include <fstream>

using namespace std;

int main()
{
string name, message;

cout << "Name: ";
cin >> name;
cout << "Message: ";
cin >> message;

MyClass(name, message);

return 0;
}


header file
#pragma once
#ifndef MYCLASS_H_
#define MYCLASS_H_

using namespace std;

class MyClass
{
public:
MyClass(string name, string message);
};

#endif
>>
>>60479106
>pragma once
nigger wut?
>WITH HEADER GUARDS
wtf are you doing lil faggot?
>>
>>60479137
PO > header guards
>>
>>60479159
pragma once is absolute trash and non-standard/portable
>>
>>60479106
You didn't include the line numbers for those errors, so I'm only guessing.
main.cpp #includes "MyClass.h" before <string>, so the declaration of the constructor has no idea what an std::string is at that point.
You have to treat #include as a literal copy/paste of that file.

Also fuck off with using namespace std, you're defeating the entire purpose of namespaces.
>>
>>60479165
>and non-standard/portable
maybe a decade ago.
>>
>>60479165
I'll need a source with that
>>
>>60479165
#pragma once is supported on every compiler that actual people will actually use, it can also speed up compile times of large codebases as the compiler can deduce its meaning, unlike header guards.
>>
>>60479165
i use pragma once in all my projects without any problem.

https://www.wikiwand.com/en/Pragma_once#/Portability
>>
>>60479165
Maybe first look things up instead of spouting shit?
>>
>>60479179
>>60479184
>>60479188
>>60479196
https://gcc.gnu.org/onlinedocs/gcc-2.95.3/cpp_1.html#SEC8
>>
>>60479208
>https://gcc.gnu.org/onlinedocs/gcc-2.95.3/cpp_1.html#SEC8
>gcc-2.95.3
>nearly 2 decades old
nigga you fo real?
>>
>>60479171
What do you mean with the using namespace std. ive been using it all semester and the teacher hasn't corrected me.
>>
I planning to store sha512 hashes in postgres, should I put unique constraint in there?
>>
File: 23523452345.jpg (13KB, 229x220px) Image search: [Google]
23523452345.jpg
13KB, 229x220px
>>60479242
>What do you mean with the using namespace std. ive been using it all semester and the teacher hasn't corrected me.

fuck I hate CS teachers and people going into CS who can't fucking look shit up and do things by themselves unless it's fucking homework
you are literally a cancer on the industry
>>
>>60479045
why that shit looks dope
>>
>>60479287
We already have HTML+CSS for this shit, there is no reason to create yet another UI model
>>
>>60479106
>using namespace std in a HEADER FILE
Don't do that.
>>
>>60479274
Ask why you would want that to be an error case.
Hash collision is an intended case that happens and something you have to handle. Does a unique constraint magically handle that?
>>
>>60479242
Your teacher is subhuman filth and should learn to code.
It is subjectively bad to pollute namespace. What do you think this is, C?
>>
>>60479293
<center>Yes there is, CSS is dong tier</center>
>>
>>60479045
I posted here yesterday about thinking of a sepples library/framework for quickly prototyping scientific stuff(including a small ui toolkit). Part of it could be something like wolfram's cdf, without the browser plugins.
>>
>>60479326
query by hash should return 1 (correct) result, so something like LIMIT 1 would not work. Generating some god forsaken guid looks like a bad idea
>>
>>60479364
I don't know about your use case, but that sounds like a wrong assumption.
Pigeonhole principle guarantees there is no hashing algorithm to avoid collision. You have to handle the case of a query returning multiple results and further refine the search - you've already filtered out 99.9999% of your data so it's no longer a performance concern. What else can discriminate unique items?
>>
File: coloring.png (72KB, 399x381px) Image search: [Google]
coloring.png
72KB, 399x381px
What did the botnet mean by this?
>>
>>60479285
>>60479341
Its a known fact only the most shitty codemonkeys dedicate themselves to academia because the only thing they can pull off is teaching half wrong concepts to clueless individuals
>>
File: i want to die.jpg (24KB, 480x590px) Image search: [Google]
i want to die.jpg
24KB, 480x590px
>when your 200 line program takes more than a day to debug
>>
Do you guys program on a monitor standing vertically?
>>
>>60479489
Seems to me the toolkit portion of your program needs to be a larger proportion.

>not writing your own toolkit to hello world
shiggy diggy
>>
>>60479512
s-sometimes
>>
>>60479418
welp, you might just be right I was being a lazy fuck
>>
How do you uncreate an object in java?
>>
>>60479535
laziness is the essence of programming. "can't i just make this thing do X for me -_-" is how algorithms are born
>>
>>60479619
>-_-
get the fuck out, underaged shit
>>
>>60479614
delete or wait for it to go out of scope
>>
>>60479619
wrong
>>
What's the best way to start learning how to code? I've heard it takes years too.
>>
Question: does any language other than python have easily defined generators? I.e. defined like a function using the yield keyword. No verbose class definitions.
>>
File: instructionsc++.png (39KB, 678x790px) Image search: [Google]
instructionsc++.png
39KB, 678x790px
Someone help me come up with a project idea that will meet all the requirements of pic related including the extra credit.
>>
File: 1488203442650.jpg (103KB, 723x712px) Image search: [Google]
1488203442650.jpg
103KB, 723x712px
Using OOP is considered poor form.
>>
>>60479870
loli simulator
>>
>>60479840
Of course not. P*thon is the pinnacle of human thought.
>>
>>60479913
posting anime is considered poor form
>>
>>60479870
inventory manager for a record store
>>
>>60479512
No. Horizontal monitors even though our style guide limits to 80 character lines.
>>
>>60479943
Your kind is not welcome here.
>>
>>60479870
Okay I'm this guy. I was working on a guest book program. How can I implement the extra credit things into it? I already have the file input/output one. Need the rest.
>>
@60479943
Why the fuck are you even here? If you're going to act like a fucking redditor, go to fucking reddit.
>>
>>60478928
>>60478938
>>60479011
>>60479039
>>60479045
>>60479355
Not programming.
Fuck off to >>>/g/wdg/
>>
File: 4238921312.jpg (31KB, 330x241px) Image search: [Google]
4238921312.jpg
31KB, 330x241px
>>60480097
kys
no one wants to download your 50mb java applet
>>
>>60480133
>kys
Fuck off to >>>/b/
>java
I don't use subhuman languages.

And you didn't even deny that you were one of their kind, as I expected.
>>
>>60480161
>ask about wasm in the first place
>and you didn't even deny that you were one of their kind, as I expected.
hmmm
hmmmmmmmm
>>
>>60480182
Only web""""dev"""" trash would be interested in anything related to web""""dev"""".
You can fuck off now, go join your brethren
>>>/g/wdg/
>>
>>60480097
CSS is Turing complete
>>
>>60480195
You seem to be a little insecure there, buddy
>>
>>60480210
Turing completeness has nothing to do with being web"""dev""" or not. I don't know how retarded one would have to be to even suggest this.
>>60480216
Imagine having a life so dull and pointless that you're reduced to this. If this is your reason to live, it sucks to be you.
>>
>>60480252
No need to be upset. We are your friends. :)
>>
@60480264
Primitive animals can't be friends with humans since they lack the mental capacity for friendship. So no, you and your animalistic kind aren't my friends.
>>
>>60480281
Yes, yes, (you) are very smart
>>
@60480296
You have witnessed the truth.
>>
>>60477315
chihiro didnt deserve to die ;_;
>>
So why were Lisp's fexps replaced with current "macro" systems? They were perfect. They were simple, they were powerful, it was like adding custom code to the most fundamental function: eval.

You used to be able to evaluate anything any way you wanted using the exact same mechanism that powers things like function application. Now we have pattern-based shit like syntax-case.
>>
>>60480348
>mongolese cartoons memeing dolt
why am I not surprised
>>
File: 4oJ3vL0.jpg (170KB, 1440x1423px) Image search: [Google]
4oJ3vL0.jpg
170KB, 1440x1423px
Anyone might know why the clear(second line) method also clears the taskParametersTemp variable I specifically saved so I can use it later?

public void updateTask(@RequestBody Task task){
Collection<TaskParameter> taskParametersTemp = task.getTaskParameters();
task.getTaskParameters().clear();
for(TaskParameter param: taskParametersTemp) {
if(StringUtils.isNotBlank(param.getValue())) {
task.addTaskParameter(param);
}
}
tasksRepository.save(task);
}
>>
>>60480398
Not programming.
Ask on >>>/g/sqt/ or >>>/g/wdg/
>>
How many columns do you use?

I never go over 72.
>>
Hi
I wanted to develop something like this using python:
http://theyrule.net/drupal/
Where I can draw graphs in an interactive ways by saying to show the nodes
What would you suggest using to do something like this?
>>
>>60480416
148 with tiny bitmapped fonts because it's not the 80s but i still care about screen real estate
>>
>>60480398
Reference types, son.
>>
>>60479816
Get a console program to display hello world. Expand knowledge by reading books. Read an introduction book on the language of your choice, then start reading a book on a library or framework useable by that language that will give you the ability to make something you want. Try learning Python the learn about the Qt wrappers for Python if you want to make programs that run on the desktop. That will teach you a lot of concepts that will be translateable to other areas and give you a good foundation to do a lot of stuff.
>>
>>60479840
Look at Kotlin.
>>
is linux C# support still wonky as shit?
>>
>>60477250
>auto-saging
It's a bump limit!
>>
>>60480654
Didn't it get better with vs code?
>>
>>60480654
Depends on what you mean. I know plenty of folks to develop in C# on Linux, but I personally wouldn't do it.

Deploying to Linux is another story; it works really well. I develop on Windows and deploy .NET Core things to Ubuntu servers at work. With .NET Standard 2.0 being out*, it's only going to get better from here.

.NET Standard 2.0 is in preview, but it's very much production ready unless you work at a large enterprise.
>>
File: 1494522255548.png (19KB, 1000x1000px) Image search: [Google]
1494522255548.png
19KB, 1000x1000px
>>60480568
Ow okay, I got it. But what would be the correct of doing what I want to do?
>>
>>60480862
Creating a new instance.
>>
Not really programming-related, but does anyone know where I can learn about natural language processing?
>>
What are the libraries to draw bitmaps in C?
>>
What do you guys think of Kotlin and it's new support in Android?
Personally, I think it's just a dumber version of Swift.

Opinions?
>>
>>60481048
It's better than Java
>>
>>60481048
I think you should stop trying to shill your shitty language.
>>
>>60481162
not the person youre quoting but cmon dude, first class support on android was announced maybe one day ago its hardly shilling talking about current events
>>
>>60480443
do you wanna make drupal or that weird ass site?
>>
>>60481162
Not really. Because shills come out saying how stupid it is compared to its competitor right?

I just got tasked with learning it at work. Thought I might share...
That val and var thing is killing me. What idiot thought that was a good idea?
>>
>>60478039
>modern C
If you're gonna do that just do C++.
>>
Java is so nice, beautiful
why does /dpt/ hate it?
Is it because /dpt/ is like /wdg/ -> bunch of hipster faggots?
>>
how the heck do you implement a recursive delete method for a binary search tree object? there seem to be like 20 different conditions
>>
>>60479816
Learn Lisp.
>>
>>60479870
FPS
>>
>>60481668
/dpt/ is a bunch of hipster faggots
/wdg/ is a bunch of totally clueless beginners
>>
>>60477332
Actually there are several important things that are confusing about even simple 1-indirection, and the confusions only compound as N > 1. Namely, suppose I receive a void* from a function. Then:
>Do I have to free this, or is it pointing to space that was already usable before the function call?
>How wide is the buffer pointed to?
>If I do have to free it, where is the beginning of the buffer? Is it directly at the given address, or is there an offset in either direction for arithmetic purposes?
>Is this pointer even valid? Or is it perhaps a product of arithmetic or loop iteration that was valid during said operations but is now useless?
>If this pointer is null, what does that mean for me as the caller?
>Was the function I called to get this pointer a member of a class or abstract data type? If so, suppose I free the instance. Is the pointer I received then invalidated?
>>
Is ATS the worst language ever?
fun{
a:t@ype
} bsearch_arr{n:nat}
(
A: arrayref (a, n), n: int n, x0: a, cmp: (a, a) -> int
) : int = let
//
fun loop
{i,j:int |
0 <= i; i <= j+1; j+1 <= n}
(
A: arrayref (a, n), l: int i, u: int j
) :<cloref1> int =
(
if l <= u then let
val m = l + half (u - l)
val x = A[m]
val sgn = cmp (x0, x)
in
if sgn >= 0 then loop (A, m+1, u) else loop (A, l, m-1)
end else u // end of [if]
) (* end of [loop] *)
//
in
loop (A, 0, n-1)
end // end of [bsearch_arr]
>>
>>60482423
No. No it can't be.
Because look at the code you just wrote.
Look, look:

It's FUN.


*jumps off conveniently positioned cliff*
>>
>>60481017
bump
>>
>>60482423
>t@ype
What did they mean by this?
>>
File: 1494816077115.png (127KB, 346x315px) Image search: [Google]
1494816077115.png
127KB, 346x315px
>>60477250
Formally verified Brainfuck compiler.
>>
>>60482423
pooploops
>>
>>60481680
Isn't there one already built-in?
>>
>>60482490
It doesn't come with any. Setting up an application GUI is a lot more complicated than it seems, since how it's done heavily depends on the specifics of your graphics hardware. You have to use libraries others have made (or you could make your own, but that's probably a bad idea, it would take you quite a long time).

If you're on Linux, you can install your library from the package manager, and specify it as a dependency if/when you publish your software.

If you're on Windows, and/or you want to make your program more modular, you can download the library to your source directory, credit its creators in your Readme, and set up your makefile to build the libraries and link your code against them while building your code.

There are many libraries out there that can do what you want to do. Here are some I know of:
>Qt
>Gtk+
>SDL
>OpenGL
It depends on why you want to draw a bitmap to the screen. If you're making a traditional GUI application, Qt or Gtk+ are suited to your needs. If you're making a game, or a similar kind of program that needs to run in one window and do all its own rendering, you want SDL or OpenGL.
>>
>>60477250
Set the m and x modifier then format that motherfucker properly. Nobody go time for your pajeet level spaghetti code.
>>
I was learning Haskell for a good while but now i jumped over to Java. I tried to implement foldl, defines in haskell as follows:
foldl :: (a -> b -> a) -> a -> [b] -> a 
foldl f e [] = e
foldl f e (x:xs) = foldl f (f e x) xs

So far so good, i tried to do this in Java and got the following:
public static <T, R> Function<Function<T, Function<R, T>>, Function<T, Function<List<R>, T>>> foldl()


Now if I take a curried function in this form :
Function<Double, Function<Double, Double>>
it doesnt work!
It says that Function<Double,Function<Double,Double>> cannot be converted to Function<Object,Function<Object,Object>>

am I missing something?
>>
feel like writing a torrent client from scratch
am I fucked?
>>
>>60483147
>from scratch
Better try writing it in Scratch.
>>
>>60482575
Sound trivial
>>
>>60477427
That's actually not uncommon at all.

Princeton admits to the PhD program, not a terminal MA program. She was entered into the PhD, did her qualifying work, left and then came back to finish prep work on her thesis.

I was in a lab with someone who took five years to do his Masters "on paper" and then got his PhD the next year. It's nothing more than swishing papers/credits around.
>>
File: 1472024300481.jpg (93KB, 800x800px) Image search: [Google]
1472024300481.jpg
93KB, 800x800px
>mfw finally deciding to install clang over of gcc
why didn't I do it earlier, compiling is way faster and the error messages almost makes me feel spoiled
>>
>tfw I thought Jon Skeet was a meme name but he actually exists
Lmao really
>>
So I'm trying to make somewhat of a console and am failing miserably, I have a program that prints 0-[arg-1] that I'm calling to test it:
Above 3000 and my console stops receiving input until it finishes, windows cmd needless to say doesn't do that (I guess it's because cmd only shows/stores like 300 lines at a time?).
To add to the problems I've been doing testing with 5000 as input, it takes on average 0.6 seconds for cmd to finish but about 20 seconds for mine. It seems to receive data fast enough (the test program prints 0.1 seconds after the 20 second wait), so I guess the problem's with printing.

Are they using some C/C++ magic or can I reach those speeds with C#?
>>
>>60483348
>meme
>Lmao
>tfw
>>>/v/
>>
>>60477348
Why not just use Rust?
>>
>>60483396
It's not really clear what you're trying to do here.

If you're writing to the console on every iteration, that's extremely inefficient. You want to get the data, then print it at the end.

What are you actually doing?
>>
who python?
Given a list of user1..usern, where each user has a set of properties, how can I check whether one of the properties of the user is in a few list of related properties?

e.g.

user1: ['property1', 'property2', 'property3', 'green1', 'square1']
user2: ['property1', 'property2', 'property3', 'green2', 'square1']
user3: ['property1', 'property2', 'property3', 'green3', 'square2']

and I basically want to check for each user, do they have a green and square property, given two lists of ['green1', 'green2', 'green3'] and ['square1', 'square2'] from which I can compare.

I can't use subset or superset relationships because user1's properties aren't a subset or superset of ['green1'...'greenn'].

I think I can do this using a list comprehension.
>>
>>60483571
use lambdas

This is what they are made for.
>>
>>60483585
>This is what they are made for.
Really?
>>
I use codeblocks but am fucking sick and tired of it not working properly. Latest release was more than a year ago. I link libraries and headers like I should and it doesn't work. I have to load shit dynamically. The headers are old, the whole SDK is old and useless. Will Visual Studio help get rid of this shit and allow me to focus on the actual code? Is it still like 10gb?
>>
>>60483708
learn how to write a Makefile nigger
>>
>>60483563
The program I'm making is somewhat like a console.
I run my console and then run another program inside it, as the inside program runs my console redirects its output (as in steals the Console.writeline output) and outputs it in its own textbox.

I can't really print all the data after waiting since the program won't necessarily end after a simple loop and surely that's not necessary since from my knowledge windows cmd doesn't do that.

Sorry if I didn't explain it clearly enough, I thought saying it was somewhat of a console would be enough.
>>
>>60483743
Doesn't matter the sdk is old and missing all sorts of shit.
>>
>>60481680
>recursive delete
Don't do this. If you have a BST of any decent size, you'll get a stack overflow.

Here's what I'd recommend. This will technically still be a recursive delete, but it will only be trivially recursive.
>if both children are null, do nothing but detach the node from its parent; this is the trivial case
>else, do an iterative depth-first traversal of the tree (change your BST implementation to store colors and parent pointers so you don't have to use a stack and a set during the traversal)
>in post-order, detach the node currently being finished from its parent, and then delete it (this will only ever recur to the trivial case, because if the node had children, they should already have been processed by the depth-first traversal, and therefore they should already be detached)
>>
>>60483758
don't use codeblocks then and use a proper editor
>>
>>60483708
VS Code desu.
>>
>>60483781
Does it include the latest windows sdk or is it just an editor?
>>
>>60483754
Are you asking how to do work on another thread so it doesn't block input/output in your console?

Look into async/await.
>>
while learning python i find myself to be using perl_style_vars and camelCase subconsciously
do i understand it right that camelCase is not "pytonic"
>>
>>60483789
>Does it include the latest windows sdk
literally just download it from M$'s site.
Its a complete package. You just have to search and install the extensions, but you can do it right inside.

Also its probably not CB's fault, youre linking SFML wrong.
>>
>>60483789
If you're running on Windows, your platform itself includes the latest Windows SDK. You could write your code in Notepad and compile with MinGW GCC and you'd still get linked against the Windows SDK.
>>
>>60482632
>It doesn't come with any.
I know. Somebody ought to make in 30 last years.
>Setting up an application GUI
I need to draw images, though.
>>
>>60483822
It's missing headers i.e. they're physically not present e.g. senseapi.h, netcon.h, etc.

>>60483817
I'll look into downloading it from the ms site I guess. Fuck. It'll probably not work and I'll have to torrent vstudio. Thanks anyway.
>>
>>60483837
>I know. Somebody ought to make in 30 last years.
They did.
>I need to draw images, though.
This is one of the things GUI libraries can do, and it's just not something you'll be able to do without them.
>>
>>60483796
I'm already using threads just maybe not well, I'm asking if there's some secret behind how other consoles work to work so quickly since mine took 20 seconds to print 0-4999 while the default windows cmd took 0.6 seconds.
Surely it can't be much more complex than
>start program
>take its output
>print each line as it goes
>>
mathematica is so fucking poorly programmed, leave it open for a few days and it'll be insufferably slow, severe memory fragmentation, C tards with their piss-poor malloc/free """"memory management"""" will defend this
>>
>>60483861
VS Code != VStudio
>>
>>60483861
>It'll probably not work and I'll have to torrent vstudio
Aren't there "community" versions now days for free?
>>
>>60483789
>windows sdk
>>60483817
>SFML
what do you even think you're doing
>>
>>60483877
>C tards
>malloc/free
As a C tard, I will not defend this. The heap is only useful for metaprogramming. You don't get any memory fragmentation when you keep everything on the stack, as you should.
>>
>>60483862
But I don't need huge GUI libraries. I don't need GUIs.
Are there libraries just to produce BMP/PNG/GIF from empty canvas?
>>
>>60483903
Yes

>>60483861
Anon, you're missing the point.

>Visual Studio
This is the big IDE with all of the features. The newest version, 2017, has a smaller install size that lets you pick exactly what you want.

You're looking for "Visual Studio 2017: Community Edition". It's free.
https://www.visualstudio.com/vs/community/

>VS Code
VS Code is an open-source, cross-platform text editor with IDE features, much like Atom.
https://code.visualstudio.com/
>>
File: 1479941619600.png (1MB, 1334x750px) Image search: [Google]
1479941619600.png
1MB, 1334x750px
>>60483708
>Code::Blocks
>>
>>60483928
the pajeets are evolving
>>
>>60483585
meh I still can't get it to work
>>
>>60483958
You aren't saying they're pooing in the loo are you? That's impossible.
>>
>>60483971
first of all the fact that indians don't poo in loo is not even the fault of the ones who don't poo in loo, it's actually the fault of the ones who do

they have a caste system, you see. the low caste worships toilets because the high caste shits in them. this is also why the low caste doesn't

instead of making fun of the low caste, who can't do anything about how filthy they are short of spilling their blood to demand the right to cleanliness, you should make fun of the high caste for being so fucking greedy they won't even let people shit
>>
>>60483954
It's been proven to improve speed by 120%
>>
>>60484056
They definitely need a communist revolution to break all the castes
>>
>>60483942
I could be wrong, but I'm pretty sure that can't even be done. I wouldn't think whatever window manager you're using would like that very much.
>>
>>60484091
>>>/r/abbit/
>>
can someone help me with c?

i want to save some structs in a doubly linked list and also save them to a text file to be loaded next time i open the program.

should i add them to the text file at the same time i add them to the list? do i save the pointers in the file too? im really confused
>>
File: Capture.jpg (77KB, 662x639px) Image search: [Google]
Capture.jpg
77KB, 662x639px
No one has answered my stupid question yet so I'll post it here. Please don't hate me, I'm just really desperate...

I need help with a simple Powershell script.
I want to zip the selected files in pic related, all into one big zip.
I know how to create a zip-per-file, but I don't want tons of zips. I just want one.
Anybody help?
>>
>>60484101

Make

me :^)
>>
>>60484132
>:^)
>>>/v/
>>
>>60484120
That's not programming.
Ask on >>>/g/sqt/
>>
>>60484101
>>60484139
you seem awfully familiar with reddit and /v/
>>
>>60484120
https://msdn.microsoft.com/en-gb/library/hh158346(v=vs.110).aspx
>>
What's with all this
>not programming
shitposting?
Is someone this insecure?
>>
>>60484104
use an interface
>>
>>60484091
They definitely need some kind of revolution, but in this case, communism may not be the one, considering the means of oppression is chiefly ideological and only secondarily economic. An egalitarian revolution might be more appropriate.
>>
>>60484167
This thread is about programming. Things which are not programming don't fucking belong here. Take your garbage to some other thread.
>>60484194
Not programming.
>>>/lgbt/
>>>/pol/
>>
>>60484091
see >>60484209
>>
>>60484104
I don't know c but I figure that you should construct your list first and finish all manipulations to that list before you add it to a file.
That way if your code changes the list you don't have to go back and change the file and if you have to delete an element in the list that isn't the beginning or the end it wouldn't take forever just to find the element in the file (depending on how you format it)
>>
>>60484209
Yeah but I see posts where people show their code and ask questions and get called out for being
>Not programming
just because they post about Java or something.
Like this here
>>60480398
>>
>>60484120
>>60484162
or you could just run an external process:
7z a archive.zip css fonts images js video config.xml index.html map.html

you just have to figure out how to run an external process from a powershell script
>>
>>60483708
>codeblocks
>Code::Blocks - The IDE with all the features you need, having a consistent look, feel and operation across platforms.
>having a consistent look, feel and operation across platforms
>consistent
idk why you are complaining, it cant get any more consistent then that
>>
>>60484209
whats your favorite programming language, gate-keeper kun?
>>
>>60484230
>code
Which is not programming. Therefore it doesn't belong here.
>>
>>60484249
What did you unironically mean by this?
So I can't post my code here and ask questions?
What do I talk about then?
Are certain languages allowed and others aren't?
Can you define some rules so I don't get
>Not programming'd
>>
@60484248
>gate-keeper
Fuck off to some other website if you think I'm your "friend" or I somehow know you. Don't reply to me. I don't like you or your kind.
>>
>>60484226
yeah that makes sense to me, but my struct has a bool active on it, and when i delete 1 element from my list it should stay on the file, but have active=false, and when i load the file it should ignore the elements with active = false.
>>
>>60484249
https://en.wikipedia.org/wiki/Source_code
>>
>>60483708
vs is the best ide for window, no reason not to use it
>>
>>60484262
>code
"coding" isn't programming. Take it to some other thread.
>Can you define some rules
No. Lurk more.

>>60484270
>wikipedia
Didn't even bother reading your post. Try harder next time.
>>
File: 161017757_44042348.jpg (67KB, 590x632px) Image search: [Google]
161017757_44042348.jpg
67KB, 590x632px
>>60484249
Are you really this retarded? please don't be this retarded.
>>
My lads, do we kode on Fridays or not?!
>>
>>60484284
>"coding" isn't programming. Take it to some other thread.
Can you name three differences between coding and programming that would make one allowed here and one not?
>>
>>60484263
What is your current programming language of choice, Anonymous user #60484263?
>>
>>60484284
writing source code is programming

>>60484289
spoiler: he's not
>>
>>60484289
Your image already has an answer. Why did you ask me then?
>>60484301
No. Lurk more.
>>
Gatekeeper, why did you stop calling out redditors? Not programming is your new thing? I am from reddit btw
>>
>>60484302
DHTML
>>
>>60484305
>writing source code is programming
This is wrong as a universal statement. Special cases of writing source code are programming, like writing the source code of a programming language.
>>
>>60484302
My own language.
>>
>>60484346
Is posting samples considered programming?
>>
>>60484104
>should i add them to the text file at the same time i add them to the list?
That sounds like an unnecessarily large number of small disk accesses. Here's what I'd suggest doing instead: make a pair of functions, one that takes a linked list and a file path and writes the whole linked list to the file path at once, and one that takes a linked list and a file path and reads the file path into the linked list. You'd use the prior at the end of your program before destructing and deallocating your linked list, and the latter at the beginning after allocating and constructing it.

>do i save the pointers in the file too?
No, because they won't be valid next time your program runs. Here's another way you can do this: Establish a one-line string format for your structs, to which they're written with fprintf when you save them, and from which they're read again when you load them, using fscanf with their field names. (You may have already done this.) Then, for the linked list, just save it by writing all its elements, one on each line, and load it by reading them. Your linked list should already have some functions analogous to cons, car, and cdr, so use your car and cdr to traverse the list in order to write its contents, and use your cons to build the list when you read the contents back.
>>
>>60484331
source code is by definition written in a programming language
>>
>>60484309
>I am from reddit btw
>>>/v/
>>
>>60484357
I don't like videogames though, I am a code artisan so I'll stay
>>
>>60484357
why would you assume that a reddit user likes to discuss video games?
>>
>>60484331
a programming language is a language used for programming. english could be a programming language.
>>
>>60484269
I'm curious to what you are doing for that to be applicable. You could put the active elements in one text file and de-active in another text file.
Although space is a concern once it gets really large. That way it is structured and separated but I don't know anything about your program to really give good advice.
>>
>>60484307
>No. Lurk more.
Alright this is how I know you know nothing about a software developer.
>>
>>60484367
I don't care, your kind belongs on >>>/v/
>>60484368
Because all of them are mentally ill and those kind of "people" usually like to discuss video games
>>
>>60484301
Don't argue anon. Coding is a better word. Someone who made programmation of a TV channel is a programmer too. That's why I use the word coding.
>>
>>60484379
>software developer
This doesn't belong here.
Take it to >>>/g/wdg/ or some other thread.
>>
>>60484379
>inb4 a typo gets called out
*about being a software developer.
>>
>>60484383
only non-programmers use the word coding to refer to programming
>>
>>60484382
Game development is an art form and has the power to enact social change among new generations.
>>
>>60484397
Calling someone a software developer (aka code monkey) is an insult. Why would anyone want to know anything about that?
>>
>>60484396
End yourself. Stop shitposting or show me what programming YOU do.
>>
>>60484405
Bla bla bla.
Only code monkeys are outraged by the word coding.
>>
>>60484408
>Game development is an art form
Discuss that on >>>/v/
>enact (((social change)))
Discuss that on >>>/r/abbit/
>>
Dropping real world hierarchy

Software Architect > Software Developer > Code Artisan > Piss > Shit > ... > Programmer
>>
>>60484408
>has the power to enact social change among new generations.
you're delusional. no one is falling for the SJW feminist propaganda. ask marvel how their SJW comics are doing.
>>
>>60484382
>Because all of them are mentally ill and those kind of "people" usually like to discuss video games
This is wrong as a universal statement.

>>60484409
programming is a part of software development process
>>
>>60484432
Where does 'app artist' stand?
>>
>>60484425
No. Game development is programming, and programming that enacts social change is programming. Besides, that's beside the point. The point is that referring everyone you don't like to /v/ is insulting to video games, and wrongly so, because video games have the power to be very useful and important.
>>
File: 3dprintedsavebutton.png (197KB, 567x744px) Image search: [Google]
3dprintedsavebutton.png
197KB, 567x744px
Give me a language to learn
>>
>>60484453
>Game development is programming
tell that to >>>/vg/agdg
>>
>>60484433
Have you ever heard of Undertale?
Oops, did I trigger you by saying that name?
>>
>>60484454
java

https://docs.oracle.com/javase/tutorial/
>>
>>60484454
elixir
>>
>>60484443
>programming is a part of software development process
Can you develop on that?
What can I do for it to be called programming?
Can you give ONE real life example of programming?
>>
>>60484454
C/C++
Scheme
Haskell
Lua
In order of decreasing importance.
>>
>>60477250
Don't validate email addresses on a syntactical level. Just send them an email with a verification link. I've seen my share of email validation horror (catastrophic back-tracking, limiting TLD to 3 characters, etc) and all of them would have worked perfectly fine without up-front validation.

If you think you need it, you're probably wrong.
>>
>>60484354
alright thanks ill start by doing those 2 functions and go from there

[spoiler]and probably ask something again[/spoiler]
>>
>>60484461
No. I'm saying it here, because it belongs here.
>inb4 no it doesn't
Yes it does.
>>
>>60484451
Above the Bash Barista but below the Pascal Painter
>>
>>60484476
i've heard of the game (only in /agdg/) but not once has it been mentioned that it has any sort of "message", people just like the graphics and the gameplay
>>
@60484453
>Game development is programming
Nope. It's more than programming and should be discussed on >>>/v/
>programming that enacts social change is programming
I prefer to call it"brainwashing" and that should be discussed on >>>/r/abbit/
>>
>>60484492
game development is a lot more than just programming you fucking moron
>>
>>60484486
Physically sitting in a chair and typing out some code you designed and wrote unit tests for
>>
@60484476
>Undertale
I can't say I'm surprised. "Epic" as you g*mers say.
>>
>>60484525
Why tf are you @'ing?
>>
>>60484510
Of course they wouldn't TALK about it having a message. That's not what people do when a message affects them. They just subtly change their future behavior, usually without awareness of doing so.
>>
>>60484550
Specifically to bait out anger and (You)s.

Don't reply to shitposts.
>>
>>60484550
4chan shitposters have nothing better to do than collect (You)s
>>
>>60484560
>Don't reply to shitposts.
Why are you contradicting your own advice?
>>
>>60484559
>They just subtly change their future behavior, usually without awareness of doing so.
delusional thinking. why isn't hillary president if your shilling works so well lmfao
>>
>>60484535
Alright I do that and I get paid for it.
Am I a programmer then?
>>
>>60484525
>Nope. It's more than programming and should be discussed on >>>/v/
It's not just more than programming. It's more specifically a process that involves programming and also involves doing other things. First of all, by virtue of involving programming, it belongs here. Secondly, it was only brought up in response to you spouting /v/ everywhere, so if anything, you're saying YOU should go to /v/ and take your /v/-spouting with you.
>I prefer to call it"brainwashing" and that should be discussed on >>>/r/abbit/
Doesn't matter what you prefer to call it, it's programming, so it belongs here.
>>
>>60483585
can I use itertools and powerset?
>>
>>60484595
Didn't even read the first part of your post, seems like some retarded thing a /v/ user would say.
>>>/v/

>it's programming
Nope.
>>>/r/abbit
>>
>>60484598
I don't know Python at all, but I know how I could solve this with a couple of lambdas in other imperative languages.
>>
>>60484578
>look a time where it didn't work
>that means it doesn't work in the general case
>chekmate athetits
>>
>>60484486
>What can I do for it to be called programming?
Anything that is intended to directly aid creating of a executable computer program.
>What can I do for it to be called programming?
Create an algorithm for solving a problem that your program will need to solve to function correctly, for example.
>Can you give ONE real life example of programming?
Coding (writing implementation of) a computer program that has to display a "Hello world" message on user's screen.
>>
>>60483759

Mate, if your BST is decently balanced, you shouldn't have problems with recursively deleting. For n elements, the height of the tree should only be log2(n), and you should only be using as many stack frames as the height of the tree. So if you have 2 billion elements, the stack is only going to grow by 32 times the cost of a call to operator delete. Even if each stack frame is a kilobyte (which is outrageous for something that simply recursively frees nodes), that's still only 32K of stack memory used, which is a drop in the bucket compared to the megabyte you're given.
>>
>>60484614
>i have no scientific measurements to back up my claims that my SJW video games are having the brainwashing effect i intend them to have
>i'll just believe what i want to believe
>>
>>60484595
>by virtue of involving programming, it belongs here
Retardedly wrong.
Fuck off. >>>/v/
>>
>>60484602
>Didn't even read the first part of your post, seems like some retarded thing a /v/ user would say.
Wrong, it's a deconstruction and rebuttal of your argument.
>Nope.
Also wrong
>>
>>60484616
So why doesn't /dpt/ belong on /sci/ then?
>>
>>60484652
>Retardedly wrong.
>implying not everything that involves programming belongs here
See: >>60484652
>>
>>60484657
programming isn't science
>>
>It's a shitposter derails another /dpt/
Getting really tired of these reruns. Where's the jannie?
>>
>>60484652
>Retardedly wrong.
>Can't even explain
What was his endgame?
>>
File: 2017-04-27-203556_107x144_scrot.png (23KB, 107x144px) Image search: [Google]
2017-04-27-203556_107x144_scrot.png
23KB, 107x144px
>when you need to ship the program anyway but you know there will be major bugs sooner or later
well at least it works when I use it
>>
@60484614
>look a time where it didn't work
>that means it doesn't work in the general case
This is what it means (by definition) to not work in the general case. A single counterexample implies it's not a universal statement. I get that a /v/ user might have difficulty understanding this though.
>>
>>60484674
i think over the years of daily shitposting they've learned just how shitty posts they can make without triggering bans or post deletions
>>
>>60484683
General case != always
>>
>>60484610
tell me cuz I dum?
>>
>>60484657
why would it? yes, programming can involve using "science and math", but it doesn't mean that it itself is "science and math"
>>
def primes(sieve=count(2)):
prime = next(sieve)
yield prime
yield from primes((x for x in sieve if x % prime != 0))


Somehow it just dawned on me that python has lazy evaluation facilities...
>>
@60484708
General case = logical "for all", which is pretty much the same as "always".
"usually" isn't the same as "general case".
>>
>>60484728
try two ">>" instead of @
>>
>>60484716
And it just now reminded me that python hates recusion...
>>
>>60484644
And what exactly is wrong with that? Give me one good reason I should have to prove to you that games can be meaningful and transformative experiences in order for you not to insult them.
>>
>>60484739
Not when I respond to trash.
>>
>>60484487
gonna learn scheme cool
>>
>>60484739
He actually think he's being unique or funny.
>>
>>60484754
have a (You)
>>
>>60484728

>General case = logical "for all"
Wrong.

>"usually" isn't the same as "general case".
Also wrong.

https://www.google.com/search?q=in+general+definition

>usually; mainly.
>"in general, Alexander was a peaceful, loving man"

When people talk about what happens generally, they are referring to what typically happens, not what happens each and every time.
>>
>>60484483
class HelloWorldApp {
public static void main(String[] args) {
System.out.println("Hello World!"); // Display the string.
}
}

>for a VM+GC language
no thanks
>>
>>60484792
k
>>
Did a subhuman just reply to me?
>>
>>60484792
>le verbose hello world argument
I love this meme
>>
>>60484812
it's literally from the oracle "hello world" java tutorial
>>
>>60484728
Yea you're right actually. However, I didn't even mean "that means it [doesn't [work in the general case]]." I meant "that means it [[doesn't work] in the general case]." And THAT is NOT entailed by the fact that it sometimes doesn't work.
>>
>>60484812
>le
>meme
You can fuck off to >>>/v/
>>
@60484824
Too verbose and retarded for me to read, sorry.
>>
>>60484812
#include <stdio.h>

int main(void) {
printf("%s\n", "Hello, world.");

return 0;
}
>>
>>60484840
You spelled a word wrong and left out parentheses.
>Too verbose (I'm retarded) for me to read, sorry.
ftfy
>>
@60484862
I could be retarded and that statement would still hold.
>>
Can janny please remove this thread?
>>
>>60477250
Is there a good tutorial on how to make a c++ library. One with multiple files in different paths.
I want to turn a program I have into one but it never works
>>
File: 2017-05-19-192555_390x33_scrot.png (4KB, 390x33px) Image search: [Google]
2017-05-19-192555_390x33_scrot.png
4KB, 390x33px
Reminder
>>
>>60484812
That's literally the briefest code you can write in Java for a program that will do nothing but print hello world. (Unless you shorten the names.) It's because everything at top level has to be a class and the main function has to be a public static void method that accepts a string array of command line arguments.
>>
>>60484879
It doesn't hold regardless. Not objectively. It only holds for you, and only because you can't actually read.
>>
>>60484812
>I love brevity!
So Python must be great to you right?
>>
@60484922
>Not objectively
How can a logical statement hold "subjectively"? I think you might be the retarded one here.
>and only because you can't actually read
I can though, just not when it becomes too hard.
>>
>>60484944
python is great tho
>>
>>60484822
So?

>>60484826
What does a funny meme have to do with video games?

>>60484907
Yes. There are different priorities when picking a language. For some people the biggest priority is doing big, real, working stuff on a well-supported, mature, stable and non-error-prone platform. For other people the priority is to write short "hello worlds".
>>
>>60484948
As a scripting language maybe. I wouldn't write a huge business backend or anything big in it though.
It's slower than Java.
>>
>>60484962
almost anything is slower than Java
>>
>>60484901
thanks
>>
>>60484945
>How can a logical statement hold "subjectively"?
Your statement wasn't logical. It was an opinion piece.
>I can though, just not when it becomes too hard.
So in other words you can't. Got it.
>>
>>60484948
opinion: discarded
>>
>>60484958
>Yes. There are different priorities when picking a language. For some people the biggest priority is doing big, real, working stuff on a well-supported, mature, stable and non-error-prone platform. For other people the priority is to write short "hello worlds".
Oh. I see what you're saying. Yeah I agree. It's a dumb criterion by which to judge languages, but I assumed you didn't realize that, because most people here don't. I thought you were referring to the meme in which people deliberately make a program more verbose than it needs to be in order to reflect badly on the language, not the larger meme of even giving a shit.
>>
New thread: >>60485029
>>
>>60484962
>It's slower than Java.
Yeah but you can prototype something in 6-12x less time than java
>>
>>60485035
True, that is why I said scripting languages are still useful. Although it's hard to prototype ERP software. I don't see why scripts can't be integrated into big apps. Java is great with Groovy scripts on the side.
>>
@60484995
>Your statement wasn't logical.
It was.
>It was an opinion piece.
Which doesn't somehow imply it's not a logical statement.
>So in other words you can't.
Yes, I can't, but only under certain conditions.
>>
>>60485054
>Groovy
O SHIT NIGGA
O ▄█▀ █▬█ █ ▀█▀
>>
>>60485103
What's wrong with Groovy?
>>
Who /pythonista/ here
>>
>>60484232

thanks man that did the trick :) it's good to know that there are people who'd be willing to help an idiot like me
>>
File: 1485567494003.jpg (14KB, 247x223px) Image search: [Google]
1485567494003.jpg
14KB, 247x223px
>>60485054
>ERP software
>>
Speaking about zipping, what are your deploy tricks /dpt/? Just makefiles? I always end up writing bat files with msbuild and scp on windows because I can't into make
>>
>>60484598
Could I do a list intersection
>>
>>60485471
Use nmake
>>
>>60485471
Cmake.
>>
>>60485471

CMake, typically. Sometimes I default to just regular old GNU Make. If there's a standard build system for a language (i.e. Cargo for Rust), I'll likely use that. I'm not a fan of XML-based build systems, and avoid where possible. If I'm forced to use Java, I'll stick to CMake if I can. For .NET Core, I haven't found much of a reliable way to use anything other than .csproj and .fsproj. I haven't tended to use .NET that much, so I haven't bothered to learn too much about those formats.
Thread posts: 335
Thread images: 26


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.