[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: 353
Thread images: 37

File: hacka doll #3.png (481KB, 1280x720px) Image search: [Google]
hacka doll #3.png
481KB, 1280x720px
old thread: >>60289330

What are you working on, /g/?
>>
>>60299147
>puts /dpt/ in the OP thread
what kind of fly-by-night show are you running here OP
>>
Ocaml or Lisp?
>>
>>60299147
Fuck you for using an anime image
>>
>>60299231
This. Anime loserspergs are the cancer killing /g/
>>
>>60299231
>>60299245
>reeeeeee anime
lmao
>>
>>60299293
newfag
>>
File: me_irl31.png (561KB, 1101x573px) Image search: [Google]
me_irl31.png
561KB, 1101x573px
>>60299147
I want no.3 to fuck me in my ass
>>
>>60299339
t. newfag
>>
>>60299387
t. new friend
>>
Depth-first traversals of trees come in 3 main varieties: pre, in and post orders.

Depth-first searches of graphs come in 3 main varieties: pre, post, and reverse-post order.

What order does the typical textbook recursive Depth First Graph Search process its nodes in?
  procedure DFS(G,v):
label v as discovered
for all edges from v to w in G.adjacentEdges(v) do
if vertex w is not labeled as discovered then
recursively call DFS(G,w)
>>
>>60299147
In C, is it possible to have an unnamed (or anonymous, as gcc tells me) struct with external linkage? The header would look like:

extern struct {
int number;
} anon;


How would the source code look like, or is it impossible?
>>
>>60298589
you're indian, aren't you
>>
File: 1346271892434.jpg (108KB, 500x500px) Image search: [Google]
1346271892434.jpg
108KB, 500x500px
>>60299231
How could you possibly live without anime?
>>
>end of the semester
>projects due
>in one class my team is a bunch of idiots so I wrote the entire project and they didnt help so im not gonna put their names on it (like zero contact about the project)
>other class is that "I work all weekend and didnt work on it at all, but i did the easy ass manual for the program, thanks for doing the project (all the hard work) so I dont fail"

Worst part is that I know this fuckers will probably land better jobs than me because they are more social etc
>>
>>60299724
>he thinks college is all about good grades
HAHAHAHAHAHAHAHAHAHA
>>
>>60299755
yeah, they dont let you graduate with failing grades
>>
WTF am I reading?
>>
>>60299766
They're only getting a good grade because you did all the hard work for them.
The trick is to get the most autistic fucker to do your work in any group project, much like in real life.
>>
>>60299785
What am i supposed to do? I cant just fail my classes because I didnt feel like doing the work. Theres a black guy who I got grouped with 2 times now who has done literally nothing in both times.

This shit pisses me off
>>
>>60299829
Be more social, fucker.
>>
What's a good modern alternative to Bash scripts?
>>
>>60299218
Lisp
>>
>>60299876
Bash scripts
>>
>>60299773
>>>/trash/
>>
File: google.ie.jpg (7KB, 275x183px) Image search: [Google]
google.ie.jpg
7KB, 275x183px
Saw some ad shilling this on goybook

Anyone know if it's good?
>>
>>60299840
How does that change anything? I dont wanna fucking depend on people to do my project
>>
>>60299885
But it sucks because it's too old.
>>
>>60299918
>XKCD comic in the first fucking page

dropped
>>
>>60299147

is the dude who made juicebox still on here? I was gonna show my buddy your page, i liked the layout. looks like its down now.
>>
>>60300000
>>
File: help.png (88KB, 1201x701px) Image search: [Google]
help.png
88KB, 1201x701px
Freshman here, working on a project to zoom in on the mandelbrot set.
It works pretty well until you zoom in to the order of around 2.0E-14 and lower, then pic related happens.

I'm kinda new so I was wondering if it this exceeds the decimal precision of double types or am I doing something wrong.

can link code if needed
>>
>>60299724
Dude, are you studying in Sweden?
>>
>>60300197
Funny

But seriously, what the fuck am i supposed to do? Do i bitch at people and in turn look like a bitch? Tell the teacher and look like a bitch?
>>
>>60300197
>>60300274
Its like "wooo" i did 2.5% of the project, now i get to inherent your grade

im so mad
>>
>>60300160
Double epsilon is 1e-16, so 1e-14 is already stretching it.
I don't exactly see the problem. Is it because it's grey? Maybe increase iteration number.
>>
>>60299724
That'll be a lesson for you. You have to divide the responsibilities between each member and have regular (I repeat, regular) meetings om the project. It is important to keep contact with people. Do not micromanage them, but keep an eye on people who you don't exactly trust.
>>
>>60300416
But what I dont understand is why dont these people worry about the project as much as i do
>>
>>60300323
>be me
>game project with 2 classmates
>one makes art
>me and other guy programming
>project is in written in python using pyglet
>total noob at python
>i write the menus and something else for the game
>friend makes game logic
>the menus are a cluster fuck, but it just works(tm)
>friend is also having problems, we work long days
>we literally program the last few days in panic to get the shit to work
>game barely works, memory leak in the fog of war causes it to crash after 10 minutes
>my menu code is fucking shit something like 500 lines of code
>i wrote it again with half the code after the project but it was still shit

I kind of feel bad about the project now.
But i feel like i put work in to it.

The code... was so bad...

Got a good grade though.
>>
>>60300443
Because they know people like you are going to fast track them into a cushy low effort job where they'll continue to make autists like you do all the work and soon they'll reach middle management and then you'll never touch them.
>>
>>60300443
Maybe you said "D-don't worry, I'll do everything" in the beginning since you obviously didn't want to depend on them. Maybe they are just lazy fucks. Maybe they just forgot. Who knows. How often did you talk with them?
>>
>>60300274
Unless there's some kind of tight-knit "bro code" in your classes that can fuck you up socially for the rest of your time in Uni, fuck yeah you should rat them out for being worthless.

I'd rather call you a bitch for not standing up for yourself.

Bitch.
>>
>>60300500
I definitely didnt say I would do everything. We have a slack where we can communicate freely. Im not really even the 'group leader'. Me and him wrote a lot of the code, and then i finished the code myself. The black guy showed up as soon as we had to leave so he didnt help at all.

Every class its like "Well I work no matter what when ever you guys meet no matter the time but Ill do some rather insignificant part of the project so i get to put my name on it."

At least in one of my other classes you get to rate your teammates on the effort they put into the project
>>
File: Untitled.png (78KB, 794x426px) Image search: [Google]
Untitled.png
78KB, 794x426px
Is a nested still a nested loop if you have an outer for loop and an inner while loop?
Or do you need two for loops for it to be called nested loop.
>>
>>60299422
this is going to depend on how the edges in the call to `adjacentEdges(v)` are ordered.
>>
>>60300632
we are men of class here at /dpt/

they are called for statements
>>
Trying to learn Java, is there any software I can download that will allow me to code in Java on Windows 7?
>>
>>60300724
GNU Emacs.
>>
>>60300724
Netbeans or Eclipse.
>>
>>60300724
note pad
>>
>>60300160
share it
>>
>>60300724
Eclipse
>>
>>60298170
pretty late in replying but this might be informative
http://www.cprogramming.com/tutorial/floating_point/understanding_floating_point_representation.html

there's a lot of places where he doesn't really spell it out for you, but the info is there.
>>
A look at how gcc names overloaded GNAT/Ada functions

The functions specs
package Naming_Test is
type Smaller is new Integer range -4 .. 23;

function Add (X, Y : in Integer) return Integer;

function Sub (X, Y : in Integer) return Integer;
function Sub (X, Y : in Smaller) return Integer;

function Mult (X, Y : in Integer) return Integer;
function Mult (X, Y, Z : in Integer) return Integer;

function Div (X, Y : in Integer) return Integer;
function Div (X : in Integer; Y : in Smaller) return Integer;

procedure Plain;

procedure Check;
procedure Check (X : in Integer);

end Naming_Test;
>>
>>60299147
Daily reminder that JVM's that run by JITing Java bytecode to LLVM are becoming the norm: https://www.infoq.com/news/2017/05/azul-falcon
>>
>>60301256
According to the assebly output we get
naming_test__add:
naming_test__sub:
naming_test__sub__2:
naming_test__mult:
naming_test__mult__2:
naming_test__div:
naming_test__div__2:
naming_test__plain:
naming_test__check:
naming_test__check__2:


Very clean and simple, just a basic enumeration.
>>
>>60301284
I don't know why I had to split that into two parts, but 4chan was very unhappy with it.
>>
File: oop.png (191KB, 680x1483px) Image search: [Google]
oop.png
191KB, 680x1483px
>>
>>60299147
Is there a non-deepcopy version of strcpy() for C?
>>
>>60301468
Your question makes no sense.
>>
>>60301479
Yeah maybe I'm understanding my problem poorly. I have a string that's apart of a structure that I allocate memory for and when I try to make a copy of that string into another string then free the memory in that copy string the original string gets freed too.
>>
So I'm trying to think if this has a name, or if it's even possible to solve.

I'm trying to model N games of telephone in parallel.

Let's say you have N people in a circle and N starting words. Is there a way pass messages so that everyone will hear each word, and no one will hear from the same person twice? Or is this some group theory provably wrong?


>>60301468
>>60301514

Make sure the pointers aren't the same right before you strcopy? that's the only thing I could think of.
>>
>>60301256
>>60301284
Why does g++ do weird shit to it's overloaded functions?
>>
>>60301514
How to copy a string properly in C (malloc error checking omitted):
char *orig = "abcdefg";
char *new = malloc(strlen(orig) + 1);
strcpy(new, orig);

Shorter POSIX version:
char *orig = "abcdefg";
char *new = strdup(orig);


Just copying a char * isn't going to "duplicate" a string.
>>
>>60301626
>>60301578
I'm doing all this.
>>
if, I'm using a gridlayout in Swing(Java), how would I go about making it change a tiles colour every time its right-clicked?

I get here and then I'm not sure what to do afterwards.

    public void mouseReleased(MouseEvent arg0) {
if(SwingUtilities.isRightMouseButton(arg0)){
//code
}
}


Any help is appreciated.
>>
>>60301596
Gnat is benefiting from the tighter restrictions for identifiers in Ada. For example double underscore is not allowed. C++ doesn't have this luxury.
>>
How do you do text manipulation like this? Either in C or Bash?

https://www.youtube.com/watch?v=pLaJliu2_pI
>>
File: mandelbrot code.png (27KB, 905x715px) Image search: [Google]
mandelbrot code.png
27KB, 905x715px
>>60300160
>>60300379
>>60300791
new to this board, not sure how to add code like everyone else is doing
>>
>>60301874
how about you read the sticked post in this board?

last sentence:

>>51971506
>>
>>60301673
search in google

"change a tiles colour every time its right-clicked java swing"
>>
>>60301673
jButton1.setBackground(Color.Red);
>>
File: wut.jpg (18KB, 300x300px) Image search: [Google]
wut.jpg
18KB, 300x300px
>>60301874
function fractal {
local lines columns colour a b p q i pnew
((columns=COLUMNS-1, lines=LINES-1, colour=0))
for ((b=-1.5; b<=1.5; b+=3.0/lines)) do
for ((a=-2.0; a<=1; a+=3.0/columns)) do
for ((p=0.0, q=0.0, i=0; p*p+q*q < 4 && i < 32; i++)) do
((pnew=p*p-q*q+a, q=2*p*q+b, p=pnew))
done
((colour=(i/4)%8))
echo -n "\\e[4${colour}m "
done
echo
done
}
>>
Only 36% of software engineers in India can write compilable code based on measurements by an automated tool that is used across the world, the Indian skills assessment company Aspiring Minds says in a report. The report is based on a sample of 36,800 from more than 500 colleges across India. Aspiring Minds said it used the automated tool Automata which is a 60-minute test taken in a compiler integrated environment and rates candidates on programming ability, programming practices, run-time complexity and test case coverage. It uses advanced artificial intelligence technology to automatically grade programming skills. "We find that out of the two problems given per candidate, only 14% engineers are able to write compilable codes for both and only 22% write compilable code for exactly one problem," the study said. It further found that of the test subjects only 14.67% were employable by an IT services company. When it came to writing fully functional code using the best practices for efficiency and writing, only 2.21% of the engineers studied made the grade.

The only remaining question is, why doesn't /dpt/ makes six figures?
>>
File: new avatar.jpg (8KB, 326x245px) Image search: [Google]
new avatar.jpg
8KB, 326x245px
>>60302008
>The only remaining question is, why doesn't /dpt/ makes six figures?
but I do?
>>
>>60301981
I assume you are critisizing me becuase my code is inefficient and messy, but I have also said that I am new.
>>
>>60302008
what are the best coding practices?
>>
>>60301626
>>60301578
I figured it out. I wasn't allocating for the string directly. I was allocating the pointer in the structure for it.

Instead of this:
string = malloc;
structure->str = string;


I was doing:
string = otherstring;
structure->str = malloc;
structure->str = string;


Thanks for trying though guys.
>>
>>60299245
N E W F A G
>>
>>60302124
no not at all, I was showing an example that was written for zsh hoping somebody would take the bait on it.

your code seems simple and clean to me
>>
File: is it odd or even.png (88KB, 890x670px) Image search: [Google]
is it odd or even.png
88KB, 890x670px
>>
>>60301874
// 
code goes here
>>
>>60302443
really, moot?
>>
>>60299218
Ocaml because it's actually used and not dead.
>>
Why use a language without a garbage collector?
>>
>>60302579
More efficient usage of data.
>>
>>60302008
Curious what the problem is if people can't even compile code for it.
>>
>>60299918
It contains cancerous puns and typography fucking emojis, but overall decent.
>>
Alright, since I guess this is a better place to ask this than /sqt/, here's a dumbass programming question:

Let's say I have this C code:
#include <stdio.h>

int main(int argc, char * argv[]) {
while (argc-- > 0) {
printf("%s == ", *argv);
char c;
while (c = *(argv[0]++))
printf("%c", c);
printf("\n");
}
return 0;
}

And here is the output:
./a.out == ./a.out
-xyz == -xyz
-xvf == -xvf


How is
argv[0]
, and by extension *argv, pointing to the first item in the next array despite the fact that it is not iterated past the terminating
'\0'
?
>>
File: 1451760043715.png (274KB, 3000x3000px) Image search: [Google]
1451760043715.png
274KB, 3000x3000px
>>60300451
> The code... was so bad...
...
> Got a good grade though.

pic related
>>
File: movieratings.jpg (110KB, 638x403px) Image search: [Google]
movieratings.jpg
110KB, 638x403px
What kind of RegEx voodoo do i need to make this work?
>A number followed by a semicolon represents a rating
>2 semicolons in a row followed by another semicolon is a null rate (did not rate)
How do I delimit so i only add number or null ratings to a 2Darray (pic related)
>>
>>60299245

>Posts on a Japanese emulated website >Complains about anime

The cognitive dissonance never gets old
>>
>>60302935
>one anime board makes the entire website anime based
go away /a/utist
>>
>>60302907
Make a counter, then clear it when it hits a number like before you add it to the list, ex:
(list here) 
int semicnt = 0;
for (int i = 0; i < ratingsthing.length; i++) {
if (ratingsthing[i] is a number) {
if (semicnt > 1) list.add(null);
list.add(number);
semicnt = 0;
}
}
>>
>>60302907
How would you expect to be able to parse the 'null' ratings? How could you parse it when there are extra random semicolons? (The garbage you point to)

Are you sure it isn't just a bunch of ratings delimited by semicolons? (So it might read: 5, 4, null, null, 4...)
>>
>>60302957
Woops also outside the first if statement make an else and do semicnt++
>>
>>60302806
It doesn't, not for me at least
// ./a -asd -dsa 
// outputs
./a == ./a
==
==
>>
>>60302986
go to the front page and count the anime boards vs the other boards
>>
>yes hello, im a redditor that goes into places he doesnt like then complains that he doesnt like it there
>>
>>60303023
Ive been here longer than I care to admit
>>
>yes hello, me again, i choose to stay in groups clearly not meant for me because im a masochistic beta who just wants to make everything as shit as how i feel
>>
File: bogo.png (386KB, 1438x904px) Image search: [Google]
bogo.png
386KB, 1438x904px
>>60303047
>>
>>60302907
You got a test file? Seems to work fine with grep RegEx matching.
>grep -Eo '(;;;|[0-9];)' testFile
>>
A website like super Mario maker (concept is) but in html5
>>
>>60303223
working on c&d i see
>>
My manager suggested restarting our web server every minute today.

Should I start looking for a new job?
>>
>>60302935
>The cognitive dissonance never gets old
You sure you know what that means m8?
>>
>>60303286
You should have started looking on the following lunch break.
>>
>>60303254
No it's not going to us easy assets from Nintendo, ofcourse!
>>
How do I break the news to my boss that the project I've been asked to take over has fundamental design and architectural flaws and will never be fast?
>>
File: dlang_chan.jpg (139KB, 470x545px) Image search: [Google]
dlang_chan.jpg
139KB, 470x545px
Threadly reminder that dlang-chan is not dead; she's going to have her GC tumor removed (eventually); and she's super duper cute and easy to prototype in! Say something nice about her, /dpt/!
>>
>>60301874
Lurk more and read the sticky, you retard.
>>
>>60303506
You might as well write that news into your resignation letter.
>>
>>60303506
whats the project
>>
>>60299147
Anyone know of a way to get pic related to not immediately solve?
I need it to remain as a type variable (they're both referenced later, but it never returns to this point during backtracking....). I guess it's due to the fact that im using library(assoc), but i dont know how to approach this specific issue concisely without it (would be 100s of LoC without).
basically, i want it to redo at that point because it eventually fails because of the conclusion reached here, but im not sure how to force prolog to restart that. any ideas?
here's the desired result:
?- compatible(sendMsg(W, [hi-(int, eps)]), recvMsg([hi-(int, eps)])).
true . % Already works
?- compatible(sendMsg(W, [hi-(int, eps)]), N).
false . % I want to solve for N from the first query
>>
>hurr durr Go/Rust/whatever is shit, C++ is better
https://www.zerotier.com/blog/2017-05-05-theleak.shtml
https://news.ycombinator.com/item?id=14275805

I myself have seen how people found (and reported) mem leaks in standard C++ libs (in this case, for windows)

C++ sucks.
>>
How would you fags functionally find the longest line in a string delimited with "\n"?
Key word is "functionally."
Doing this imperatively is cake...
>>
>>60303916
inb4 haskellfags reply with
longest_line = foldl1 (\x y -> length x `compare` length y) . lines

you see, lines is the main part of what I want, but my lang don't have it.
>>
>>60303047
.t worthless anime poster
All you faggots do is spam fizzbuzz and talk about meme languages.

Neck yourself.
>>
>>60300274
You are a bitch if you don't do it, and you are a bitch if you do it. So you might as well be a bitch that did something.
>>
>>60303958
*
longest_line = last . sortBy (\x y -> length x `compare` length y) . lines
>>
>>60303958
lines is easy to implement in Haskell because
String = [Char]

lines s =  let (l, s') = break (== '\n') s
in l : case s' of
[] -> []
(_:s'') -> lines s''
>>
>>60303916
sure let me just do your homework
>>
>>60304124
Can you do my hw in Common Lisp?
>>
File: heh43.png (204KB, 534x366px) Image search: [Google]
heh43.png
204KB, 534x366px
Which one of you is this?

>>60303803
>>
File: Windows_IS_Self_Aware.png (89KB, 1548x830px) Image search: [Google]
Windows_IS_Self_Aware.png
89KB, 1548x830px
>tfw visual studio analyzes itself and tells me not to use its own tool because its slow on startup.

Soon Visual Studio will be self aware enough to kill itself.
>>
Anyone else here crack RSA by hand?
>>
>>60303958
use recursion to implement lines
>>
>>60303764
I think I need to avoid the library after all. On another note, not having lambdas is extremely painful and i want to gouge my eyes out
>>
I'm relatively new to java and to programming and while I think I have a solid grasp on the basics I have a hard time figuring out which is the "correct" way to structure a project.
For example, I'm making a game to practice. It has a main class, which holds an inputlistener instance, a level instance (with tiles instances), and a ui instance. When an input event happens, the inputlistener calls the level, which calls the corresponding tile to handle the event. But the tile should then call the ui to display the correct response, which implies that each tile should hold the instance of the ui (or of the main class), which feels inefficient/wrong to me. Is there a more correct way to do it? It seems like in a sufficiently complex project in which all classes are interdependent, I end up with everything holding instances of everything else. Doesn't that defeat the purpose of OOP?
>>
>>60304328
VS Cede, lad
>>
Why did CL or Scheme never become more popular?
>>
>>60304754
Because it's gay lol.
>>
File: 1475349360183.jpg (666KB, 1556x1101px) Image search: [Google]
1475349360183.jpg
666KB, 1556x1101px
>>60304717
OOP is impossible to do purely. What I mean by that is that in the real world you get these artificial classes with names that include "manager," "factory," "system," etc. Then you'll get unnatural and weird relations between your classes like you've mentioned. Thus, as you've said, encapsulation of state (The main reason OOP was invented.) gets subverted.
>>
>>60304754
(((((((((((((((((((((((((((((((((((()))))))))))))))))))))))))))))))
>>
>>60304787
So? The languages that became popular have {{{{{{}}}}}} instead.
>>
Any SQL'ers here? How do I count the results from this query? I can't figure out where to put the COUNT statement.

(SQLite)
SELECT m.*
FROM TagMap tm, MediaEntries m
WHERE tm.TagId IN (1, 2, 3)
AND m.Id = tm.MediaEntryId
GROUP BY m.Id HAVING COUNT(m.Id) >= ?


I figured just using SELECT COUNT(m.*) ... would work but it doesn't. I do not want to actually return the results and count it in code, because it'll potentially be 1000's of items and I don't want to allocate memory for that.
>>
>>60304779
So the structure as I described it is fine?
>>
>>60304717
>which implies that each tile should hold the instance of the ui (or of the main class)
why would that imply that? just have 1 ui instance
>>
>>60304829
>But the tile should then call the ui to display the correct response, which implies that each tile should hold the instance of the ui (or of the main class)
You could just pass a reference to the UI instance to the tile's method that deals with updating it.
>>
>>60304883
was bemused the anime poster chose that post in particular to use as an example of why oop is shit
>>
>>60304896
That was me actually. I reread his post and feel stupid now. Still, OOP is flawed.
>>
>>60304818
Something like this?
SELECT COUNT(*)
FROM
(
SELECT m.*
FROM TagMap tm, MediaEntries m
WHERE tm.TagId IN (1, 2, 3)
AND m.Id = tm.MediaEntryId
GROUP BY m.Id HAVING COUNT(m.Id) >= ?
) t1
>>
File: 1477349339216.jpg (31KB, 638x540px) Image search: [Google]
1477349339216.jpg
31KB, 638x540px
>>60304915
>>
File: 1453488422994.png (114KB, 753x479px) Image search: [Google]
1453488422994.png
114KB, 753x479px
>>60304930
It has its uses (e.g. GUI programming), but overall I'd avoid it.
>>
>>60304883
Yeah, will probably do that. The problem I see is that handling the input may require interacting with other classes depending on the state of the tile, which would imply passing an instance of each to the method preemptively. Then again, this would also happen if the tiles just hold the instances. Maybe I should pass an instance of the main class through the method and make the instances the main class holds public.
>>
>>60304970
just make everything public and have global variables. it's OOP
>>
File: 10274298.jpg (61KB, 374x384px) Image search: [Google]
10274298.jpg
61KB, 374x384px
>>60304927
Thanks man.
>>
>>60304970
Open up something like LibreOffice Draw and starting charting out the relations between your classes and modules; that will help big time. Also there are techniques you can use to minimize this kind of shit. I'm at a loss of what it's called though.
>>
>>60305081
Will do. If you remember the techniques please tell. Thanks for the help.
>>
>>60304328
visual studio 2017 is sweet. 2015 was too buggy
>>
>>60300632
Nested loops can be done with any kind of iterating construct.
>>
Is functional programming useful to learn? What can I do with it?
>>
>>60305366
It teaches you the truth of immutable state and pure functions.
Then youll realize how backwards imperative programming really is.
Just dont fall for the haskell meme of abusing holes.
>>
>>60305422
Haskell is as pure as you can get.
Good luck calling yourself an fp programmer and not knowing haskell.
>>
>>60305544
>Haskell is as pure as you can get.
>Haskell
>pure
Yeah, pure shit maybe.
>>
>>60305561
>hey mom, if I type something sarcastically with meme arrows, it will be true
>>
>>60305602
If your FP language doesnt have dependent types, its a non-language. Also Haskell is already fragmenting.
>>
>>60301846
Any info? I will read on stuff if I know if there's a library, I can't find anything.
>>
>professor teaches us to write C code that leaks all its memory
>if you fix it he marks you down for not following directions
send help i'm dying
>>
>>60305950
Follow the directions. The course isn't about the C language.
>>
>>60305950
Why not just give you already leaky src files to fix.
God im so glad i didnt fal for the CS or """"higher learning"""" meme
>>
>>60305950
doubt it
>>
Novice here, who else is spending their time making extremely useful things like this?
>>
>>60306054
What?? You were learning an entire field before? Noice try kid.
>>
>>60306116
Those octagons look like they're having seizures. Are they alright, anon?
>>
>>60299147
memes
http://ideone.com/643jI1
>>
>>60306126
lulz I dont know everything dude im a noob for sure :p
>>
>>60305950
So your professor is telling you to write code that doesn't free memory?
>>
>>60305950
C++ doesn't have this problem
>>
>>60299147
CUTE
>>
>>60306141
They just came into existence a few minutes ago, give them some time to get adjusted.
>>
>>60305422
thanks, any other recommendations for a starting language then?
>>
why are launch params only one character instead of a word most of the time? Why not write it out like xxx -force -limit instead of xxx -f -l?
>>
>>60306257
Pascal
>>
function largest(A:int, B:int):int { return ( (A>B) ? A : B ); }
trace(largest(2, 5)); // 5
trace(largest(7, 5)); // 7
trace(largest(9, 9)); // 9
>>
>>60306260
Are you baiting? This is one of the dumbest posts I've read today.
>>
>>60299365
sauce
>>
>>60299766
They should. Grades are a joke. Idiotic tests and exams prove absolutely nothing about people's ability to competently perform a task. It's a simple game you play with your professor where you figure out what he wants to hear and write out exactly that, and get a 100% grade for your effort. It's some kind of bulimic learning process where you cram a shit ton of useless factoids into your head before an exam, vomit it all out on the test and then feel good about yourself after you forget everything. Grades aren't really about smarts or competency. They're about effort and time investment. Turns out you can get really good at playing stupid ass games with people if you do it for long enough.

Who cares what actual grades you get? Nobody's ever asked me. Just get your stupid degree so you can put it on your CV and win at yet another stupid game you'll be playing with the recruiters of whatever company you want to work for. These stupid people think degrees are evidence of competence. Give them what they want, get the job and lose exactly zero sleep over that fact.

Are you enthusiastic about programming? You're already above most code monkeys who are in it for the money and don't give a fuck about anything. Don't waste that quality in a soul-sucking classroom playing stupid grade games with some clenched-ass academic who writes absolutely useless papers for tenure. Study by yourself and learn things either because you were curious or actually had to learn them in order to accomplish some actual task. Pick an annoying problem you have, no matter how small, and start a project on GitHub that solves it or automates it away. Fucking finish those projects. Find something to contribute to other people's projects that are useful to you. When people ask for proof of your own competence, show them those projects. Much better than a shitty piece of paper.
>>
>>60304281
which anime is that?
>>
>>60307187
thats no anime
>>
>>60307254
which manga is that
pls post sauce
>>
how come realloc doesn't need a pointer to a pointer
>>
>>60307314
Because you get a new pointer instead, anon. Read the documentation.
>>
GODDAMMIT
why does fucking Pajeet have a monopoly on technical explanations on youtube? doesn't matter what topic - networking, database, algorithms, C programming, Java, etc... 9/10 results on youtube are Indians that one can barely understand
>>
>>60307347
Make a better channel than them.
>>
>>60307314
Is it trolling?
>>
I need to auth/secure an HTTP request but I'm really shit at it. Asked this in /wdg/ but got no answer. I came up with a 'basic scheme' which works, but I have no idea about how secure it is.
Assuming Alice and Bob share a secret, symmetric key (which Bob can find by Alice's name), my request is:
{
"origin": "Alice",
"iv": 123412341234,
"payload": "AES256(iv, key, payload)"
}


And payload:
{
"name": "Alice",
"time": 1494408931,
"rand": 1963473576417636,
"data": "Attack at dawn"
}


The server finds the key by the origin name, decrypts the request and checks that
1) origin == name
2) time is at most n seconds ago (against replay attack)

Can I use this to pass around (occasionally sensitive) log data over HTTPS?
The shared AES key does not change. I looked into basic/digest auth/JWT, but the RFC's don't say much about encryption: I don't want my request bodies to end up in plaintext at another server.
I don't really care if the origin names are exposed, they will probably be domain names.
Is there any term for this that I could search for? "HTTP auth" doesn't get me really far.
Any secure, standard method that achieves the same thing?
>>
>>60307347
Because serious people write books or blog posts.
>>
I've got the instances

data Card = Card {
_suit :: Suit,
_value :: Value
} deriving Show

data Suit = Heart | Spade | Club | Diamond deriving Show

data Value = Two | Three | Four | Five | Six | Seven | Eight | Nine | Ten |
Jack | Queen | King | Ace deriving Show


Is there a quick way to make a deck of cards, rather than just manually typing out all 52 cards?
>>
Question: How does Java compare with C# for GUI's nowadays?
>>
>>60307561
> time is at most n seconds ago (against replay attack)
How this prevents replay attack during the time window? Use unique incrementing id for each request instead. Other than that it looks good enough, but I'm not an expert.
>>
>>60307664
Thanks, you're right there should be a request counter
>>
>>60307641
_suit
_card
Absolutely disgusting
>>
>>60307641
Add deriving (Bounded) and use something like
let deck = [ Card { _suit: suit, _value: value} | suit  <- [minBound :: Suit .. maxBound] | value <- [minBound :: Value .. maxBound] ]
>>
>>60303916
fn longest_line(text: &str) -> Option<&str> {
text.split('\n').max_by_key(|line| line.len())
}
>>
>>60307641
I copypasted this from stack overflow.
import Text.ParserCombinators.Parsec

data Suit = Clubs | Diamonds | Hearts | Spades deriving (Eq,Ord,Enum,Show)

data Rank = Two | Three | Four | Five | Six | Seven | Eight | Nine | Ten
| Jack | Queen | King | Ace deriving (Eq,Ord,Enum,Show)

data Card = Card { rank :: Rank
, suit :: Suit } deriving (Eq,Ord,Bounded)

instance Show Card where
show (Card rank suit) = show rank ++ " of " ++ show suit
>>
>>60307745
Then just use [Two..] for a list of ranks, and [Clubs..] for a list of Suits.
>>
>>60307745
What the fuck is this? Is this what programmers do nowadays? Play with toy languages and figure out how to express simple concepts in the most convoluted manner possible?
>>
>>60307726
Oh wait, no need for an Option:
fn longest_line(text: &str) -> &str {
text.split('\n').max_by_key(|line| line.len()).unwrap_or(text)
}
>>
So what's up with the Go workspace?
Do I just create a folder, and pkg/src/bin folders there, set GOPATH to that folder and create my project folder in src?
>>
>>60307762
I'm pretty sure you can generate instances of Card directly since it derives Bounded, so [Card minBound minBound ..] should give you the list of all cards.
>>
Does anybody who knows python know what I'm doing wrong?
def load_image(filename):
# load an image from the image directory
return pygame.image.load(os.path.join('image', filename)).convert_alpha()

# the player controlled spaceship
shipsprite = pygame.image.load(os.path.join('ship.bmp'))

class Ship(object):
def _init_(self):

self.sprite = shipsprite

self.x = 0
self.y = 0

def controls(self):
key = pygame.key.get_pressed()
dist = 5 #
if key[pygame.K_DOWN]: #
self.y += dist #
elif key[pygame.K_UP]: #
self.y -= dist #
if key[pygame.K_RIGHT]: #
self.x += dist #
elif key[pygame.K_LEFT]: #
self.x -= dist #

def graphic(self, surface):

# show the ship
surface.blit(self.sprite, (self.x, self.y))

I've tried writing this in like 50 different ways but it keeps giving me this error: AttributeError: 'Ship' object has no attribute 'sprite'
>>
>>60307791
Just use `cargo new`, m8.
>>
>>60307771
How is this convoluted? I have a Java textbook with an example program that does the same thing. In Java it spans multiple pages and is littered with magical constants that prevent you from extending it with more suits or more Ranks.
>>
>>60307863
Wrong language ayy.
>>
>>60307701
muh lenses

>>60307709
neat, thanks
>>
>>60307874
Exactly.
>>
>>60307874
It's not him that has the wrong language.
>>
>>60307869
enum Suit { Clubs, Diamonds, Hearts, Spades }


so many pages
>>
>>60307965
That's the easy part. Now write a method that generates a string representation of your Enum objects for printing.
>>
>>60307977
toString()?
>>
>>60307977
toString() and name() you fucking retard.
>>
>>60307998
>>60307991
b-but I thought Java was extremely verbose and boilerplate-y!
>>
>>60308014
You can write retarded enterprise code in any language.
>>
>>60307991
All right, fair enough. Finding the program again, most of the boilerplate is comprised of getters and setters.

That and C-like for loops from 2 to 14 and 1 to 5 everywhere.
>>
Giving Nim a try.
>>
>>60308050
>getters and setters on a fucking enum

And you can very well use iterators like a non-retarded person.

for (You faggot : faggots) { System.out.println(faggot); }


I don't expect an unemployed FP retard to actually know another programming language though
>>
anybody here ever seen an example of enterprise code "done right"? doesn't enterprise code necessarily have to be complicated and ugly? I can't imagine how you'd code for it in anything other than Java or C#
>>
>>60308098
https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpriseEdition
>>
>>60308098
>doing it right

Just make a goddamn interface containing the absolute minimum amount of functionality you need to make something work and use that as a type instead of actual concrete classes. It will let you and other people make your own classes and will make your code easy to test.
>>
I'm new to C++

Do I always have to specifiy a million flags when compling? In python I would just import my libraries and then run `python script.py`
>>
>>60308464
If you're calling compiler manually you're doing something wrong, just use Makefile or CMake.
>>
>>60308464
just use visual studio
>>
>>60308464
Go learn what a linker is, pybabby.
>C++
Don't bother with that trash. Go learn C instead.
>>
>>60307835
Did you initialise a ship?

ship = Ship()
ship.graphic(somesurface)


Calling
Ship().graphic(somesurface)
won't work as sprite is an instance attribute

>>60308464
If you're adding compiled shared libraries you can't just include them, as you're accessing the compiled library object, not the compiling the source along with it.
In python nothing is compiled so you just include the source of everything.
Wall just gives you more output.
But yeah use a makefile
>>
>>60308098
Google enterprise quality (in Go):
https://github.com/golang/go/blob/master/src/go/parser/parser.go

Microsoft enterprise quality (in TypeScript):
https://github.com/Microsoft/vscode/blob/master/src/vs/editor/common/core/lineTokens.ts
(dat directory structure tho)

If you want to look at something that was not meant to be open source, try and find the leaked Opera source leaks from 3 months ago or smth
>>
>>60308072
Sadly, that's not the code you find in textbooks used by tens of thousands of college students that will go on to write code in the same style.
>>
how do I learn programming? I like learning about programming languages but I usually solve my problems using the dumbest method.
>>
Share your heisenbug moments /dpt/
>programming AI for game
>mechanic on boss fight changes at certain % of HP
>doesn't work properly
>mull it over before bed and work on it tomorrow
>check the code responsible for enemy AI combat logic
>see nothing wrong, test run, just werks™
Fuck you heisenbug principle.
>>
Is it possible to learn Javascript decently by jumping straight to Typescript? I need to do some browser stuff, but I don't want to deal with a language where '5' - 3 + 3 = 5 but '5' + 3 - 3 = 50.
>>
>>60308496
yeah I did I just couldn't fit that part
ship = Ship()  # make a ship object
# main loop
while not done:
# limit cpu usage
clock.tick(10)

for event in pygame.event.get():
if event.type == pygame.QUIT:
done = True

ship.controls()

screen.fill(BLACK)
ship.graphic(screen)
# update screen
pygame.display.flip()

# close window
pygame.quit()
>>
>>60308609
You got that example from this webcomic?
>>
>>60308486
>anon is confused about using the compiler
>anon should learn yet another tool just to compile their first programs
youre terrible at giving advice.
>>
>>60308570
Sounds like you need to stop using shitty 3rd party books and start learning from the source. Go read the Java tutorials provided by Sun/Oracle itself if you care about having a non-shit opinion about the language.

>college students

See >>60307095. Wanna learn how to develop actual software? Ignore all that college crap and do your damned best to score yourself a good summer internship. You get paid, you actually learn useful things like how actual programmers code, you get good at team work and communication, you get valuable experience, you network with industry players and other programmers and you get to put in your CV, solving the idiotic "need year of experience for entry level position" problem.

If you aren't doing that, no amount of grades can save you. Hope you like writing incomprehensible papers for the rest of your sad academic life.
>>
>>60308592
>AI
>probably not even using machine learning
>>
>>60308486
>Makefile or CMake.
I'm so glad Meson is a thing now. Make is just such shit.
>>
>>60307887
Sorry but I need a decent concurrency model like the one that Go offers.
>>
>>60308697
Have a (You)
>>
>>60308680
He was literally asking about a build system tho.
>>60308698
We should just let CMake win, t b h.
>>
Trying to make something in Ogre3D
>>
>>60308738
>We should just let CMake win, t b h.
It's great how it works with everything but the syntax and documentation are just so incredibly shit.
>>
>>60308698
>Make is just such shit
Plain makefiles work great. Only when you start doing a bunch of unnecessary and stupid bullshit do they become more annoying to work with.
>>
>>60299147
>you can't even measure length of an array in C
who else fell for this meme?
>>
>>60308785
Yes you can, you fucking idiot.
>>
>>60308653
>buggy date libraries

Yeah no surprises there. At least in this case it's not PHP that is the problem, it's that dates and times are fucking impossible to get right.

Try it if you don't believe me. See you in hell.

>JS

Yet another moronic complaint about simple language semantics.

String + concatenates the value of 3 - 3 to '5', obviously yielding '50',
String - doesn't exist, so it's converted to Number and regular math takes place.

Read the standard and stop crying about retarded edge cases everybody's already dealt with a long time ago.

>ruby

People don't play code golf in real code bases.

>Java

Avoid cancerous libraries. Abstract them away if that's not possible. Write simple & effective code.
>>
>>60308792
well show me smart guy
>>
>>60308746
Are you using the latest build?
or the 1.9 version?
>>
>>60307095
I stopped reading when I realized that you either don't understand the difference between memorization and actual learning or you just think everyone memorizes their work. I'm earning my certification while also earning my degree and certification exams definitely test your skills. Sure, some people THINK they can get by with memorizing the material and you may even get a bad professor who expects you to memorize some of the material, but the difference is you can't apply what you memorized three years later. You can however apply what you learned three years later and I don't care what field you are in, but I'm sure there is learning involved. You're just trying to justify getting shitty grades.
>>
>>60308796
>moronic complaint
How on earth are those complains "moronic"?
>concatenates the value of 3 - 3 to '5'
What you're describing is a break in operator precedence. I imagine that's actually happening is that you're getting "53" - 3 -> 50.
Dynamic typing and these sorts of implicit conversions are a fucking cancer. Even ardent defenders like you can't get this convoluted shit right.
>>
>>60308817
sizeof array / sizeof *array
>>
>>60308887
doesn't work with dynamic arrays and arrays that are passed as parameters
>>
>>60302008
>why doesn't /dpt/ makes six figures?
I do.

I don't live in NYC, Seattle, or SF.
>>
>>60308948
>doesn't work with dynamic arrays
It does work with VLAs, though. If you're talking about something used with malloc, what you have is a pointer, not an array. Don't confuse the two.
>arrays that are passed as parameters
There is no such thing. Again, what you have is a pointer.
>>
File: 2017-05-10-131756_310x413_scrot.png (24KB, 310x413px) Image search: [Google]
2017-05-10-131756_310x413_scrot.png
24KB, 310x413px
Guys I'm really lost. I thought C++ has namespaces? Where's that CURL_ERROR_SIZE from? I assume it's from one of the includes but isn't it supposed to be namespaced. How do you even know what comes from where otherwise
>>
>>60308978
You use an IDE and put your mouse over the identifier.

This will show you where it's coming from.
>>
>>60308988
I never use IDEs though. Is vim not popular among C++ programmers?
>>
>>60308978
Curl is a C library, you dumbass.
>>
>>60308995
Vim is only fine once you've added enough addons to give it some of the features of a proper IDE.

IDEs are tools made to help you. They give you lots of information about what is going on under the covers in a high level language like C++, and give you tools to complete your tasks quicker. There's no reason not to use an IDE, unless you want to impress teenagers.
>>
>>60309001
Wait so you mean it's an artifact of the library? I mean it obviously has a C++ interface, but was it designed for C and the libraries designed for C++ are namespaced?
>>
>>60309022
No. Curl is straight up a C library. It doesn't have any of your useless C++ features such as namespaces.
>>
Does anyone know how to properly submit a recaptcha challenge and get the code back?
        get_challenge='https://www.google.com/recaptcha/api/challenge?k='+key
challenge=requests.get(get_challenge)
challenge=chal.text.split(" : '")[1].split('\'')[0]
image=requests.get('https://www.google.com/recaptcha/api/image?c='+challenge)
img = Image.open(BytesIO(image.content)).show()

.....

POST={}
POST['c']=challenge
POST['response']=answer
k=requests.post('https://www.google.com/recaptcha/api/fallback?k='+key,
data=POST,
headers=head)

What is wrong with this exactly?
I haven't seen any real examples of how this is supposed to work.
>>
>>60308978
>using non-monospace font
why?
>>
>>60309016
Idk, IDEs are heavy, bulky, they don't run in my terminal. I have everything in the terminal and split the screen between browser and terminal so it'd be helpful to code in there too. Maybe I'll look into adding vim plugins but idk
>>
>>60309037
Oh okay that makes me feel better

>>60309045
It's just a browser screenshot https://curl.haxx.se/libcurl/c/htmltitle.html
>>
resharper++ is quite nice. it's intellisense isn't very good though.
>>
>>60308852
Call me when exams successfully weed out pajeets and Chinese cheaters who literally memorize everything in the book without any firm grasp on what any of it means and use any cheating method possible to game the system. Last time I checked, they were at the top of my class, despite sucking at software development. They're good at the academic ritual of studying and passing exams. They memorize the general structure of a problem and also the algorithm to solve it.

I used to get 95th percentile grades on written exams but then I realized what an absolutely abysmal use of my time it was. With these exams, 20% of the work get you 80% of the results. Beyond that it's diminishing returns. So I just study a couple hours before major exams for a passing grade and enjoy my new found free time. I still ace all my practical courses and assignments though, because they're actually useful.

Want something better than grades? Get positive evaluations from people you've actually worked with. Mine are excellent.

Get those internships.
>>
>>60308796
i noticed that people who complain about javascript often barely know the language

two examples:
- they don't program (much), they see this meme making fun of javascript and start parroting it to fit in and feel superior to those imaginary programmers
- they're used to their favorite language behaving differently so they give up or don't even bother learning javascript because it's not python or c

there was someone on /wdg/ who said php is better than javascript even though they said earlier that they don't know javascript

i find it weird how people are so eager to criticize things they barely know anything about

>>60308878
the solution is to not write intentionally confusing expressions that do maths and string concatenation without using parentheses like in the example

i literally never run into issues related to implicit conversions (i am perfect)

that precedence thing you pointed out is surprising to me but it's not something i've had to notice before
>>
File: uh.png (28KB, 528x799px) Image search: [Google]
uh.png
28KB, 528x799px
>>60309064
so not even your browser uses monospace fonts for <pre> elements? why are you doing this to yourself?
>>
>>60309116
I mean I'm not overwriting the default CSS if that's what you mean. It looks like their stylesheet declares sans serif for all text so the <pre> probably inherits it too
>>
>>60308977
>VLAs
>actually using this

lel

>>60308878
>How on earth are those complains "moronic"?

Because that isn't an issue I or anybody I know ever had to deal with. ever. It's literally a snippet people use to shitpost about languages they don't use.

Try not mixing numbers and strings in the first place. Nobody does that.
>>
>>60309160
>>actually using this
Stupid sour grapes sepplesfag.
"Wahh we don't have VLAs, so they must be bad!"
>>
>>60309116
I like to have my code neatly aligned.
I always pad "left" with an extra space so it aligns with "right" while cursing the English language for not making all directional words 5 letters.
Above, below, right are all fine 5 letter words why did you fail at left?
>>
>>60309185
>allocating size_t-bounded memory on the stack with no error checking

Good luck pajeet. There's a reason it was made optional.
>>
>>60309152
>I'm not overwriting the default CSS
><pre> inheriting parent css font family
you might want to consider changing to a proper browser, cause whatever you are using is junk
>>
File: 2017-05-10-134219_941x383_scrot.png (65KB, 941x383px) Image search: [Google]
2017-05-10-134219_941x383_scrot.png
65KB, 941x383px
>>60309217
Maybe I messed something up in Stylish or something?
>>
>>60309193
>Above, below, right
One of these things is not like the other.
>>
>>60309247
>even the about box is fucked
ayy lmao
>>
>>60309204
You clearly aren't aware of what VLAs are capable of.
int width = 10, height = 30;
int (*ptr)[height] = malloc(sizeof *ptr * width);

This is a true runtime-sized 2D array. There is no thread of stack overflow, because it's not stack allocated. You cannot do this without VLAs.
I can pass it into a function.
void fn(size_t w, size_t h, int array[w][h]);

I can create functions which actually say something useful about their arguments
void fn2(size_t n, int array[static n]); // array MUST point to an array of at least n members

If I can reason about the size of some argument (which one usually can a lot of the time), you can safely use VLAs in the "normal" way.

But keep saying those grapes are sour.
>>
>>60309284
Lmao what's wrong with it
>>
>>60306218
First of all, yes it does. Any language that supports heap allocation but doesn't have a garbage collector has this "problem."

Secondly, it's not even a problem. It's just a different way of programming.
>>
File: about.png (71KB, 802x317px) Image search: [Google]
about.png
71KB, 802x317px
>>60309289
spot the difference
>>
>>60309353
Um, your fontsize is bigger?
>>
File: EventEvent.png (4KB, 786x59px) Image search: [Google]
EventEvent.png
4KB, 786x59px
halp

I'm using the javafx.event.Event and another class Event from package Event. Is there a way to fix this without renaming anything?

This is java.
>>
>>60305422
>It teaches you the truth of immutable state and pure functions.
That's not a truth though, it's just one of many paradigms.

If anything, it's a lie. State is rarely immutable at the hardware level, even when the OS decides it's read-only. Same thing with pure functions: all functions have side effects on the execution state.
>>
i dont know nothing about programming

where and what should read for start?
>>
>>60309398
What the fuck are you doing?
>>
>>60309409
http://www.robmiles.com/c-yellow-book/

There's a free PDF on the page, and plenty of code samples.

Even if you don't end up using C#, it's a great intro to programming for complete beginners.
>>
>>60309398
Is this a joke?
>>
>>60309398
This is why you should never use capital package names.
>>
>>60309373
wrong, but close
take a look at the bottom of it, think about it for a second. is that the expected behavior?
>>
File: 2017-05-10-140004_1280x800_scrot.png (148KB, 1280x800px) Image search: [Google]
2017-05-10-140004_1280x800_scrot.png
148KB, 1280x800px
>>60309456
Lol you mean the empty space? It's just the window manager cause it's tiling
>>
>>60309422
>>60309446
I need to disambiguate between javafx.event.Event and Event.Event. But intellij doesn't recognize the first Event in Event.Event as a package name but thinks i mean either of the classes, and inserts a new Event. before that, creating Event.Event.Event

but now that first Event is still one of the classes so it inserts a new event so i got Event.Event.Event.Event

>>60309451
figured as much, but it's not my codebase and i cannot rename stuff.
>>
>>60309437
not him but
>C#
microsoft no
>C
>#
microsoft pls
i have wife and family
>>
>>60309482
leenoox, not even once
>>
>>60309501
What are you autisming about?

If you're concerned about your wife and family, C# has a fuckton of jobs. If anything, it can help your wife and family by virtue of market value and/or employment prospects.
>>
>>60309273
What would you use?
If we are describing one point in relation to another point, the point above or the point to the right makes sense.
If we are talking about moving in a direction, then I guess up/down makes more sense, but there the consistency is even worse.
In that case I use north, south, east and west and pad the 4 letter words.
>>
>>60309531
you misunderstand
i am concerned that the language itself will murder me
>>
>>60309571
C# is not sharp. It's actually a very nice language.
>>
>>60309571
> i am concerned that the language itself will murder me
What did he mean by this?
>>
File: 1453306116180.png (58KB, 313x196px) Image search: [Google]
1453306116180.png
58KB, 313x196px
>Someone stars all of my github repos
>Look at account
>3.8K repositories starred
What the hell?
>>
>>60309630
this happens on all social media m8. people want to be followed/starred back so they spam everyon
>>
>>60309555
>I guess up/down makes more sense, but there the consistency is even worse

You have (literal) autism that forces you to use words that don't quite mean what your intention is.
>>
>>60309286
they're green & seedless by comparison to ye old black, ripe, seeded K&R2
>>
>>60309204
>>60309286
>not using int for array bounds
gtfo
>>
>>60309664
They themselves have no repositories of any note (4 forks of something else with no changes added) and doesn't have many followers.
I would suspect a bot, but then 3.8K isn't enough.
>>
>>60309571
hmmmmmm tinking
>>
>>60309694
people sometimes fork famous repositories to make their profile look better banking on the fact that potential employers don't check further than a superficial look
>>
>>60309699
>hmmmmmm tinking
>>
>>60309630
>>60309694
You can report it. It's most likely a bot. There are ones that will just fork random large and small repositories, too. I guess mass starring repos is a little less worrisome than mass forking.
>>
any simple way to get the timezone for a country/city/state etc from CLI? like

$ timezone atlanta
09:22


i don't wanna start scraping google or something so is there a stable app already for this
>>
>>60309716
what's wrong with mass forking that's not wrong with mass starring
>>
>>60309733
>asks for a timezone
>gets current time
>>
>>60309763
fine
 $ time atlanta 
but that's a shell reserved word
>>
>>60309744
Usually implies that what >>60309708 wrote is happening. It's mostly Chinese bots that do this, though. Starring is also more of a purely social action, too.
>>
>>60309773
use current-time as name
use a non shit shell
>>
>>60309783
great i have a name but i don't have a program
>>
>>60309789
https://github.com/tzinfo/tzinfo
>>
>>60309817
but that's a library with no cli interface :(
>>
>>60309733
#!/bin/bash
wget "google.com/search?q=timezone+$1" -O /dev/tty
>>
>>60309837
HTTP request sent, awaiting response... 403 Forbidden
2017-05-10 14:31:46 ERROR 403: Forbidden.


they probably need me to use browser headers. but then i'd have to parse it anyway
>>
Is it possible to ship a program that doesn't require the end user to install a bunch of shit?

I'd preferably like to reference a some libraries that are just in the root directory and bundle that all up. Every language I look at seems to need dependencies installed like Python or Java.

Assuming the users have Windows 7+ installed, what are my options?
>>
>>60309895
but all operating systems have python installed ???
>>
>>60309733
I programmed a clock once and used a timestamp feature, it's a very precise timecode for a specific region. Do you access to anything like that?
>>
>>60309908
i guess maybe not arch and gentoo but the user installs them while setting up the os anyway ??
>>
>>60309895
Well, if you really want to not have any dependencies at all, you could make it a bootable program

Probably more hassle than it's worth
>>
Soliciting opinions: are '10x developers' a thing? What qualities make a programmer more productive?
>>
>>60309908
I'm on Windows 7. No Python.
>>
>>60309895
>Assuming the users have Windows 7+ installed, what are my options?

Windows 7 comes with at least .NET 3.5. Most Windows 7 machines have .NET 4.0 or greater by this point.

You can create a .NET application, and bundle any additional libraries you use with something like Costura.Fody.

At this point, you have a single file to distribute, with no installation: an .EXE that Just Werkz™.

Of course, this assumes you don't want log/config files laying around somewhere. Many simple installers just create a few folders and ensure there's no previous version of the application or file/folder conflicts.
>>
why can i just add
#include <curl/curl.h>
and compile with
$ g++ name.cpp
without having to pass any flags to link the header??
>>
>>60309990
http://www.stroustrup.com/programming.html
>>
>>60307656
For what platform? C# has different GUI libraries depending on whether you're targeting Windows, UWP, or Apple shit (Xamarin).
>>
>>60310016
>Ealier versions of this book have been used as the
>Ealier
stopped reading, no wonder sepples is shit
>>
>>60309895
Assuming this is all in the realm of windows based on "Assuming the users have Windows 7+ installed, what are my options?":

You can use something like Pyinstaller or cx_freeze with Python to make standalone Python "programs" I believe. What happens is that these systems bundle an entire Python install and whatever extra libraries you used in the Python script into an .exe file if you're targeting Windows.

This >>60309970 too. If you make something in C# and target .NET 3.5, there won't be a whole dog-and-pony show of installing dependencies. Honestly you might want to look at how Webm for Retards and ShareX do it if you want to go down the C# path. Former uses inno setup, latter simply distributes a .zip file.
https://github.com/ShareX/ShareX
https://gitgud.io/nixx/WebMConverter

>>60309908
Wangdows doesn't come with Python installed. I wish it did.
>>
>>60310016
>not even freely available online
>>
>>60309990
You don't link a header; you link a library. The actual executable code of the library has to live somewhere, and your program needs to know where that is.
Also, if you bother to set up a proper build system (even as simple as a plain makefile), it makes it much less annoying to do.
>>
guys how do i run Windows
>>
File: 1404410667387.jpg (61KB, 604x383px) Image search: [Google]
1404410667387.jpg
61KB, 604x383px
Is there any reason to program other than for work? It seems whatever you need doing on a computer someone has already written a program for it already.
>>
>>60310082
I do it to make games
>>
>>60310082
What a shitty defeatist attitude to have.
>>
>>60310041
>>60309970
Thanks guys, these both seem like agreeable alternatives.
>>
>>60310082
Fun
>>
>>60310043
>You don't link a header; you link a library.

But like when it sees that include directive.. what does it do? does it know where to get the header from?

Yeah, I'll sort out the build system after I understand how do it manually
>>
>>60310082
Maybe if all programs were open source, I constantly have the desire to tweak a program slightly and often it just makes sense to program my own version that usually has less bullshit.

Making small videogames\applications for friends make nice gifts as well.
>>
>>60310112
Ooops, just realized that I typed Webm for Retards before ShareX (ShareX uses inno setup, Webm uses .zip distribution), but I think you get it. Hope it helps.
>>
>>60310082
There will be new issues and new technologies and they will provide the need for new programs and application and you could be the first to satisfy this need.
Or learn from the pioneers and fix all the problems someone else's first solution had and provide that for others.
>>
New thread:
>>60310140
>>60310140
>>60310140

>>60310122
>But like when it sees that include directive.. what does it do?
It's literally just a copy-paste of a file into yours. does it know where to get the header from? It depends, but for Linux systems: /usr/include.
The actual library code you're linking against lives in /usr/lib.
>>
>>60310122
you have no clue about what you are doing. just go read a c++ book
>>
>>60310082
This is exactly why I have no motivation to do program as a hobby. I mean, I'm interested in using different PLs and paradigms, but I have no idea what to apply them to, I have no interest in anything. I only have Firefox and Steam installed on my PC, because I literally don't need anything else.
>>
>>60310228
>Steam
if you like games so much that you actually need this

then you should try making them

as an ex-gamer i can attest that it is really rewarding to graduate from being told interactive nonlinear 3D graphical stories to being the storyteller
>>
>>60310387
Well, I like playing games, but I'm not interesting in making them, especially being a storyteller or game designer - I have no imagination for such things, I'm just a relatively competent programmer. If anything, I think it would be better for everyone if programmers stopped designing and writing games and left these things to someone with a talent for such things.
>>
>>60310387
Not him but the original guy who asked. I do enjoy making games in Game Maker so I thought programming would be kind of a natural evolution of that so I installed the shit and did the tutorials and things but once I got to the end I realised there was nothing I needed a program for.
>>
>>60310082
Hardly anybody makes good video games.
Thread posts: 353
Thread images: 37


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