[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
/dpt/ - Daily Programming Thread
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 255
Thread images: 29
File: DPT.png (389 KB, 934x1000) Image search: [Google]
DPT.png
389 KB, 934x1000
Old thread: >>55440142

What are you working on /g/?
>>
DO I DROP LEARN PYTHON THE HARD WAY OR NOT

WHAT DO I DO INSTEAD
>>
I'm reading K&R. I'm a scrub that hasn't done anything after reading introductory books.

>>55450022
Drop that fucking garbage. Fuck. Kill yourself.
Get this https://www.amazon.com/Python-Programming-Introduction-Computer-Science/dp/1887902996 or pirate it or whatever. REEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
>>
>>55450022
>DO I DROP LEARN PYTHON THE HARD WAY OR NOT

I've heard that Zed Shaw is an unrepentant pedophile.
>>
4th for Go is best language
>>
File: 1386290036806.png (263 KB, 800x720) Image search: [Google]
1386290036806.png
263 KB, 800x720
Why aren't you using C++ and embracing OO?
>>
>>55450207
>embracing a turd
>>
>>55450207
C++ is GOAT
>>
>>55450207
>C++
>OOP
You literally can't get any worse than this.
>>
>>55449719
>casts fire spell at you
>>
>>55450190
bl(remove)og_twi(remove)tch_tv slash gos-march-to-low-latency-gc-a6fa96f06eb7
>>
File: image.jpg (34 KB, 400x400) Image search: [Google]
image.jpg
34 KB, 400x400
what is good/bad about c++?
>>
>>55450381
I found it pretty naice, though the error messages were a pain.
>>
>>55450381
"Everything and Everything"
~DPT
>>
>>55450381
I think most complaints about it revolve around the fact that it's C with a ton of extra shit bolted on.
>>
>>
>>55450311
nvm... just click on the link here
https://news.ycombinator.com/item?id=12042198

stupid 4chan block tw it ch or something
>>
Opcodes implemented on the rust chip8 emulator.

Looked at the rust implementation of sdl-2 it's a little bit heavier than I would like for this project.

Sigh.. I might end up just using glium + openal.
>>
im not much of a programmer but wondering if theres an existing tool to do this

one image has an md5 checksum, i need to apply that checksum to another image

are there any keywords that i can use to help me find something like that?
>>
>>55450936
>i need to apply that checksum to another image
do you know what a checksum is
>>
>>55450997
Not that guy, but no, I don't
>>
>>55451006
https://en.wikipedia.org/wiki/Checksum
>>
how do i create a pointer to a function in another header file and then pass that pointer to a function
>>
>>55450936
yes there is:
https://marc-stevens.nl/p/hashclash/
https://www.win.tue.nl/hashclash/
>>
>>55450037
>>55450148

...so stop doing it???
>>
If your type system isn't Turing complete then your language sucks
>>
>>55451122
g-global/extern variables?
>>
why is there so much stuff to learn. what the fuck am i supposed to do!!
>>
>>55451244
Begin at the beginning, and go on until you come to the end. Then stop.
>>
>>55451244
Just enjoy the fact that you already know so much more than the average person, anon!
>>
>>55450207
C++ is mostly fine. OOP isn't. It has a place, but it's not something to strive for. If you understand the ideas, you'll understand when they're worth using.
>>
>>55451233
I think so but it's not really working.
I get some error saying the function i'm trying to pass it to is not defined in the scope.
>>
>>55450457
this, which is wonderful IMHO
>>
want to learn python

have no programming experience

bad at math

what do
>>
>>55451452
take an online class on how to teach haskell using unix
>>
>>55451452
Write a program to do math for you.
>>
>>55451452
>want to learn python
Decide on a project. Find a resource. Establish the fundamentals enough to start working on something you care about while you learn.

>have no programming experience
Have to start somewhere.

>bad at math
Irrelevant.
>>
File: lol.jpg (17 KB, 474x474) Image search: [Google]
lol.jpg
17 KB, 474x474
I fell for the computer science meme, I have really good grades in all of my programming classes and go do every assignment easily, what steps should I take to go from making shitty code snippet, to making a decent useful program?

Should I master a language piece by piece or can I start making small useful beginner programs.
>>
>>55451478

i took your advice and i accidentally wrote a program that brought back Steve Jobs.

How do I reverse the damage I just caused?
>>
>>55451539
I do'nt lmpw
>>
>>55451533
Start writing a program. Make sure it's ultimately both decent and useful. If you don't know that means, develop a personal metric. Don't stop until you've done it, and done it right.
>>
>>55451533

Pick a project -> work on the project -> complete the project.

Find something you want to make anddd stick with it. Just do it and any research you may need on the way.

Repeat this while also finding better ways of accomplishing things. You will get better and the hard will become easy over time and the easy will become trivial.
>>
>>55451533
this >>55451565

Do something just outside of your capabilities. If you just want to better understand the language and how things work, focus on making sure the program runs as intended.
If you want to be good at what you're doing, focus on good code practices and strong architecture while making sure the program runs as intended.

You only need the first one to get a job though.
>>
Why is everything so difficult with Android development?

it takes like 10 times longer to do the same thing in other frameworks like iOS SDK or Qt or WPF or whatever
>>
>>55451539
That would do more good than harm, the way Tim Cuck is going.
>>
what's a good haskell book for someone who already knows how to program? all haskell books i'm coming across seem written by idiots
>>
File: 1447202360372.png (145 KB, 449x300) Image search: [Google]
1447202360372.png
145 KB, 449x300
>mfw /g/ can't even compute fibonacci numbers in O(log n)
>>
>>55451898

If Android were perfect, there would be no reason for people to use or develop for iOS. Android's flaw is that you have to use Java and XML for fucking everything and all of the build tools run like ass.
>>
Is there a way to do this that is readable and doesn't rely on typecasting?

String line = fileSearcher.nextLine();
StringTokenizer parser = new StringTokenizer(line, "/");
Race races = new Race(parser.nextToken(),Integer.parseInt(parser.nextToken()),Integer.parseInt(parser.nextToken()),Integer.parseInt(parser.nextToken()),
Double.parseDouble(parser.nextToken()),Double.parseDouble(parser.nextToken()));
raceList.add(races);
>>
>>55452484

You mean finding the nth fibonacci number in O(log(n)) time? I recall seeing the algorithm for that at one point, but I cannot recall it. I think the algorithm worked similarly to square and multiply, but I'm not sure (I could be thinking of something else).
>>
>>55452497
int a = Integer.parseInt(parse.nextToken());
int b = Integer.parseInt(parse.nextToken());
int c = Integer.parseInt(parse.nextToken());
...
int z = Integer.parseInt(parse.nextToken());
Races races = new Race(... a, b, c, ... z);
>>
>>55452526
Recursive relations, matrices, exponentiation by squaring.
Hint:
[1 1]
[1 0]
>>
>>55452552
That gives it away, everyone knows that monoidal exponentiation is O(log n) as long as multiplication is constant time.
>>
>>55452608
Or should I say semigroupal? you don't need an identity to exponentiate to positive integers.
>>
>>55452536
I guess it's readable but now it takes up more lines. Decisions decisions.
>>
where do i start?

what do i read?

should i avoid reddit for advice/help?
>>
>>55452608
>All these words

Yeah! Totally! I agree with you 300%
>>
>>55452536
Maybe make an array of integers and then iterate through it instead of making a big huge list of assignments.
>>
>>55452710
You should know the answer if you've read SICP
>>
File: le actual oop.png (313 KB, 1680x740) Image search: [Google]
le actual oop.png
313 KB, 1680x740
>>55450207
OOP IN LOO
https://www.youtube.com/watch?v=CRUa_09IOVU
>>
Anyone got any good recommendation on web scraping?
>>
>>55452699
start programming
read a book
ignore plebs
>>
>>55452699
start a tutorial or a good book for beginners
see above
i would take reddit advice over the typical /dpt/ shitposter anyday because their forum has actual moderation
really though, none of them compare to stack overflow, it will be your best resource apart from books
>>
>>55452552

>exponentiation by squaring
Well at least I remembered that part.

>matrices
My least favorite thing in mathematics.
>>
>>55452734
>Regular Class Room Session
>Thousand Students in a Single Class Room
>some fucking Indian posted a shit ton of error codes in the comments
>http://durgasoft.com/
why haven't I seen this before, this is comedy gold
>>
>>55452922
>syntax error: , while compiling: Create tableinfoTable
lol is it because there is no space after table? or maybe he fucked up while copy pasteing
>>
>>55452902
>My least favorite thing in mathematics.
Same, tedious and straightforward.
But the reasoning behind this is really neat.

// Let the fibonacci sequence be defined by
a_n = a_n-1 + a_n-2
a_1 = 1
a_0 = 0

// define another sequence, b, as
b_n = a_n-1

// Let's substitute and look at the sequences next to eachother
a_n = a_n-1 + b_n-1
b_n = a_n-1

// We can combine both sequences a_n and b_n into a single sequence (of vectors)
F_n = <a_n, b_n>
F_1 = <1, 0>

// The recursive relation for F is the product of a matrix (this is obvious when expanding the terms)
[1, 1]
F_n = [1, 0] x F_n-1

// Obviously, this is equivalent to the exponent
F_n = M^(n-1) F_1
where
[1, 1]
M = [1, 0]

// The algorithm is then just the fast exponent algorithm on the matrix M
>>
So I had an assembly class few years ago where we used Atmel AVR Atmega128 and now I suddenly got a strange urge to go program in assembly again.
The problem is I don't have any ideas for what to make or study. Currently dont have any money (until after 2-3 weeks from now) to buy any microprocessors and make some project so yea , Im stumped, need recommendations.

Want to practice it for use in actual projects when I finally get some cash
>>
>>55452922
>http://durgasoft.com/
What in the unholy fuck this cannot be real
>>
>>55453036
the youtube video/channel suggests that it is very real
>>
>>55451344
When is OOP worth it?
>>
>>55453133
when making a video game
>>
>>55453133
never
>>
>>55453133
always
that doesn't mean you should always have inherited polymorphic classes
most of the time a single class with mostly POD and a few member functions is all you need
>>
>>55452902
Matrices make sense when you think of them not as fundamental objects that are given meaning ex nihilo but as codifications of linear transformations in vector spaces. Any definition using linear combinations can be represented by a scalar product or matrix application. The columns of a matrix represent the images of each basis vector, and the rows their preimages. Hence the vector space generated by the columns (the column space) is the image of the matrix as a transformation, and the row space the coimage.

For example, the relation F(n+2) = F(n+1) + F(n) defines F(n+2) as the product of the matrix [1 1] with the vector (F(n+1) F(n))^T. To make this a vector space endomorphism, you add a relation to the system that uses the same vector (F(n+1) F(n))^T and adds a second component to the 1-dim vector F(n+2) that lends well to composition, the simplest of which would be F(n+1) = F(n+1) + 0*F(n). Then you get the matrix equation in >>55453005

Another example is the adjacency matrix of graphs. If G is a graph and |V(G)| = n, we can represent subsets of V(G) as vectors of dimension n with components either 1 or 0 corresponding to each vertex in sequence. Then defining addition and multiplication as in a Boolean algebra, these vectors form a vector space, and the adjacency matrix transforms a subset into the 1-neighborhood of that subset, i.e. the set of vertices that can be reached from a vertex in that subset in one step, and each consecutive application of the adjacency matrix increments the number of steps.
>>
>>55453133
When your problem domain is easily solved in the OO model.
>>
how do i get better at software architecture?
>>
>>55453211
POD?
>>55453281
Examples?
>>
https://www.youtube.com/watch?v=PNmji8qNL0s
>udacity
>>
>>55453459
>just uh copy paste this shit
brilliant
this is how learning happens
>>
>>55453211
>most of the time a single class with mostly POD and a few member functions is all you need
Not OOP...
>>
>>55453520
What is OOP?
>>
>>55453528
shit
>>
>>55453253

I can understand the reasoning behind matrices. I took linear programming and a ton of other classes that end up using them. My reason for disliking them goes like this...

1. I start up a class in either math or computer science that ends up using matrices for some thing or another.
2. I haven't used them in a while, so I have to go re-learn a few definitions.
3. The work is kind of tedious, but I grin and bear it figuring that I probably won't use this theory in the workplace.
4. When the quarter is over, I forget everything I know about matrices, hoping I won't have to see them again because they are tedious.
5. They keep showing up over and fucking over.

This last year I had the fortune of using matrices in back to back classes. In a parallel programming class working on the Stampede supercomputer? Obviously I'll need to optimize matrix multiply. Algorithms? Why not have students write proofs about some algorithm involving matrices?
>>
>>55453166
I love how /g/ is full of fat NEET cunts who have never written anything bigger than a fizzbuzz-tier program and yet they dare to claim that OOP is never a good idea.

I such an easy way to spot fags who have no idea how to write extensible and well-designed software.
>>
>>55453528
Nobody knows, really.

But as another example, the existence of functions doesn't make a language "functional". The existence of logical predicates doesn't make a language "logical/declarative".

OOP is characterized by objects and their interactions, through a system either composed of or emulating "message passing" to (and from) these objects. The advantage of this is you can abstract by considering an object's internal state a black box as you only interact through it through external messages (called encapsulation), and also generic programming / flexibility by having similar objects respond to specific messages in different ways (usually called polymorphism).
I would not consider a language/design without polymorphism to be OOP.
>>
File: 1462665702455.png (54 KB, 311x311) Image search: [Google]
1462665702455.png
54 KB, 311x311
>>55453594
t. butthurt oop professor
>>
>>55453610
t. fat NEET basement dweller
>>
>>55453520
yes it is
how many levels of inheritance does there need to be for you to consider a piece of code "OOP"?
because for me it's zero
just having a class with a constructor and some functions is enough
>>
>>55453595
Further expanding on what I said about "functional" languages, the existence of first-class functions usually categorizes a language as "functional"; however, common themes run along functional languages, such as immutable/persistent data, pattern matching, ADT's, strong/inductive type systems. Cultures evolve, and it may be sometimes necessary to integrate these aspects into the definition of the "paradigm". Thus I don't think that "first-class functions" suffices as the deciding factor for if a language is functional. And I also don't think that "fields & methods" is a sufficient definition of OOP, because if it was, the only "non OOP" languages left would be what, Forth and APL?

>>55453713
>just having a class with a constructor and some functions is enough
Enough to write sane programs, yes. And keep doing you, but overly-general categorizations are completely useless.
>>
>>55453594

DPT is full of the following types of people:

1. Beginners learning to program who haven't written anything other than FizzBuzz. They think it is an accomplishment because of the number of incompetent programmers out there who can't do it and then bitch that they didn't get a job because of it.

2. Ex-/prog/ users who fell for the functional programming meme. They're usually fans of either Haskell or some Lisp variant (but not both), and like to shitpost the hardest in language wars. They are hobbyist programmers and will likely never get a programming job.

3. Traps and trap chasers who do not seem to be aware that /soc/ exists precisely for them.

4. People working on semi-interesting projects

5. CS students trying to cheat on their homework

6. A few decent programmers either in school or with a job of some type.
>>
>>55453783
6 represent
>>
>>55453783
I mainly come here to ask questions, or generate some sort of contrast to branch off from. I lurk and watch for at most 2 threads, then leave for a number of weeks again.

Usually I get some shit for my questions being supposedly stupid, but not always. Answers are taken with a varying degree of salt.

I'm a mix of 1 and 4. Will likely never program professionally, but fixated on maximum efficiency, reliable portability, and creating better than professional quality code.
>>
>>55453783
I like to imagine that I'm in group 6, but I haven't developed anything of any real significance.
I always feel like I could be doing better, and that there is so much more to learn.
>>
>>55453783
>here are the neat and tidy categories that people who disagree with me fit into, they are all negative
>also there's this positive category I fit into
>>
>>55453873
spotted the fizzbuzz shitter
>>
>>55453783
you forgot language war shitposters
also having a programming job does not entail being a decent programmer, t. employed code monkey
>>
>>55453528
POO spelled backwards
>>
>>55453873

2 positive categories, 4 negative categories.

I mention more negative categories because most of DPT really could be categorized as rather silly.

>>55453938

I generally lump language war shitposters in with category 2, although some of them are into things like D and Go I guess, so maybe I do need another category.
>>
>>55453861
Oh, also I don't as yet know or care about fizzbuzz. I''ll probably look in to it eventually.
>>
>>55453991

Do you know how to do a for loop?
Do you know how to use if statements?
Do you know how to test if an integer is divisible by another integer?

Congrats! You know how to do FizzBuzz.
>>
>>55454072
Yay...
>>
>>55454072
>for loops
>if statements

Trashman's language
>>
whats more popular in modern servers today, thread pooling or single threaded async stuff?
>>
>>55454120
memes
>>
Any Javascript Wizard here?

So, here's an Object:

var post = {
board: "/g/",
user: "anon",
solved: false,
xpost: true
}


I am writing a routine to print its structure like this:

post.board
post.user
post.solved
post.xpost


Here it is, defined then called:

function showStructure(obj){
var a;
for (a in obj){
console.log(obj +'.'+ a);
}
}

showStructure(post);


And the output:

[object Object].board
[object Object].user
[object Object].solved
[object Object].xpost


How can I get the variable name of the parent object rather than a handle?
>>
>>55454149
you cant
>>
>>55454190
Damn! Not even a dirty trick?
>>
>>55453783

Ease up on the truth bombs, Ruby.
>>
>>55453783
I'm a "2" then, but only the last sentence. I build tools to solve my own problems, and ask /g/ whenever I hit a wall google can't fix. Maybe someday I'll square to a 4?
>>
Can someone help with some assembly? Compiling
global loader

MAGIC_NUMBER equ 0x1BADB002
FLAGS equ 0x0
CHECKSUM equ -MAGIC_NUMBER

section .text:
align 4
dd MAGIC_NUMBER
dd FLAGS
dd CHECKSUM

loader:
mov eax, 0xCAFEBABE
.loop:
jmp .loop

KERNEL_STACK_SIZE equ 4096

section .bss
align 4
kernel_stack:
resb KERNEL_STACK_SIZE
mov esp, kernel_stack + KERNEL_STACK_SIZE
gives me a weird NASM error:"loader.s:24: warning: attempt to initialize memory in BSS section `.bss': ignored" I'm pretty sure I should be able to resb in BSS. What's the issue?
>>
>>55454149
Honestly I dunno why you would want that.
Variable names is something you yourself would write, so it could as well be another property or make it an object with its name and another object inside it, with all the properties you want to iterate through
>>
File: 1464402534430.jpg (89 KB, 960x796) Image search: [Google]
1464402534430.jpg
89 KB, 960x796
How should I structure a Qt program so that it doesn't get out of hand? Are there any common idioms I should know about for stuff like managing large numbers of QActions? Does anyone know of any well written Qt codebases I can take a look at?
>>
>>55454486
It is not essential for the goal I have in mind but, for the sake of completeness, I wondered how this could be done. Turns out it can't; doesn't matter. Thanks for your input!
>>
I need some materials on application design. How do I connect all the small pieces together?
>>
>>55454610
monads monoids
functors monad transformers
dependent types GADTs
arrows indexed monads
>>
>>55454399

Well let's see, what's on line 24...

mov esp, kernel_stack + KERNEL_STACK_SIZE


You tried to put an instruction in .bss. Nice job.
>>
>>55454666
rigs rings magmas semigroups groups
Comonads comonoids
etc
>>
>>55454253

"And ye shall know the truth, and the truth will set you free."

- Some hack.
>>
>>55454785
I'm retarded sorry
>>
>>55454808

It's alright. In any case, you appear to be writing a multiboot header, which doesn't exactly have a concept of "section"
>>
>>55454666
More object-oriented, though.
>>
>>55450022
ass
>>
>>55454938
strategy factory singleton
command decorator facade
adapter
>>
>>55454969
Alright, thanks Anon!
>>
>>55454969
Absolutely disgusting
>>
>>55454969
Yeesh, the place already stinks of poo.
>>
A colleague at work said that the app is slow because it's written in C++ and that it would be faster in Java or even C#. Why are my colleagues so retarded when I'm working as tech support?
>>
>>55455006
This is why you can tell Bjarne has an underlying frustration and disgust for people in the current state of culture around software development.

His website has a whole long page of "this is the dumb shit you say, and this is why it's wrong." Otherwise known as a FAQ.
>>
>>55455006
How can C++ applications be faster than C++ itself.
>>
File: 31073728.gif (67 KB, 230x230) Image search: [Google]
31073728.gif
67 KB, 230x230
>>55452734
Just imagine what that room must smell like
>>
>>55455124
Your sentence makes 0 sense. Java and C# are not related to C++ at this point.
>>
Aight lads, I've gotten a book on OpenGL, how the fuck am I supposed to compile this shit?
I tried Codeblocks, Visual Studio and nowhere online gives an actual answer, one attempted to but it didn't work.
Can you lovely fellas help a guy out here
>>
>>55455006
If someone wanted to switch for a reason like that, they should at least implement the most critical codepaths and get some benchmarks to justify their argument.
>>
>>55455175
Oracle JVM is written in C++.
>>
>>55455224
But it compiles Java bytecode into machine code and runs that natively on the processor.
And what about C#?
>>
>>55455237
I compiled your mum's C# until I emitted optimized machine code.
>>
>>55455265
Congratulations on that.
>>
>>55455274
Thanks. It was pretty neat.
>>
I have a basic average downsampling algorithm for audio data:

http://pastebin.com/F73mD75K


Is it possible to change it to work in O(n) time?
>>
>>55455199
>is an actual question
>not a shitpost
>gets drowned by shitposts
>>
Is there actually anything wrong with using recursive makefiles? Currently building a C library by having a top level makefile enter each directory like this:

Running command: mingw32-make.exe -f Makefile.mak Build
cd crt && mingw32-make.exe all
mingw32-make.exe[1]: Entering directory `crt'
Compiling C Runtime Library...
if not exist "bin" mkdir "bin"
if not exist "obj" mkdir "obj"
Compiling stdlib...
cd stdlib && mingw32-make.exe lib
mingw32-make.exe[2]: Entering directory `crt/stdlib'
arm-none-eabi-gcc -Wall -fno-common -mthumb -mcpu=cortex-m4 -I ../h -c malloc.c -o ../obj/malloc.o
mingw32-make.exe[2]: Leaving directory `crt/stdlib'
Compiling string...
cd string && mingw32-make.exe lib
mingw32-make.exe[2]: Entering directory `crt/string'
arm-none-eabi-gcc -Wall -fno-common -mthumb -mcpu=cortex-m4 -I ../h -c memset.c -o ../obj/memset.o
mingw32-make.exe[2]: Leaving directory `crt/string'
Building Static Library...
arm-none-eabi-ar -cvr bin\libc.a obj/*.o
a - obj/malloc.o
a - obj/memset.o
Checking archived files...
arm-none-eabi-ar -t bin\libc.a
malloc.o
memset.o
Done!
>>
>>55455199
You need to link a specific library to access the actual OpenGL functions, something like -lopengl32 on Windows.

Here's a good link!
http://goanna.cs.rmit.edu.au/~gl/teaching/Interactive3D/2012/compiling.html
>>
>>55455392
>if not exist "bin" mkdir "bin"
There is definitely something wrong with using mingw32-make. It shouldn't exist. Please write portable Makefiles.
>>
>>55454149
Override the toString method
>>
File: shamefrudisplay.jpg (30 KB, 657x527) Image search: [Google]
shamefrudisplay.jpg
30 KB, 657x527
>>55452484
>mfw I flunked out of high school and still don't understand logarithmic functions
Got through a few weeks in a CS course online and now need to stop to learn basic mathematic principles because I'm a fucking retard who never learned them as a kid just so I can properly understand big O notation.
>>
>>55455450
I'm currently only targeting this for windows users. It's still in really early dev and I suck dicks at make. Could you address the question please, I can change the tool whenever.
>>
>>55455511
Kill yourself, frogposter.
>>
>>55455511
>don't understand basic mathematics
how do you function?
>>
>>55455537
Windows has real make. See MSYS2 and Cygwin. There's no reason to ever use mingw32-make.

Recursive make is definitely a thing a lot of people do though. It should be fine as long as you do it properly with $(MAKE).
>>
>>55455593
>basic
>>
>>55455617
visual basic
>>
>>55455617
>Logarithms
>Not easy as fuck
How can you even call yourself a computer scientist?
>>
>>55455609
Ahh I see. I'm using coldeblocks as an ide which I assume just uses a standard windows console and blindly runs the makefile with whatever executable I specify. Is there a way to pipe this into cygwin?
>>
>>55455628
>unironically calling yourself a scientist
>>>/sci/
>>
>>55455628
>implying I call myself a computer scientist
>>
>>55450460
underrated post
>>
>>55455634
CodeBlocks might come with MSYS make. I can't remember if it does or not. If it's there it will be called make.exe, not mingw32-make.exe. If it's not there, I guess it's fair to use what it comes with.
>>
>>55455634
Don't use cygwin, use MSYS2. It even has a package manager for minimal bullshit fuck around.
>>
File: anime pic.jpg (71 KB, 400x465) Image search: [Google]
anime pic.jpg
71 KB, 400x465
>>55455642
>>55455664
>Not even a computer scientist
Why are you even here?
Code monkeys aren't welcome.
>>
>>55455706
Scientists belong on reddit
>>
>>55455642
/sci/ has a knee jerk reaction with Computer scientists. /g/ is for CS
>>
>>55455728
Computer scientists are mathematicians, not scientists.
>>
>>55455742
If you take the label "* scientist" then you belong on reddit
>>
>>55455769
Get out of here, you uneducated swine. Being a computer scientist has nothing to do with reddit.
If you call yourself a 'programmer' and don't know computer science, you're just a filthy code monkey.
>>
>>55455769
what other label does someone who studied computer science put on himself then? Person of CS background?
this is getting as ridiculous as political correctnes
>>
>>55455769
>>55455813
What are you talking about? /g/ is the 33rd most popular subreddit right now.
>>
File: this article is real and true.png (329 KB, 711x610) Image search: [Google]
this article is real and true.png
329 KB, 711x610
>>55455813
>>55455828

>summer
>>
File: smuggo.jpg (136 KB, 560x570) Image search: [Google]
smuggo.jpg
136 KB, 560x570
>2016

>A glorious machine learning age is here

>/dpt/ is still 110% occupied with solving college-tier fizzbuzz homeworks. Your typical /dpt/ers' highest aspiration is to finish his college and become a replaceable 60k$/year codemonkey.

>Instead of following latest machine learning research and trying your hand at building intelligent models that do their work on their own.

Pathetic, /dpt/. Utterly pathetic.
>>
>>55455849
Machine learning is a meme.
>>
File: 1466329334062.jpg (24 KB, 258x263) Image search: [Google]
1466329334062.jpg
24 KB, 258x263
>>55455849
>having a computer write your programs for you
not programming
>>
>>55455862
Writing a program that quite literally learns from experience is pretty much programming.

>>55455860
The best meme ever!
>>
>>55455914
programming a learning machine yes
programming it to do those things it learns, no
>>
Where do I begin with Java GUI development?
>>
>>55456024
You fly to Bangalore, India
Poo on the street
They teach you java in exchange for poo
>>
Scrub alert

I'm using vba to pull paragraphs from Excel and print them to Word, problem is that I'm having trouble with font; I'm able to bold the entire document but not individual parts. I'm desperate looking through the Office 14 object library trying to find the right command but I'm having trouble. Anybody think that they could lend a hand?
>>
>>55456049
>ITT underrated /g/entleman
>>
File: 1348267511718.jpg (53 KB, 419x492) Image search: [Google]
1348267511718.jpg
53 KB, 419x492
>>55455593
>>don't understand basic mathematics
>how do you function?
How would he know?
>>
>>55456024
JavaFX. They actually started fixing shit with java 8 release, so it's pretty good. Form builder is still outdated, though, so enjoy your fxml.
>>
>>55454510
http://hiltmon.com/blog/2013/07/03/a-simple-c-plus-plus-project-structure/

Or just copy the structure of other well known C++ programs. And always use an homogeneous coding style.

https://wiki.qt.io/Coding_Conventions
https://wiki.qt.io/Qt_Coding_Style
>>
>>55456024
Don't.
>>
how to start learn swift on gnu/linux?
>>
File: 1373427861125.png (154 KB, 3924x5000) Image search: [Google]
1373427861125.png
154 KB, 3924x5000
>>55455860
>meme-making memes
The Singularity will be danker than imagined.
>>
>>55455849
Go program a machine to learn greentexting for you.
>>
>>55456240
Just gather your greentext to file, train a char-RNN over it and it will learn to greentext for you.
>>
>>55456169
Oh, those should be helpful, thanks. I didn't know about those wiki pages. Qt sure does a lot of stuff to work around broken compilers. I shouldn't need to do all of that myself.

I wish people wrote more about how to structure a medium-sized Qt program, like whether to subclass QApplication or not, or how the hell you're supposed to maintain your sanity when porting your Qt program to macOS.
>>
>>55456170
Well my programs have to have a user interface. What language is best for GUI's in your opinion?
>>
>>55456281
html5
>>
>>55456292
Don't.
>>
What's the best way to do OpenGL these days?
As in what libraries?
>>
>>55456302
The Open Graphics Library.
>>
>>55456302
GLFW is cool. Last I checked it does everything right, including tricky stuff like HiDPI support.
>>
>>55456281
C# or java probably
but really though, web apps is the hottest shit right now for good reason, it takes care of all kinds of deployment issues and its MUCH easier to recruit designers for
any well written system will look exactly the same regardless if you have a web ui or desktop ui, so you wont have o deal with any webshit anyways
>>
>>55456198
https://twitter.com/smilevector
>>
>>55456338
>any well written system will look exactly the same regardless if you have a web ui or desktop ui
Wrong. All well-written native apps look like the operating system they're running on.

Web apps deployed on the actual web haven't solved the privacy/security problem yet. The person in control of the server could choose at any moment to target any user by sending them a modified version of the app that sends data back. Web apps deployed with Electron or similar are slow as balls and fuckhuge compared to native apps and users with taste hate this. I would rather use a fucking Java Swing app than an Electron app.

Sure, write a web app if you intend to get paid for it, or you want to make an ebin meme tech startup, but if you want to make something you can be proud of, write a native (desktop or mobile) app.
>>
Hey /dpt/, basically this >>55456414
You don't have to reply to my shitty thread but I would like some advice on here if you don't mind
>>
>>55456434
>Wrong. All well-written native apps look like the operating system they're running on.
mate, you know and i know that only companies with large performance requirements decide to write native apps
having to pay your devs a couple of extra months in salary because you decided to roll with C++ instead of C# is a pretty large investment compared to throwing money at better servers

>Web apps deployed on the actual web haven't solved the privacy/security problem yet. The person in control of the server could choose at any moment to target any user by sending them a modified version of the app that sends data back.
goes for native apps as well, the person in charge of the server could modify your update system to install malicious code
you can add as many layers of security as you want, but you will never get around the fact that someone with physical access and knowledge of the system will be able to exploit it

>Web apps deployed with Electron or similar are slow as balls and fuckhuge compared to native apps.
why would a web app be any different from a regular one?
the backend of the system will look exactly the same, you're just using a different API to access and present it

>and users with taste hate this.
>Sure, write a web app if you intend to get paid for it, or you want to make an ebin meme tech startup, but if you want to make something you can be proud of, write a native (desktop or mobile) app.
i get it, you're just a contrarian
>>
wtf, how do i reduce
(C OR A AND B AND NOT C)
(C + A*B*~C)?
>>
>>55456143
kek'd heartily
>>
>>55456469
there are a lot of courses from mit, just an example:
http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-172-performance-engineering-of-software-systems-fall-2010/video-lectures/
also
https://courses.engr.illinois.edu/ece390/books/artofasm/artofasm.html
>>
>>55456543
Please use more parentheses
>>
>>55456543
C | (A & B & ~C)
(C | A) & (C | B) & (C | ~C)
(C | A) & (C | B)
C | (A & B)
>>
>>55456506
>only companies with large performance requirements decide to write native apps
I'm pretty sure this guy (>>55456024) is not the technical lead for some large company. He's probably just an anon with a personal project (hence "my programs" not "our programs".)

Also, I'm not arguing against C#. By all means, build a GUI in WPF, WinForms or WinRT/XAML, just don't use the web.

>goes for native apps as well, the person in charge of the server could modify your update system to install malicious code
It's not really the same. Native apps effectively work on a trust-on-first-use model. You download the app once. You can check the hash or the signature if you're extra paranoid. You don't take any extra risk every time you start it up. With the web, you have to trust the app every time you use it. Nothing is stopping a web developer from doing something like this on the backend:
if (user === 'daveo')
sendTheMalciousJavascript();


In a native app, the user has typically downloaded the app (and therefore "trusted" it) before they've even made an account (if an account is even necessary to use the native version.)

>why would a web app be any different from a regular one?
Are you kidding? Just look at Atom. It's enormous (104MB.) The Electron runtime by itself I think is about 40MB. No text editor with Atom's feature set should be that large. If you make something that should be a native app using Electron, you will lose users straight away because of the download size.

Also, the web was not originally designed for building applications. HTML, the DOM and CSS layout are not efficient tools to build user interfaces. CSS layout flows everything like a document and was only very recently hacked into something resembling a GUI toolkit with things like flexbox and intrinsic sizing.

>i get it, you're just a contrarian
Sure, whatever makes you feel better. Now go back to sipping your latte and make sure the login screen is finished by 5 PM on Friday.
>>
I'd love if someone had time to check my project and give me any directions to why it doesn't work. Grub throws a error of unsupported file format when i'm using .elf which grub supports. https://github.com/BobbyRaduloff/nOS/. Thanks in advance!
>>
>>55456768
For your ASFLAGS, make it elf32
>>
Not sure if this is appropriate here but fuck it.

I want to write Android apps, I know C and Java to decent levels, although I write C a ton more and so I am probably a lot better at it. I am aware that both have APIs for android, but I am not sure whether I should go for NDK or just regular libraries for Java.

I have heard that the regular libraries are a lot more painless to use than the NDK, but I am better at C.

Which do you think I should go for? Do both have ad libraries?
>>
>>55456927
Unless things have changed recently, you have to write at least some Java for every Android app. Also, you must use Java for the native user interface elements (action bars, buttons, etc.) Only a few APIs are exposed to native code, like OpenGL.

That said, if you're writing a game, it should be no trouble to have a thin Java wrapper and mostly C code.
>>
File: 1439903195165.png (536 KB, 776x840) Image search: [Google]
1439903195165.png
536 KB, 776x840
>tfw no Deep Reinforcement Learning gf

I-It's an abstract kind of feel
>>
Writing a 3d cheese pizza MMORPG in WebGL
>>
Is C++ how computers really work and using any other language just smoke and mirrors?
>>
>>55457046
No, it's a high level language.
>>
>>55457046
lolno
>>
Every language is just smoke and mirror
>>
>>55457070

That really makes me think.
>>
>>55457046
lmao-ing at your life
>>
>>55457046
http://www.nand2tetris.org/about/Nand2Tetris%20syllabus.pdf
>>
I have a question regarding workflow in actual company when it comes to programming


How do you organize a group of ~10 PCs and people working on one project?

I guess you have to have one server for storing files. Also, i guess you have to have some version control system. Also, i guess you need to have some software to assign and document day-to-day tasks. But is there some "industry standard" solution?

Can someone who works in any tech company explain this to me?
>>
>>55456849
Nope man, still same error ;-;
>>
>>55457131
Damn, that's cool.
>>
>>55457278
Whats the problem with setting up a git server?
>>
>>55457278
It would be the best if someone explained this through an example aka "i come to work, start X, look at daily tasks at Y, send my work to Z, document shit in XYZ"

>>55457363
There's nothing wrong with it, i've seen people also using Subversion, that's why i wonder is there some standard?
>>
>>55457310
download and read it if it's cool
>>
>>55457278
There are all sorts of tools for this. Where I work we use Git for source control and JIRA for managing assigned tasks, tracking bugs, managing teams and keeping track of time. For Git, we have a local repository and we also copy changes to a private GitHub remote. We have a continuous integration server running BuildBot that compiles the product to an .rpm when anyone makes a change, and we use Confluence as a wiki for documentation.

>>55457384
I come to work, start Visual Studio, WebStorm and Eclipse (I don't particularly like any of those, but you have to use what you have to use,) look at daily tasks in JIRA, commit my work to Git, document shit in Confluence.

>that's why i wonder is there some standard?
Nope, it's all >opinions. Some people like Subversion, some people like Git, some people like Mercurial. Game developers that need to version large assets tend to use Perforce. Fifteen years ago people used Visual Studio SourceSafe. They all essentially do the same thing (store and version source code,) but in different ways. Git keeps a local copy of the repository on your hard drive, including the history of all files, which a lot of people like because it allows them to work remotely and work on branches in private.

JIRA on the other hand is pretty popular, but it's by no means the only project management software you can use.
>>
How does one research the monad without running into gnostic texts?
>>
Hey /g/, i want to know if its possible to create a script or program that runs itself without the user needing to click on it?
>>
File: shouldnt ax contain 1.png (849 B, 98x67) Image search: [Google]
shouldnt ax contain 1.png
849 B, 98x67
Can someone help me with a very simple and retarded question? I have started learning assembly (i went with x86) and have tried a very simple task like, getting the sum of all the even number in a range.

My problem is, whenever I try to divide a perfectly divisible number, let's say 4, to the divisor, it returns a completely different result than what I have expected, although the remainder shows it's zero. But if I try to divide a non-divisible number like 3, the returned result is as expected


Please take a look at this embarrassing clusterfuck

_asm{
mov edx, 0
mov eax, 1
mov ecx, 0
mov ebx, 2 ;divisor

loop1: push eax ;push the current number to stack
div ebx
cmp edx, 0 ;check if no remainder(divisible)
je addtotal ;if divisible, add the number to total
jmp loop2

loop2: pop eax ;get the previous number
inc eax
inc ecx
cmp ecx, 10
je finish
jmp loop1


addtotal: pop eax
add total, eax
push eax

jmp loop2

finish:


}




It kind of works, but I just want to know the reason why I get a different quotient when I try to divide by a divisible number. Pic related is what happened when I tried to divide 2 and 2.
>>
is there a way to nest helper functions within functions in C++? like in scheme
>>
File: monad-id-law.png (20 KB, 358x260) Image search: [Google]
monad-id-law.png
20 KB, 358x260
>>55457603
>>
>>55457603
monad is shit, haskell is dog poo

I prefer python and machine learning research
>>
>>55457646
Templates and tag dispatching?
>>
>>55457658

So basically a recursive object tree?
>>
File: CPP.jpg (78 KB, 515x648) Image search: [Google]
CPP.jpg
78 KB, 515x648
Anyone knows a good comprehensive data structures book with C++ or C examples ? I want to prepare for interviews.
>>
File: monad diagram.png (26 KB, 334x358) Image search: [Google]
monad diagram.png
26 KB, 334x358
>>55457729
no
>>
>>55457508
Alright, thanks a lot mate

How hard is to learn git, at least some basics?
>>
>>55457639
Shouldn't it be cmp ebx,0 ? I am very rusty on asm though?
>>
I turn 24 on Saturday.

I'm sacrificing an entire year to the gods of programming. I'm going to post a portfolio on my 25th birthday /dpt/.
>>
>>55457729
the arrows are sort of like functions and the "points" are types
>>
>>55457819
in the diagrams that is

https://hackage.haskell.org/package/base-4.9.0.0/docs/Control-Monad.html
>>
>>55455846
Oh Stallman.
>>
File: 2016-07-08_00-01-30.png (1 KB, 104x71) Image search: [Google]
2016-07-08_00-01-30.png
1 KB, 104x71
>>55457766
Why?

I don't know man, I stored 2 inside ebx and made it the divisor. Pic is the result when it tried to divide 3(eax) by 2(ebx) on my original snippet.

However, when I tried something only

mov eax, 2
mov edx, 0
mov ebx, 2


div ebx


it returns the right answer, which is 1. I have fucked up something in my main code, but I don't know which is it.
>>
>>55457639

you arent clearing edx after a div
>>
>>55457833

So it's functions with a type as the argument being applied to functions that return a type in a sort of chain?

If I'm understanding this correctly it's more of a design pattern?
>>
>>55457904
It's like an interface

A monad is a type constructor (like a 'generic or template') that has associated operations

Can you read Haskell signatures?

fmap :: (a -> b) -> (f a -> f b)
return :: a -> m a
join :: m (m a) -> m a
>>
>>55457763
The basics are pretty simple, but it takes people a while to "get" Git to the degree where they can confidently do complex merges and rebases. Just remember that you can always undo with git-reflog and git-reset.

The Git command line interface is also pretty unintuitive to the point where you just have to rote-learn each individual command because none of them have the same syntax (
git remote rm <remote>
deletes a remote, but
git branch -d <branch>
deletes a branch.)
>>
>>55457639

1. EAX != AX.
2. if EDX != 0, you never reload it with 0. This means that at first, 1 / 2 = 0, rem. 1, but then what you get isn't 2 / 2 but ((1 << 16) + 2) / 2 = 65538 / 2 = 32769 rem. 0. The remainder is always correct as you're adding a multiple of 65536, which is even.
3. Even numbers have bit 0 == 0, so you could write it as such:

_asm {
mov ecx, 10 ; counter
xor eax, eax ; total

loop1:
test eax, 1
jnz odd

add ecx, eax

odd:
loop loop1

mov total, eax
}
>>
>>55457962

s/test eax/test ecx/
s/add ecx, eax/add eax, ecx/
>>
>>55457942
How do people on Win use git usually?
>>
>>55452484
>O(log n)
>not O(1)
smdh
>>
>>55458027
>O(1)
>not 1
>>
File: sepples substring finder.png (3 KB, 277x97) Image search: [Google]
sepples substring finder.png
3 KB, 277x97
made a substring start index finder in C++ r8 it
 
#include "stdafx.h"
#include <iostream>
#include <string>
using namespace std;


// Returns if 2 strings are the same.
bool matchStr(string s1, string s2) {
int i = 0;
int mainLength = s1.length();
if (s1.length() != s2.length()) return false;
while (i < mainLength) {
if (!(s1.at(i) == s2.at(i))) return false;
i++;
}
return true;
}

// Returns -1 if the substring does not exist within the main string.
// Otherwise, returns the index of the first character of the substring in the main string.
int detectSubStr(string main, string subStr) {
int mainLength = main.length();
for (int i = 0; i < mainLength; i++) {
if (main.at(i) == subStr.front()) {
if (matchStr(main.substr(i, subStr.length()), subStr)) return i;
}
}
return -1;
}

int main()
{
string main;
getline(cin, main);
string subStr;
getline(cin, subStr);

int result = detectSubStr(main, subStr);
cout << result << "\n";

return 0;
}
>>
>>55458049
pretty sure there's already a C++ function that does that
>>
>>55458010
There is Git for Windows, which has native Windows builds of recent Git binaries packaged with some MSYS tools. A bunch of people where I work who are afraid of the command line use SourceTree, which is a graphical client, but I don't think using a graphical client necessarily makes Git easier to understand, especially since most tutorials are for the command line tools.
>>
>>55458049
Why in the world are you passing the strings to your functions by value.
>>
>>55458049
Plus why have you written your own comparator?
Just use == for strings
>>
>>55458058
>>55458073
spotted the poo to loo codemonkeys
>>
>>55457940

I'm not really that far into learning Haskell yet. Just did some basic math functions and started on input / output. Now I've been seeing info about monads and trying to figure out what exactly I'm doing.
Thread replies: 255
Thread images: 29

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

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.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.