[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: 313
Thread images: 38

File: 1504345877670.gif (156KB, 500x364px) Image search: [Google]
1504345877670.gif
156KB, 500x364px
What are you working on, /g/?

Old thread: >>62227640
>>
Idris is a reasonable language
>>
fuck opengl though
>>
OP is an unreasonable faggot
>>
>>62235626
any programming language with more than three letters is automatically trash
>>
>>62235659
Learn to touch type and you won't have trouble with longer names.
>>
>>62235675
>touch type
Is that just a fancy name for typing? How do you type without touching your keyboard? Psychic powers?
>>
>>62235693
https://en.wikipedia.org/wiki/Touch_typing
>>
File: 1467835392609.png (263KB, 532x320px) Image search: [Google]
1467835392609.png
263KB, 532x320px
>steam link is $15
>Armv7 with neon and opengl ES,sdl,etc
>Official SDK: https://github.com/ValveSoftware/steamlink-sdk

>cheaper than a raspberry pi and can make for some cute programming ARM projects
>>
>>62235733
Sounds comfy. How open is it?
>>
Thinking about starting a cloud service for paranoid autists with a specialization for shitty connection speeds. What meme language and libraries do i use to get started?
>>
>>62235767
Python with Django for the service
Pascal for the infrastructure background
>>
>>62235803
>Pascal
some memes are too deep
>>
what is the best configuration file format?
>>
>>62235766
Seems totally open but not a lot of projects being made for it. I just wanna get some arm experience
>>
//You should be able to solve this:

#include <iostream>
#include <sstream>
#include <string>
#include <cstdlib>

using namespace std;

int main()
{
ostringstream oss;
oss << "Suck my balls faggot nigger" << endl;
char *oss_str_copy = new char[oss.str().size() + 1];
memcpy(oss_str_copy, oss.str().c_str() /* haHAA */, oss.str().size() + 1);
cout << oss_str_copy; /* prints random garbage or crashes */
delete[] oss_str_copy;

return 0;
}
>>
File: Just-Room.jpg (2MB, 2400x1800px) Image search: [Google]
Just-Room.jpg
2MB, 2400x1800px
I once colorized a drawing of that room.
>>
>>62235587
https://tour.golang.org
https://www.golang-book.com
>>
File: Just-wire.jpg (2MB, 2400x1800px) Image search: [Google]
Just-wire.jpg
2MB, 2400x1800px
So I could do weird things..
>>
>>62236071
nogenerics.info
>>
File: dice.gif (6KB, 650x450px) Image search: [Google]
dice.gif
6KB, 650x450px
An overly complex dice roller.
>>
File: everything-so-far.jpg (3MB, 2400x1800px) Image search: [Google]
everything-so-far.jpg
3MB, 2400x1800px
..like this.
>>
>>62236100
>nogenerics.info
such a nice language, thanks for posting this!
>>
You should eat a serrano pepper NOW /dpt/.
>>
If I'm going to use SDL and GL3 + gles2.
What's the best way to load the GL stuff and does there exists some decent library that does that?
>>
>>62236157
>Overly complex
Explain yourself, shit seems trivial to implement
>>
>>62236270
he's talking about the human that rolls the dice
>>
>>62235982
>>62236076
>>62236159
i don't understand
>>
>>62236270
Overly complex in the expressions it recognizes - it's based on a proper context-free grammar, it's dice all the way down.
In a typical dice roller you can roll expressions like XdY, where X and Y are numbers. I allow X and Y to be dice. Numbers are just dice that roll their value every time. So 1d6 rolls a single 6-sided die, (1d6)d(1d6) will roll X Y-sided dice, where X is the result of rolling one d6, and Y is the result of rolling another.
There's also a bunch of other modifiers (exploding dice, keeping the highest/lowest, etc.), and standard arithmetic, all of it composable.
>>
>>62236552
Doesn't seem overly complex to me. Just complex enough to be really useful.
>>
Is this an efficient way to determine if a number is a prime or not?
 int n, remainder;
remainder = 1;
for (n=2; remainder != 0 ; ++n){
remainder = num % n;
}
if (num == n - 1)
return (1);
else
return (0);
>>
im trying to understand some low level android source code, specifically the audio playback. every function in the class ends with a call like:
remote()->transact(SET_DATA_SOURCE_STREAM, data, &reply);

or
remote()->transact(START, data, &reply);

does anyone know where the function pointer remote() is defined? its not in any of the headers from the file.
file and header for reference
https://android.googlesource.com/platform/frameworks/av/+/android-5.1.1_r8/media/libmedia/IMediaPlayer.cpp
https://android.googlesource.com/platform/frameworks/base/+/donut-release/include/media/IMediaPlayer.h
>>
What's the big deal about closures? Why does every javascript book highlight them like one the most important features of the language?
>>
>>62236669
Closures are anonymous functions with variable capture (also known as lambdas). Anonymous functions without variable capture are not particularly useful compared to free functions besides not needing a name.
>>
>>62236576
>Is this an efficient way to determine if a number is a prime or not?
No. You would become extremely famous if you found one.
>>
>>62236639
https://stackoverflow.com/questions/15520098/implementation-of-remote#15523124

lurk moar bitch
>>
>>62236568
Yeah, I'm having fun with it. Most of the functionality would never be used in a real game, but I like the fact that the system does support this generalized notion of dice.
The idea is to give basic rolls simple, intuitive representations (if you type in XdY + Z it just werks), support extra mechanics from popular game systems (1K2d20 is 5E's advantage, 8T10A5d10 is a Storytelling System roll, 4d3-2 is a FUDGE dice roll), while allowing advanced users to do crazy things.
>>
>>62236710
lambda expression is the base concept of many abstraction techniques.
>>
>>62236763
Your medal's in the post.
>>
>>62236345
int human() {
return 3;
}
>>
>>62236797
int human(void) you mean
>>
>>62236829
No, I mean
int human()
>>
fellow pajeets, can i get a quick refresher on what is
 extends 
and
 implements 
>>
>>62236829
same thing
>>
>>62236888
>implements
class inheriting interface
>extends
all other inheritance
>>
Can anyone recommend a good youtube channel(s) to learn c++ concepts? I'm taking a class on it and the textbook is really unintuitive, so if anyone knows of someone who is good at explaining these things, I'd be grateful
>>
>>62236940
>implements
basically like header file in cpp right? but in java its for the programmer not the compiler or whatever
>extends
the children will have everything the parent have
>>
File: javascript.jpg (39KB, 381x500px) Image search: [Google]
javascript.jpg
39KB, 381x500px
I already know how to program somewhat and I want to study through this book

any objections?
>>
>>62236972
it's nothing like a header file, they both inherit.
>>
>>62236982
read SICP and do the tasks
>>
how do i get started with something basic
>>
>>62237028
have a high pH value
>>
File: 2017-09-03-171758_1046x854_scrot.png (495KB, 1046x854px) Image search: [Google]
2017-09-03-171758_1046x854_scrot.png
495KB, 1046x854px
>>62237028
Pour acid on it to neutralize.
>>
why does this work

def foo(a):
def bar():
print(type(a))
return a
return bar()
print(foo(1))


but this doesnt

def foo(a):
def bar():
a += 1
return a
return bar()
print(foo(1))


python 3.6 btw
>>
>>62236576
import primes
if a is primes:
return 1
else:
return 0
>>
>>62237044
That's a caustic reply.
>>
>>62237064
what kind of a brainlet language is this ?
>>
>>62236726
it's called fermats little theorem with the addition of i forgot what algorithm
an efficient algorithm for determining primeness exists
it's actually in SICP

it's probabilistic, but you can get 99.9999 certainty so who cares
there's also a polynomial algorithm to determine (or find a large prime for example) if a number is prime

you are thinking of factoring products of primes
>>
>>62237061
Passing by reference vs. passing by value. Setting something else to a inside foo doesn't change the value of a outside foo.
>>
>>62237098
>so who cares
Mathematicians care.
>>
>>62237142
you do realize that a probablistic alogirthm where it is YOU who determines what the certainty is in the answer is literally A WIN right

at that point it's over, problem is solved
>>
>>62237088
fourchan
>>
>>62237140
Doesn't matter because such an "outside foo" is never referenced.
>>
File: 1330305844691.jpg (2MB, 3072x2304px) Image search: [Google]
1330305844691.jpg
2MB, 3072x2304px
>Made sure I know something before moving onto the next chapter
>Few chapters later I forgot what I learned 3 chapters ago
Man, this is a bit demotivating. Always unsure if I should go back to review the whole shit again or to keep going. Slow progress...
>>
>>62237061
def foo(a):
def bar():
nonlocal a # a is from an outer scope
a += 1
return a
return bar()
print(foo(1))
>>
>>62237140
It's not about the value not changing, it throws
UnboundLocalError: local variable 'a' referenced before assignment
.

def foo(a):
def bar():
a = 3
return a
return [a, bar(), a]

works and returns
[1, 3, 1]
.
>>
>>62237179
Why do you need
nonlocal
on the second one and not on the first one?
>>
File: 1503660471836.jpg (35KB, 599x351px) Image search: [Google]
1503660471836.jpg
35KB, 599x351px
>>62237173
Don't give up
>>
File: 1504470733.png (48KB, 948x889px) Image search: [Google]
1504470733.png
48KB, 948x889px
Spent some time updating this thing. There was a lot of spaghetti from 2014; cut code in half and made it better.

Yes, it's just a glorified scrot + tesseract process invoker. The idea was to get it to automatically recognise text from around your mouse cursor so you can just mouse over something in manga or whatever and get the characters but I don't have enough time for that right now.
>>
>>62237333
i not gonna explain what scopes are, please read a basic programming tutorial.
>>
>>62235587
Gonna try to squeeze in as many programming books as possible in the next couple of weeks.

Currently finished with "The Little Lisper" and I have no fucking clue what the last couple of pages on Ch. 9 (the one that mentions currying and the Y-combinator) , but I'm just gonna move on to learning other stuff

>>62236473
Such a shame....

You seemed an honest man
>>
>>62237333
Because Python is shit.
>>
Command line utility that allows you to search for TV and movie torrents and stream using Peerflix automatically.

Been adding a lot more features to this over the past few weekends like advanced filtering and ability to download subtitles automatically.

https://github.com/AnthonyBloomer/ezflix
>>
>>62236669
Hey, >>62236157 here. I use closures in my dice roller.
Say you want a function
d(d1, d2)
that takes two dice and returns a new die that rolls (d1)d(d2). We can represent dice as functions that, when called, return a random value from a specific distribution. We can implement d like so:
const d = (d1, d2) => {
return () => {
const number = d1()
const faces = d2()
let rolled = 0
for (let i = 0; i < number; i++) {
rolled += Math.floor(Math.random() * faces) + 1
}
return rolled
}
}

If we then also define
const constant = n => () => n

then
d6 = d(constant(1), constant(6))
is a six-sided die, and
d(d6, d6)
is the (1d6)d(1d6) I mentioned here: >>62236552. No messy objects with getters/setters/etc., just compact and composable functional programming.
>>
>>62237382
>You seemed an honest man
what a whiny song

fuck anime and people who watch anime nowadays
literally normalidiots
>>
File: 1504435318350.jpg (202KB, 897x445px) Image search: [Google]
1504435318350.jpg
202KB, 897x445px
>>62237503
>>
>>62237498
ugly af
>>
File: 1468882928057.png (199KB, 439x392px) Image search: [Google]
1468882928057.png
199KB, 439x392px
Employed Haskell programmer reporting in
>>
>>62237611
Post feet
>>
File: feet1.jpg (145KB, 919x1024px) Image search: [Google]
feet1.jpg
145KB, 919x1024px
>>62237628
>>
why are these threads so dead in american hours
>>
>>62237671
Holiday weekend. Everyone is too type to drunk.
>>
Is there any good low level opengl C library? All of them seem to be in sepples.
>>
File: 2017-09-03-172711_821x58_scrot.png (16KB, 821x58px) Image search: [Google]
2017-09-03-172711_821x58_scrot.png
16KB, 821x58px
>>62235587
is this a legal signature?
can a non-brailet explain what it means?
>>
With clang, is it possible to export visible symbols automatically at compile time?
I know about __attribute__ ((visibility ("default"))), but is it possible to export these visible symbols automatically into a consolidated header file so it can be included in other projects?
>>
File: Kim-Jong-Un.jpg (38KB, 615x410px) Image search: [Google]
Kim-Jong-Un.jpg
38KB, 615x410px
Anyone worked in the field of Io T (internet of things) programming something ?
>>
>>62238080
GLEW
>>
>>62238080
What do you mean? OpenGL *is* a low level C library.
>>
>>62238084
Returns the maximum of an array of Es, where E must be comparable with itself.
>>
>>62238118
something wraps the differences between gles and gl and lets you build cross gl shaders?
>>
C/C++ query for you style nazis

#ifndef FILE_H
#define FILE_H
// code
#endif


or

pragma once;


or

#ifndef __542E2D93_2169_4149_A38C_C45EE4036B6B__
#define __542E2D93_2169_4149_A38C_C45EE4036B6B__
//code
#endif
>>
>>62238153
the fuck is the third one
>>
>>62238153
first

>>62238165
GUID
>>
>>62238165
Using a GUID instead of a normal header guard.
>>
why cant i fucking do the collatz sequence i thought this level of programming was easy
def collatz(number):
if number%2==0:
number=number/2
print(number)
elif number%2==1:
number=number*3+1
print (number)
elif number==1:
print(number)
print("Input a number.")
number=int(input(""))
while number !=1:
number=collatz(number)

Input a number.
7
22
Traceback (most recent call last):
File "collatz.py", line 13, in <module>
number=collatz(number)
File "collatz.py", line 2, in collatz
if number%2==0:
TypeError: unsupported operand type(s) for %: 'NoneType' and 'int'
>>
>>62238173
Why would you use a double underscore though? isn't that reserved for the implementation?
>>
>>62238144
Why don't you just use OpenGL ES?
>>
>>62238130
how would you even write such a function?
I assume there is a standard compare function or something in which I can just reduce (or fold) the array with
>>
>>62238173
>first
Why? Seems a chore if several projects have the same header an/or you need to rename the file.
>>
>>62238184
not portable
>>
>>62238199
write the path down to the header
>>
>>62238195
Because E is Comparable<E>, you can call compareTo on the elements of the array.
>>
>>62238207
Double annoyance if the file moves to a different directory
>>
>>62238178
You are returning nothing (None)
>>
>>62238182
It is, but it is a soft rule. You can break it anytime you want, but you'll get compile errors if you get a name collision.

Essentially - it is:

>We are going to name stuff with double underscore, don't use that shit

Also - it is for identifiers, not for macros.
>>
>>62238203
ES 2.0 is nearly a subset of desktop GL. ES 3.0 is a strict subset of desktop GL. You can write everything for ES and it will likely just work on desktop (barring slight differences in context creation).
>>
Starting tomorrow, I'm going to be working on porting an app to iOS. Have to do adjustments to refine it for an iOS experience and implementing ios stuff to it. Probably going to take a couple of weeks.

What's a good way to prepare for this mentally? Clean the room? Arrange stuff so I can take off full force starting in the morning? Grab some donuts?
>>
>>62238284
>What's a good way to prepare for this mentally?
Accept yourself as a gay
>>
>>62238284
What kind of app?
>>
>>62238308
language educational app
>>
Do you regularly grind shit like hackerrank familia?
>>
>>62235587
I started an image board based website, just with newer technologies and shit. I don't really like it that much but I'll see it through why not, I'm planning to use it for college propuses cuz that's the level of shit they'll accept.
>>
>>62238333
>newer technologies and shit
Like?
>>
Deep Q-learning for continuous action spaces in OpenAI environments, anyone want to join?
>>
>>62238353
Non-Rel DB, mp3 support n stuff, it uses nodeJS because muh JS meme (it's pretty fast tho), i use vuetify so UI is tard friendly...kinda.
>>
>>62235587
I want to learn to code (in Python) so so badly but my ADHD means even when I can manage to sit and focus nothing sticks in my head like functions and variables are the limit I seem to be able to learn..

No idea where to post this so maybe here?

Any suggestions?
>>
>>62238433
program more
>>
>>62238399
>Non-Rel
Do you have a good reason for using NoSQL?
>mp3 support
Cool.
>nodeJS
I don't hate you.
>vuetify
Not familiar with Vue. Screenshots?
>>
>>62238433
There are no shortcuts other than programming. ADHD has nothing to do with it. It's a separate issue, solve it yourself, then program.
>>
File: tests.png (7KB, 426x75px) Image search: [Google]
tests.png
7KB, 426x75px
The feeling when i've been working on a refactor all day and at last all my tests are green again.
>>
>>62238503
> Do you have a good reason for using NoSQL?
Not really, looking back PostgresSQL is ideal to model something like an imageboard, but I used this little project as an excuse to learn me some MEAN.

> Not familiar with Vue. Screenshots?
https://vuetifyjs.com/layout/pre-defined
and pic is my current layout, it's my first time doing frontend and vue so it's shitty.
>>
Which one should I learn, r or scipy/matplotlib to get a job after uni?
>>
File: PPP2frontNback[1].jpg (113KB, 1170x677px) Image search: [Google]
PPP2frontNback[1].jpg
113KB, 1170x677px
What is the Java equivalent of this book?
>>
>>62238819
There's no such thing because java was made so people could program, not for people spends years studying the language and still having no idea what's going on.
>>
>>62238889
"Effective Java" or something similar.
>>
>>62238889
Alright fair enough.

I learned Java a while ago but I need a refresher as I haven't used it in a year, what resources (Books, websites, etc.) do you recommend for someone who needs to brush up on stuff like maps, templates, generic types, and stuff like that?
>>
>>62236576
If you are interested in primes which fit in int type, you can try just having a hash/treeset of them, maybe it will be faster than loop.
>>
File: 1504077589006.jpg (63KB, 640x853px) Image search: [Google]
1504077589006.jpg
63KB, 640x853px
I've accepted I'm too dumb for OOP or possibly programming in general. I just can't get a hang of how things relate to each other. Trying to construct simple methods for school assignments and week after week it's just a struggle with things that really shouldn't be this hard. No idea what I'll do now
>>
>>62238938
im using "Java 7 A Comprehensive Tutorial"
pdf on gogole
>>
>>62238976
change majors
>>
>>62238976
post here and have us berate you
>>
>>62238791
scipy/matplotlib

Most data science jobs are looking for people experienced in python . R is dead.
>>
>>62238976
tfw to intelligent for oop
>>
>>62238976
Have you tried "Programming for Dummies". Perhaps you're thinking too deep into shit.

It's worth noting that, for my first year in uni, I never really thought or tried to understand how what I was doing worked. I just wanted to hack shit together so I could pass the assignment.

Only in my third year, did I really start to think about why shit worked and since I had a bit of coding experience things naturally started to make sense.
>>
>>62238976
What do you mean you can't get a hang of how things relate to each other?
>>
>>62239055
How do you know?
From what I read, R has superior packages.
>>
soon
https://livestream.com/oxuni/ICFP-2017
>>
>>62235965

what's wrong with that (beyond not including string.h)?

you are copying the terminating null character as well as the full string into the character array pointed to by oss_str_copy.

desu I have never passed << endl into a ostringstream.

With gcc 5.3.0 it compiles and executes fine after adding #include <string.h> and valgrind returns 0 errors from 0 contexts.

Like I said, I see no issues beyond the odd << endl and no #include <string.h>. I actually use this trick often (mostly in 'c' though).
>>
namespace BF
{
namespace Graphics
{
namespace Renderers
{
class BF_API Renderable
{
friend class SpriteRenderer;

private:
struct FrontToBack
{
bool operator() (const Renderable* renderableA, const Renderable* renderableB) const
{


is this the power of sepples?
>>
What's a good gui library for C?
I'm thinking GTK but wondering if someone knows of something else.
>>
>>62238889
C++ is a geat langualge once you master it btw.
>>
>>62239263
Now you can do this instead.
namespace BF::Graphics::Renderers
{

}
>>
>>62239289
C++ will always be an ugly and hacky language. It remains useful despite that.
>>
>>62235965
Why do you need to add 1 to size?
>>
>>62239285
> c
> gui
Literally why? Use python or java.
>>
>>62239323
Stop tempting a good and innocent programmer into your malevolent ways you programming devil.
>>
>>62239312

It would be a bug if you did not. The characters copied into the malloced region would probably not be terminated. (depends what random value would be sitting there).
>>
>>62239312
null terminator
>>
Umm..wtf
public class Circle implements Comparable {
private Double radius;

Circle(double radius) {
this.radius = radius;
}

int compareTo(Circle circle) {
return circle.radius.compareTo(this.radius);
}
}

Compiler

./Circle.java:1: error: Circle is not abstract and does not override abstract method compareTo(Object) in Comparable
public class Circle implements Comparable {
>>
>>62239312
strlen and others return the size without accounting for the \0 terminator.
>>
>>62239358
Implement
Comparable<Circle>
.
>>
>>62239358
It's telling you what the issue is, dummy.
>>
>>62239374
How do I do it?
>>
>>62239401
go learn generics moron
>>
>>62239401
implements Comparable<Circle>
>>
I started programming a week ago in java, can only do getter,setter and constructors.
can't do anything else,any tips
>>
>>62239417
Why do you need java?
>>
>>62239431
it's the language they are teaching me,but the teacher is trash so I want to learn on my own
>>
>>62239431
I can't see sharp.
>>
>>62239454
c# is worse than java
>>
>>62239415
hw $ javac Main.java 
./Circle.java:8: error: compareTo(Circle) in Circle cannot implement compareTo(T) in Comparable
int compareTo(Circle circle) {
^
attempting to assign weaker access privileges; was public
where T is a type-variable:
T extends Object declared in interface Comparable
>>
>>62239468
Make the method public.
>>
>>62239468
Read your fucking error messages anon.
>>
>>62239323
the fuck are you talking about?
>>
>>62235965
Use <cstring> instead of <string>
>>
>>62239452
Read effective java.
>>
>>62239460
No.
>>62239495
Why dont you use asm for gui?
>>
File: 1483889196976.jpg (30KB, 647x451px) Image search: [Google]
1483889196976.jpg
30KB, 647x451px
>>62239358
>>62239468
>>
I was watching this anti-oop propoganda video someone linked here and the guy said everyone already agreed that oop inheritance is bad

So pls tell me, why is inheritance bad
>>
>>62239417
what do you mean you can only do those? Can you not type
public void foo(){}
>>
>>62239537
Pretty sure you don't know what GUI even is.
>>
>>62239604
There's no reason why you can't do GUI programming in asm.
>>
>>62239670
not portable
>>
>>62239689
Most GUI programs aren't, even if written in an otherwise portable language.
>>
>>62239588
I mean i don't really understand anything else, even now I don't understand the setter function very well.
and if i try to code blindly I just get a bunch of red lines.
for example, I want the user to type 1 if he likes it and 2 if he doesn't, then show "he likes it" but instead it just shows "1" and things like that.
>>
>>62239563
Because it can cause undesired behaviors. Use composition.
>>
>>62239741
or even better just don't use oop at all
>>
>>62239563
You lose the ability to safely chanfe the parent class, or you get >>62239741
>>
Do structs with member functions count as OOP?
>>
>>62239708
post code snippets if you want help
>>
>>62239792
Do you touch yourself at night?
>>
>>62239704
That's just plain wrong.
>>
why would i use ruby over python?
seems like they scratch the same itch, only python has a larger ecosystem
>>
>>62239431
what should i learn instead
>>
>>62239792
yessir
I'd even consider structs with no member functions to be OOP if there exist functions in your code that take those structs as parameters
>>
>>62240026
>structs are OOP now
hilarious
>>
I'm making an installer with wix/windows installer and I've got it all working except for launching my program on exit with a checkbox, as outlined here: http://wixtoolset.org/documentation/manual/v3/howtos/ui_and_localization/run_program_after_install.html

It was working before and now I can't get it working with a minimal example, I'm not sure what I've fucked up

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*"
UpgradeCode="4359a129-08f0-4f75-a3f4-d70f6c6fe1b2"
Version="1.0.0.0"
Language="1033"
Name="My Application Name"
Manufacturer="My Manufacturer Name">
<Package InstallerVersion="300" Compressed="yes"/>
<Media Id="1" Cabinet="myapplication.cab" EmbedCab="yes" />

<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="APPLICATIONROOTDIRECTORY" Name="My Application Name"/>
</Directory>
</Directory>

<DirectoryRef Id="APPLICATIONROOTDIRECTORY">
<Component Id="myapplication.exe" Guid="*">
<File Id="myapplication.exe" Source="test.exe" KeyPath="yes" Checksum="yes"/>
</Component>
</DirectoryRef>

<Feature Id="MainApplication" Title="Main Application" Level="1">
<ComponentRef Id="myapplication.exe" />
</Feature>

<UI>
<UIRef Id="WixUI_Minimal" />
<Publish Dialog="ExitDialog"
Control="Finish"
Event="DoAction"
Value="LaunchApplication">WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed</Publish>
</UI>
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="Launch My Application Name" />

<Property Id="WixShellExecTarget" Value="[#test.exe]" />
<CustomAction Id="LaunchApplication"
BinaryKey="WixCA"
DllEntry="WixShellExec"
Impersonate="yes" />
</Product>
</Wix>
>>
>>62240001
Depends on what you want.
>>
>>62239708
psuedocode

int input = getNumber()
string[] msgs = ["likes", "doesn't like"]
string msg = msgs[input - 1] // arrays are 0 indexed
print(msg)
>>
>>62239909
Yes, Python has larger ecosystem (mathplotlib, numpy, simpy, django, etc., etc.).
Ruby is way comfier as a language though. If I wanted to write a small personal project, I'd always choose Ruby over Python. You're more likely to be hired to do Python, though. There still is all the Ruby web stuff (RoR, Sinatra, tons of gems to boot).
Just learn both, they're very similar.

>>62240001
Algorithms. It seems like you're approaching programming as if programming itself is the goal. It's not. Programming is a tool you use to accomplish other goals. Learning about algorithms will give you a clear example of an application of programming. What language you use while learning those doesn't matter at all (feel free to keep using Java, or jump ship to something simpler like Python, something useful like C, or something niche like Perl).
Once you have a good grasp of that stuff, you'll have a clearer idea of what you want to accomplish, and once you know what you want to accomplish, selecting a language is merely a project design decision.
>>
>>62237173
Bro that;s why you have to take notes, just write quick summaries down and later on you can review the notebook rather the whole book
>>
>go on trip for a month
>decide i could finally learn programming by reading a book in my free time
>download a python pdf on my phone
>pretty much memorize everything in it including exercises
>still can't test my skills until next week
What do lads? Should I read the book again?
>>
>>62235587
Trying to learn Haskell

Why is this valid:
[ 1, 2, 3] : [ [4, 5] ]

And this isn't?
[1, 2, 3] : [4, 5] 


The book I'm reading says "It would be illegal to evaluate the second one as this would try to create an inhomogeneous list with a list as a head and other elements integers."
If this is so, why does the first one work? Aren't you cons'ing a list of Ints with a list of a list of Ints?
>>
>>62239741
whats composition
>>
>>62240175
: prepends an item to a list

so 2 : [3] prepends 2 to the list 3

If you do [1, 2, 3] : [4, 5]

you are appending [1, 2, 3] to [4, 5], the item is [1, 2, 3]. This is not a valid item to append to a list, as it is already a list, it can only be appended to a list of lists

[1, 2, 3] ++ [4, 5] is valid, it concats two lists.

basically you need to prepend an a to an [a],
and an [a] to an [[a]]
>>
Does anyone want to work on a project with me, just for fun? It can be anything, I'm just tired of working alone and could benefit by working with someone else who can code.

I'm unemployed at the moment and I'm just trying to build up some skills. I have a CS/Math degree already and I'm not a brainlet, though not experienced with any technologies in particular.
>>
>>62240175
iirc, lists in haskell are just a tuple containing a value as the head, and another list of values of the same type.
for example, you can cons an int with a list of ints, but you can't cons two lists of ints.
cons'ing a list of ints with a list of a list of ints is, however, perfectly valid and will return
[ [1, 2, 3], [4, 5] ]
>>
>>62240267 (You)
>another list of values of the same type
*as the tail
>>
>>62238889
>Being a brainlet
>>
>>62240264
working with other people sucks just be a programming neet
>>
>>62240175
by consing it literally means adding 1 item to the front

in your first example, that 1 item happens to be a list, but it's still "one item" of the broader thing, which is a list OF lists

in the second example, you're trying to treat a list of ints as "one item" to be added in front of a list of ints
>>
>>62236972
Implements are like inheriting a pure virtual class
>>
>>62236829
>being this pedantic
>>
>>62240295
Eh, from my experiences in university, working with other people is tremendously fun, provided they're not fucking brainlet retards, and are actually interested.

Plus, it's fundamental to your career to be able to work well (and enjoy working) with others.
>>
>>62240506
reddit
>>
>>62240521
>reddit

>provided they're not fucking brainlet retards

Nice advice there bud.
>>
>>62240532
nice reddit spacing
>>
>>62236982
Read "JavaScript the good parts" instead

It's very short :^)
>>
File: sweating pepe.png (21KB, 112x112px) Image search: [Google]
sweating pepe.png
21KB, 112x112px
>>62240550
oh shit, forgot about that
>>
>>62237650
Those are monkey hands
>>
I'm growing stronger.
>>
>>62238153
We use the first one at work. pragma once seems nicer to me but I don't actually know anything about it.
>>
>>62240254
Holy shit that's an awesome explanation! Thanks, man!
>>
>>62240633
what's this
>>
LOVE LAIN!
>>
File: 1481426975764.png (1MB, 1520x1080px) Image search: [Google]
1481426975764.png
1MB, 1520x1080px
>>62240734
>>
>>62236989
Le SICP
>>
>>62240575
Seconding.
>>
>>62240264
Do you have any specific ideas?
>>
File: 1498330539715.gif (791KB, 500x553px) Image search: [Google]
1498330539715.gif
791KB, 500x553px
>his programming language allows IO
>>
>>62241096
Are you implying it's possible for a language to do useful work without IO?
>>
File: ranjeet.jpg (27KB, 300x470px) Image search: [Google]
ranjeet.jpg
27KB, 300x470px
>>62241096
>his programming language doesn't allow IO
>>
>>62241109
Are you implying the converse?
>>
>>62241109
Sorry, I'm not sure I understand what "useful" means in this context.
>>
>>62241134
Can you show me a program which can do useful work without IO?

>inb4 while loop to heat your room, that's still IO
>>
>>62240702
It's coursera's algorithms class, Sedgewick teaches. I'm really enjoying it so far. I took a class already last year in this material, but need to brush up.
>>
>>62241148
You could calculate the 1 trillionth prime in your program for all you like, it doesn't matter if you can't print it out
>>
>>62241150
What is an "useful work"?
>>
>>62241150
>that's still IO
You're too retarded to post here.
>>62241167
>it doesn't matter if you can't print it out
It matters to me though.
>>
>>62241167
>What do you mean by "useful"?
>>For example, calculating the trillionth prime
I don't see how that's useful
>>
changing the state is output therefore every program has IO
>>
>>62241269
A bit bigger than the trillionth, but certain prime numbers are useful

https://www.eff.org/awards/coop
>>
>>62241285
Not if the state is not observable.
>>
>>62241285
>changing the state
The state of what?
>>
>>62241312
idk but you sound smart if you say that word
>>
>>62239417
>can only do getter,setter and constructors
good job you can meme all over yourself with encapsulation and do things IDE tools can autogenerate for you
OOP was a mistake
>>
>>62241529
Why was OOP a mistake? Isnt java the greatest programming language?
>>
File: 1504480235927.jpg (14KB, 251x242px) Image search: [Google]
1504480235927.jpg
14KB, 251x242px
>>62241733
>>
>>62241757
dumb frogposter

>>62241733
dumb pajeet
>>
programming in java sounds like hell
is it true that you cant define functions outside classes and the entire program has to run inside a 'main' object
>>
>>62241811
>is it true that you cant define functions outside classes
yep. Look up "kingdom of nouns"

>and the entire program has to run inside a 'main' object
Every class can have its own main method and each can be an entry point for your program. Java is a nightmare.
>>
>>62241854
>Every class can have its own main method and each can be an entry point for your program

lmao
>>
>>62241869
>not allowing your program to choose where it enters
>>
>>62240575
It still has lots of shit however, I cringe with some of the fucked up shit, for example needing to create anonymous functions like an autist because there are no scopes, the lack of type definitions... psedo classes that behave like shit.... I could go on and on.

Typescript's better but just barely.
>>
is 4chan dead?
none of my threads have any new posts
>>
>>62242871
everything does seem slower or ded
something fishy is going on
>>
>>62236952
TheChernoProject on YouTube. Really like his stuff. High quality and each video goes in depth.
>>
File: fish.gif (3MB, 580x328px) Image search: [Google]
fish.gif
3MB, 580x328px
>>62242971
>>
>>62237453
Looks good anon. Keep it up.
>>
Trying to get a principal loan calculator working, and it's giving me off values for low-end inputs. It's in C++
>>
>>62241285
fp's gimmick is that they pretend they don't have state. and they often don't on a logical view but it's never like that in implementation since it's all assembly in the end
>>
>>62243278
the assembly in the end also doesn't have any objects or pointers
>>
I wrote a program that scans subreddits for giveaways a couple months ago

So far I've won Ashes of the Singularity, Pillars of Eternity, Offworld Trading Company, a Lawbreakers beta key, and NBA 2k17.
>>
>>62243346
You can't do anything useful in assembly without pointers. Without pointers you're limited to something like 6 ints worth of variables for your entire program.
>>
>>62243506
Pointers do not exist in assembly.
They are simply a use case of words or dwords or qwords.
>>
>>62243535
No, a pointer is just a series of bits used as a memory address. That's like saying you can write C without pointers by storing all pointers in long long unsigned ints and only casting them to pointers when they are dereferenced. That's the moment at which something is undeniably a pointer - when you dereference it. And you can't do anything useful in assembly without dereferencing something.
>>
>>62243561
I really hate people like you because you never have quite enough brains to actually apply the nonsense you spout.
>>
>>62243561
>>62243629

"Pointers" as a thing are as real in compiled code as purity is.
You can grab a byte at a certain address, indicated by an integer.
You can jump to a code section at a certain address, indicated by an integer.
You can floating-point-add two integers.

This utter nonsense that people spout when they cry about abstraction.
C is a high level language.
It is abstract.
>>
File: Power armor.jpg (167KB, 630x745px) Image search: [Google]
Power armor.jpg
167KB, 630x745px
I'm new to python
How can I launch a second python script from another one within the same Anaconda work space? Is it even possible? Everything that I've tired hasn't worked, including trying to directly start it with
os.system("activate tensorflow-gpu")
, where 'tensorflow-gpu' is the name of the work space. This caused the large lag of starting the work space while simultaneously not actually loading it.
pls hlep
>>
>>62235767
Onky typed lambda calculus
>>
Dear C fags, is there nullptr in pure C? Can I tell gcc to accept it somehow?
>>
>>62244103
NULL
>>
>>62238976
it's hard for everyone dummy, especially because they don't teach it in a sane manner like a science discipline

read books, draw shit on paper, think about it a lot and OOP will be your friend
>>
>>62244116
But C with nullptr compiles with gcc if I name the file .cpp :(
>>
>>62237156
>at that point it's over, problem is solved
You see, thats the difference between a mathematican and an engineer
>>
>>62244148

Because it's compiling as C++, dingus.

Fuck's sake, if you need to do things like C++...
#define nullptr NULL
>>
File: 1476622430748.jpg (24KB, 540x332px) Image search: [Google]
1476622430748.jpg
24KB, 540x332px
my brother will start his computer science studies in a couple of weeks. i looked at their courses and their introduction to programming is in C.

i'm in my final year of my master's and i want to help him get a bit of a headstart.
what C resources can you recommend for a complete beginner? (so maybe not TCPL by kernighan and ritchie).
or do you think it'd be smarter to give him a comfier introduction via JS or similar?

i don't think something like python would be smart because within 2 or 3 weeks he'd have to learn a completeley different looking syntax.
>>
How can I create a table from user given number?
int main() {
size_t n;
cin >> n;

int** table = new int*[n][n];
}


Says n should be constant.
>>
>>62244376
In C, this is just
size_t n;
scanf("%zu", &n);

int (*table)[n] = malloc(sizeof *table * n);

Dumb sepplesfags can't even into VLAs.
>>
>>62244427
That looks like pure cancer
>>
>>62244213
>Because it's compiling as C++, dingus.
but I didn't even use g++
>>
>>62244439
Enjoy your pointers to pointers, fuckboi.
>>
>>62244213
>#define nullptr NULL
And that will mess with real C++ compiling
>>
File: 1502163577215.jpg (88KB, 1280x720px) Image search: [Google]
1502163577215.jpg
88KB, 1280x720px
>>62244445
Look man, I'm just willing to expand my knowledge base here. I myself don't quite love C++. You aren't helping.
>>
turing(Tape0, Tape) :-
perform(q0, [], Ls, Tape0, Rs),
reverse(Ls, Ls1),
append(Ls1, Rs, Tape).

perform(qf, Ls, Ls, Rs, Rs) :- !.
perform(Q0, Ls0, Ls, Rs0, Rs) :-
symbol(Rs0, Sym, RsRest),
once(rule(Q0, Sym, Q1, NewSym, Action)),
action(Action, Ls0, Ls1, [NewSym|RsRest], Rs1),
perform(Q1, Ls1, Ls, Rs1, Rs).

symbol([], b, []).
symbol([Sym|Rs], Sym, Rs).

action(left, Ls0, Ls, Rs0, Rs) :- left(Ls0, Ls, Rs0, Rs).
action(stay, Ls, Ls, Rs, Rs).
action(right, Ls0, [Sym|Ls0], [Sym|Rs], Rs).

left([], [], Rs0, [b|Rs0]).
left([L|Ls], Ls, Rs, [L|Rs]).
>>
>>62244103
Nullptr is a C++ way to make sure it is a pointer and it is null.
In C, it is the programmers job to make sure it is a pointer, so you can just type 0 or NULL or even better, if(ptr) and then do your code.
>>
#ifndef __cplusplus
#define nullptr NULL
#endif


Work for you now?
>>
>>62235640
fuck you brainlet. OpenGL is godtier.
>>
>>62244642
This is terrible, do not do this. nullptr has a different meaning to null, and so treating them as the same is a bad idea.
>>
>>62244516
Is it , dare I ask Turing complete?
>>
>>62244661
You are a fucking idiot. DirectX is and always will be far superior.
>>
>>62244642
Yeah it works, is this part of the standard?
>#ifndef __cplusplus
>>
>>62244661
teach me I'll pay you by the hour

I just want a real person to talk to about it and mentor me, not some book or online tutorial ;-;
>>
>>62244798
online video tutorials are literally
"a real person mentoring" you
>>
>>62244822
You can't ask questions in real time, have them evaluate your own work, you're limited to learning what the person has already released in videos, I just really like the prospect of being able to sit down with someone and have that collaborative element to it
>>
>>62244859
if you have questions you can post on forums, reddit, whatever
>>
I'm thinking for porting a winamp input plugin to foobar2k for my next project. Is there any good information on writing plugins or is it just a case of looking at others/sample code?
>>
>>62235965
Jesus christ this is inefficient and fucking stupid.
You are creating and destroying 3 redundant copies of the stream content as a string, and are copying it into a C string for some stupid fucking reason.
And you forgot to include string.h, it works fine on my machine (linux x64).
Please program in a more retard-friendly language like Python, or just kill yourself, please.
>>
File: 1485812549165.jpg (43KB, 480x451px) Image search: [Google]
1485812549165.jpg
43KB, 480x451px
>>62244707
It would be if Microsoft didn't have their grubby mits all over it.
>>
>>62244679
> and so treating them as the same is a bad idea.
C is a bad idea, so who cares until you're in it
>>
>>62244859
You say that, until you have to interact with a real person. When it comes to learning how to use an API, reading is (almost) always superior.
>>
>>62238084
Java """generics""" are fake.
>>
>>62244679

In C++, nullptr was invented to play nice with the type system. In theory, it could equal an address other than 0 if there were a better address to use as the null pointer, but in practice, this is NEVER the case. In C, the type system doesn't care about anything for the most part, especially when pointers are concerned, so NULL is just defined to 0 and everything plays fine. Anon wanted nullptr in C. Since there is no point in copying nullptr's type system semantics in C (because C does not care), the only thing relevant about it is that it IS the null pointer, and we know on all C platforms, the null pointer MUST be 0, because that is what NULL is.

>>62244739

I am fairly sure this is the case
https://sourceforge.net/p/predef/wiki/Standards/
>>
File: Capture.png (35KB, 634x274px) Image search: [Google]
Capture.png
35KB, 634x274px
>>62244859
>needing spoonfeeding
are you sure this is for you
>>
File: 1300044776986.jpg (34KB, 600x600px) Image search: [Google]
1300044776986.jpg
34KB, 600x600px
>>62244982
this.
>>
I keep hearing people say government jobs are super easy to get into.

For someone with a CS degree how do I get into that? I've been googling and I only find military sounding jobs and I don't think that's what I want?
>>
>>62244986
Clearly Blow hasnt touched vulkan :/
>>
>>62245034
Either public service or military.

You should join the military though. Good experience and everyone watches anime.
>>
>>62245055
Good on him, because it's rubbish.
>>
>IOless programming languages
This is probably the most useless thing I've heard of since Haskell.
>>
Beginner programmer here.

I'm using Python to fetch and filter JSON API data. What is the best way to display and organize the data? Maybe in a web browser?

I know you can do it using Excel or Google Sheets, but I would like to avoid that.

(Also posted this in SQT)
>>
>>62245066
Id be willing to join the military as long as I can just sit in a chair. Im 23 and honestly I feel like my life has gone off track after getting my degree. Ive been doing full stack for 6 months and want to kill myself everyday. I need a job where I can just do the 9-5 and I don't have to think about it at home. I need just a normal job that doesn't require me to be "on call"

I found this site

https://www.usajobs.gov/

And there are a lot of civilian cs jobs which I'd be willing to go for, so maybe I can get one and relocate somewhere
>>
File: JVdLO.png (39KB, 853x430px) Image search: [Google]
JVdLO.png
39KB, 853x430px
>>62245143
Don't overcomplicate things and try the "tabulate" module first
>>
File: 1485969558293.jpg (13KB, 270x259px) Image search: [Google]
1485969558293.jpg
13KB, 270x259px
>>62236159
very cool anon
>>
>>62245177
That looks good. Can I sort by columns?

I feel like I'm going to have to make a GUI or use something Flask.

Both of which will be a real challenge for me.
>>
>>62245089
Why?
>>
>>62244221
>i'm in my final year of my master's and i want to help him get a bit of a headstart.
>what C resources can you recommend for a complete beginner?
uh
you, dude
you are currently the absolute best C resource because you both have experience AND have recent experience being taught it by a professional. This gives you the ability of a tutor and the insight of a student
just teach him yourself
>>
>>62245259
>Can I sort by columns?
Tabulate displays lists in order, but you can of course sort your list any way oyu want
>>
someone create new thread
>>
>>62245456
not at bump limit yet
>>
New thread: >>62245493
>>
Real new thread when?
>>
Real new thread:
>>62245640
>>62245640
>>62245640
Thread posts: 313
Thread images: 38


[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.