[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: 346
Thread images: 42

File: rms.jpg (50KB, 620x372px) Image search: [Google]
rms.jpg
50KB, 620x372px
What are you working on, /g/? --nsa
>>
the cancer filled old thread is here >>52434874
>>
Working to git gud at Sepples
>>
jews are responsible for all the world's problems.
>>
>>52441410
agreed, and black people

>>52441370
top thread pic m8
>>
The freedom to run the program as you wish, for any purpose (freedom 0).
The freedom to study how the program works, and change it so it does your computing as you wish (freedom 1). Access to the source code is a precondition for this.
The freedom to redistribute copies so you can help your neighbor (freedom 2).
The freedom to distribute copies of your modified versions to others (freedom 3). By doing this you can give the whole community a chance to benefit from your changes. Access to the source code is a precondition for this.
>>
File: 1451948679554.webm (3MB, 640x360px) Image search: [Google]
1451948679554.webm
3MB, 640x360px
Ask a programming literate anything.
>>
>>52441437
Can you prove you're literate?
>>
>>52441437
why are random forests uncommon for specific classification even when they perform very fast after initial training?
>>
>>52441437
Tetsumi: Kill yourself.
>>
Can we start posting the IRC in the OP?

irc.rizon.net || #DPT
>>
>>52441562
No, fuck off.
>>
File: zlib uncompress.png (10KB, 1367x108px) Image search: [Google]
zlib uncompress.png
10KB, 1367x108px
I've almost got this working. Holy shit I'm SO FUCKING CLOSE.
The original, uncompressed data was a string, about 600 characters long. The for loop writes the string for a few hundred characters, but then it starts writing garbage. The uncompress() function returns -5, which means there wasn't enough space in the uncompresseData buffer. How big does it need to be? sizeDataCompressed is equal to the amount of characters in the original, uncompressed string. saveText is the compressed string that I'm trying to uncompress. sizeDataOriginal is the amount of characters in the compressed string.
Holy fuck I'm so goddamn close SOMEONE FUCKING HELP.
>>
>>52441437
What is a programming literate
>>
File: [email protected] (21KB, 350x350px) Image search: [Google]
python-for-beginners@2x.png
21KB, 350x350px
in python I write occasional global variables in ALLCAPS
I dunno from where I got it
is anything wrong with it?
>>
>>52441410
Jews are space aliens
>>
can any1 post the /g/ programming challenges, I'm bored. :)
>>
>>52441562
>rizon
Enjoy your botnet.
>>
>>52441609
People tend to do that with C macros
>>52441625
https://better-dpt-roll.github.io/
>>
>>52441609
is anything wrong with global variables? yes, everything.
>>
Rate my pi digit calculator.
It works up to the first 5000 digits of pi. :^)
>>
>>52441609
>Python
>am I gay?
yes
>>
>>52441651
>"31...
It's complete trash
>>
>>52441609
It's not conventional and it may confuse people. ALL_CAPS are for global constants, not global variables. all_lowercase are for global variables.
>>
File: chip8.jpg (4KB, 185x25px) Image search: [Google]
chip8.jpg
4KB, 185x25px
>>52441625
here lad

I hope I get chip-8 emulator
>>
How important is knowing algorithms to be a good programmer?
>>
>>52441651
>getting pi wrong
>>
>>52441651

try tweaking the performance aspect a bit if you actually want people to use it.
>>
>>52441665
>all_lowercase are for global variables.
and local, so its useless
>>
>>52441656
>>52441670
the specification claims that the decimal point doesn't count

https://www.codeeval.com/open_challenges/228/
>>
>>52441667
to get started, not very, to get good, understanding algorithms, rather than "knowing" them matters.
>>52441675
that's about as computationally efficient as it can get.
>>
File: D.png (8KB, 125x95px) Image search: [Google]
D.png
8KB, 125x95px
D Who?

I wish debugging in D was easier. Can only really do that in Visual D.
>>
>>52441651

Is this bait?

Compute the sequence, man.
>>
>>52441745
>being this dense
>are you an SSD?
>>
>>52441437
What are the drawbacks of using Lamport clocks?
>>
Guys I am super drunk


Please give me a you
>>
File: MMG54EH.gif (111KB, 242x315px) Image search: [Google]
MMG54EH.gif
111KB, 242x315px
>>52441576
I GOT IT
I FUCKING DID IT
HOOOOOLLYY SHIIIIIIIIT
FUUUUUUUUUUCK YEEESSSSSSS
FUCK YOU ALL

Now there's an unrelated problem. I'll try and fix it and I'll come back if I can't get it working. Thanks /g/.
>>
>>52441787
try to compute cos(45.6) in your head to 6 digits of precision
>>
>>52441714
is there some advantage to D?
>>
>>52441787
You from Europe
>>
>>52441714
D here
gdb not work well enough?
>>
>>52441807
yes, your mom likes it.
>>
>>52441807
it's less shit than python
>>
thoughts on GCC?
>>
Why should i use vim as a text editor? Is it faster to program on than any other?
>>
>>52441803
Is that in degrees, or radians?
>>
>>52441858
fahrenheit
>>
http://codeshare.io/4chan
>>
>>52441847
use whatever you work fast with.
>>
what c++ compiler should i use on windows? i really don't want to use an IDE before you say it
>>
>>52441847
It's only faster when you invest some time in learning the shortcuts.
>>
>>52441899
A lot of anons shills vim hard, so i want to know what's so great about it.
>>
>>52441918
it's great to get a lot of things done fast once you've learned it. also, prepare to fine-tune the config ad infinitum. most of the time people shill it because it's a shill thing to do, really. it's a great editor and all, but the people who shout about it the loudest are usually the ones who know the least about it and just want to show off elitism.
>>
>>52440592
I tried different chips. I tried different power supply circuit. I tried disconnecting peripherals.

What was the cause? A faulty crystal. Yes, a god damn crystal. It simply failed. Has such thing ever hapenned to you?
>>
>>52441954
>>52441917
How different is it from emacs? And what do you mean by a lot of things done fast?
>>
>>52441916
Just install Visual Studio, you can use the compiler from the command line. But really I recommend using an IDE unless this is your first programming language and you're just starting out
>>
>>52442026
They are basically the same thing: editor used for programming. Some like vim, some like emacs. Pick your poison.
>>
>>52442026
they take different approaches to similar problems. if you like pressing two modifiers and a pedal at the same time you'll like emacs, if you like elaborate sequences you'll like vim.
getting a lot of things done fast here means refactoring code quickly but it can mean whatever really. editing any file to your liking quickly.
>>
>>52441992
only when i wired something wrong. could also be you don't have enough decoupling capacitors or whatever.
>>
File: 3467346438.jpg (83KB, 900x563px) Image search: [Google]
3467346438.jpg
83KB, 900x563px
>>52442026

Vim won't give you carpal tunnel.

Pic related.
>>
>>52442155
You can modify emacs or use evil mode to avoid cts
>>
>>52441916
if you're on windows then you should compile using cl. as is good practice, also set up a mingw distro like dragon or nuwen to make sure you're not writing non-portable code.
>>
>>52442189
>you can modify emacs to be not emacs
>>
>>52441846
it's good
>>
>>52442026
> How different is it from emacs?
The main differences are
1. vi is modal. It's either in insert mode, where characters are entered as text, or command mode, where characters execute commands. Emacs is non-modal: printable characters are entered as text, commands are activated by sequences beginning with Ctrl-<key> or Meta-<key>.

2. vi is a text editor with macros plus (typically) an extension language (which language(s) depends upon which vi clone you use). Emacs is fundamentally a Lisp interpreter with a library of functions which are useful for writing a text editor, and will run a text editor if not explicitly told to do something else.
>>
>>52441916
gcc works universally don't use a meme compiler because it's 0.0000001% faster
>>
I just use notepad++ lmao
>>
>>52442205
People who use emacs should kill themselves. You'll never be good at programming if you use it.
>>
>>52442235
gcc is the meme compiler

the only reason to use it over clang is "muh speed"
>>
>>52442155
> Vim won't give you carpal tunnel.
That's more of a problem for scrubs who try to type Shift/Ctrl/Meta+<key> with one hand. There's a reason that the modifier keys are duplicated on both sides of the keyboard.
>>
File: g dpt baremetal patrician.png (2KB, 88x37px) Image search: [Google]
g dpt baremetal patrician.png
2KB, 88x37px
>>52442237
>>
>>52442237
>using windoze
>>
>>52442256
clang is for mac gcc is for everything else that's how it is just keep it that way lmao
>>
>>52442252
Prove it
>>
>>52442252
>newfags in charge of knowing fuuzetsu

Best programmer /dpt/ has ever had, and he uses emacs.
>>
>>52442263
pretty much
>>
>>52442235
>gcc works universally
. . .
>>
>>52442257
>having to modify emacs to be good
Lmao, vim for lyfe bitch. It works out of the box
>>
>>52442237
>Not using Sublime Text

nigga pls
>>
File: repellent.jpg (94KB, 1024x756px) Image search: [Google]
repellent.jpg
94KB, 1024x756px
>>52442252
shitposting intensifies
>>
>>52442252
>People who use python should kill themselves. You'll never be good at programming if you use it.
FTFY
>>
>>52441410
>jews are responsible for all the world's problems.

You are part of it for percieving it as the problem. This world will never be yours goyim.
>>
>>52442284
in terms of operating system yes
>>
>>52442274
And FreeBSD, and Android... face it, people are slowly but surely moving away from gcc because it's a meme.
>>
>>52442275
>what is emacs pinkey
>>
>>52442315
. . .
>>
>>52442097
I put in another crystal and it works [spoiler]so far[/spoiler]
With this faulty crystal even simplest led blink sketch doesn't work, it simply doesn't produce clock signal. Hotswapping the crystal also works.
>>
>>52442336
. . .
. . .
. . .
>>
>>52442328
I wouldn't say that's strictly an emacs problem
>>
File: havetried.jpg (91KB, 1024x756px) Image search: [Google]
havetried.jpg
91KB, 1024x756px
>>52442336
s/ugly/autistic/
>>
the thing that both vim and emacs excel at is starting arguments.
>>
>>52441992
How the fuck do you even know that the crystal broke?
>>
>>52441787
// (You) Distribution Program
#include <iostream>
#include <string>

int main( void )
{
using std::cout;
using std::string;

string anon = "Drunk";

anon += " faggot";

if( anon == "Drunk faggot" )
{
cout << "\nHere's your (You), faggot.\n";
}
return 0;
}


I'm a noob. Any pointers?
>>
>>52442428
int *p;
>>
>>52442428
>Any pointers?
Stop using C++
>>
>>52442428
>partial GNU style braces

Wackity shmackity don't.
>>
>>52442428
needs more memory leaks.
>>
>>52442448
this
>>
>using python
Python is literally just Basic
>>
>>52442428
it's fine as far as it goes anon, but you probably should pick up some cin experience as well so you're code can interact with it's user yea?

>>52442459
nah, then he'd be doing C instead anon.
>>
>>52442428
pretty sure that's not how strings work in c++
>>
>>52442507
No, he's got legit std::string code they're anon. Try it.
>>
File: coincidence.png (270KB, 1015x552px) Image search: [Google]
coincidence.png
270KB, 1015x552px
I'm working on a way to detect coincidences.

https://www.youtube.com/watch?v=EF_UCX6BF4w

Go to 4:33 of the video for more info.
>>
>>52442507
it is though
http://en.cppreference.com/w/cpp/string/basic_string/operator_cmp
>>
>>52442525
oh, i've never used std::string in c++. then again i was taught a very c style of c++
>>
>>52442552
All you have to do is look up the reference
http://www.cplusplus.com/reference/string/string/operators/
>>
>>52442534
Insert "rabbi" before a last name and then do a google search. This will work better than maintaining a list of known merchants.
>>
I would like the information/opinion of someone else educated in the use of Lua.

What I have, does seem to work. But I want to know if there is a better way to do how I am doing it (calling functions from within tables).

I'm not going to give you every single code that calls a function to call a function because that's a little redundant, it all kinda does it the same way.

But anyways, I have a function in C go through the arrays and calls a function passing on that ID:
void OBJ_UpdateAll ( double dt ) 
{
unsigned int i;
for ( i=0; i<G_ent->length; i++ )
{
EntArr *temp = retrieve_arr ( G_ent, i );

lua_getglobal ( LS, "EntityUpdate" );

lua_pushinteger ( LS, temp->ID );
lua_pushnumber ( LS, dt );

if( lua_pcall ( LS, 2, 0, 0 ) != 0 )
lua_error( LS );
}
}


So if there's 16 entities, G_ent->length is 16; retrieve_arr gets the information of the corresponding array; etc. etc.

Anyways, from there, the EntityUpdate function literally just does:

function EntityUpdate ( ID, dt ) 
if entity[ID].update then
entity[ID]:update( dt );
end
end


This seems a bit redundant in and of itself, but it does work and doesn't give me any issues. I would like to know if there's a way to just call
entity[ID].update
from within C (provided it exists)
>>
>>52442552
Yea, that's a pretty common scenario--not you're fault really. If you ever want to get up to speed on good C++, then read Bjarne's PPP2 if it's been a long time since you programmed, or C++ Primer 5ed if you're more experienced, or Tour++ if you're a current developer.
>>
I am writing a media player (assembly and c++). And I'm sorry the code is proprietary. But I am excited to be writing it.
>>
>>52442599
Sometimes you get (((people))) with very anglicized names like "Daniel Smith".

http://www.edrs.org.uk/site/index.php?option=com_content&view=article&id=196:rabbi-daniel-smith&catid=22:rabbis&Itemid=127

Another one is Adria Richards. Who would suspect her just on name alone?

We want to be able to catch these kinds of names too, so we chose to maintain a big list.

Like you said, it's not easy, but this is the path we're going to take.
>>
>>52442456
But it's so pretty and readable.
>>
>>52442689
Maybe their should be something that identifies a possible echo. Something like (((? name ?))).
>>
File: 1452719498802.png (212KB, 500x350px) Image search: [Google]
1452719498802.png
212KB, 500x350px
>>52442434
nice me me friendo
>>
>>52442780
there*
>>
>>52442796
way to contribute to the thread.
>>
>>52442428
>using std

stopped reading right there.
>>
>>52442830
perfectly acceptable when specifying specific functions anon. professionals do it all the time.

he even took to the trouble to scope them other than the global namespace.
>>
>>52442872
there's still no reason to do it.
>>
>>52442830
Lol I put
from math import *
from itertools import *
from functools import reduce
import operator
from mathx import * # custom library

At the top of all my scripts. Does that make you mad?
>>
>>52442899
readability is a high priority for maintenance when dealing with a large codebase anon. sure they're is.

just make it obvious *which* item you mean (such as
 using std::string; 
.

As long as you don't do something silly like
using namespace std;
, you're good to go.

And for toy educational examples such as anything found on /g/, even that is acceptable.
>>
File: ௵.jpg (21KB, 326x298px) Image search: [Google]
௵.jpg
21KB, 326x298px
irc.rizon.net
#DPT

join

come on make this official guys
>>
>>52442915
It doesn't make me mad, it makes you retarded.
>>
>>52442966
I'm not convinced.
>>
>>52442263
>windows
>>
>>52442986
>rizon
Enjoy your botnet.
>>
>>52443032
haha, k. just follow you're companies coding standards when you get they're anon. you'll should be fine.
>>
>>52443049
info on why claiming it's a botnet anon?
>>
>>52443012
Yeah, you're mad.
>lol, it's unsafe, there might be conflicts!
>someone told me a long time ago it was bad programming practice and I believed it blindly, lol.
>>
>>52442307
kill yourself kike
>>
>>52443070
>>52442966
>they're
>>
What are Ruby's shorcomings when compared to LISP?
>>
File: Grammar.jpg (67KB, 600x885px) Image search: [Google]
Grammar.jpg
67KB, 600x885px
>>52443266
>*you're
>>
File: how dis.png (30KB, 630x453px) Image search: [Google]
how dis.png
30KB, 630x453px
How can I get this kind of sectioned-off output in my java console?
>>
>>52443181
The main reason is so I know what file or lib something is in
>>
>>52443292
>Languages
>consciously invented
>>
I'm not very good at string manipulation.

In C# I want to pass [somearg, someotherarg, many other args] to a method, and in return receive an array of strings.
>>
>>52442155
Vim is superior to emacs in every way.
>>
>>52443316
In other words how do I split the string using a delimiter?
>>
>>52443316
study tokenization and tokenizers in you're chosen language anon.
>>
>>52443316
https://msdn.microsoft.com/en-us/library/ms228391(v=vs.90).aspx
C# supports varied length parameters.

>>52443361
Are you serious?
Look in the fuckin' reference, it's a member function of String.
>>
File: tumblr_inline_n6kdbwVURk1qmoaae.jpg (61KB, 480x475px) Image search: [Google]
tumblr_inline_n6kdbwVURk1qmoaae.jpg
61KB, 480x475px
>tfw started vaping while working
>tfw vaping only while working
>tfw I'm now literally addicted to work
this is really nice actually
Too bad I won't be able to do it in an actual office
>>
>>52442915
Why don't you just use a proper functional language?
>>
>>52443307
That might mean something if I was working on programs that ever reached above 500 lines. Still the largest to date is 2500. I could keep it all in my head, never got confused like that.

Prepping to do a compiler soon. Might end up around 10,000. Still unsure if I should do it in C or learn C++ and do it in that. It would compile to a very low-level typed VM, like nearly 1-to-1 instruction matching. I'm not generating asm because x86 is a fucking nightmare.
>>
>>52443385
>Using a mouth fedora
>>
>>52443392
I'm learning Haskell now. But Python is useful in ways Haskell is not.
>>
>>52443410
>Mouth fedora
I live on a college campus and fratboys etc use them, they're extremely trendy. They're only "fedora" on 4chan, and let's be completely honest about how socially apt most people here are.

That being said, I only use it in private while working because I don't want to associate myself with the fratboys and their ilk, but still. They're far from being a fedora thing, unless you get a steampunk mod or something.
>>
>>52443410
How do you tip an e-cigarette?
>>
Using the buffer design from the dragon book chapter 3, how do you copy a token that is split between the left and right buffer?
>>
>>52441423
Jews are responsible for black people
>>
currently working through Real World OCaml
>>
>>52443421
>But Python is useful in ways Haskell is not
Could you elaborate? I'm thinking of learning Haskell too.
>>
>>52442507
you can do that, it's just borderline profoundly retarded in this scope
>>
>>52443444
nice trips
i also vape only in my room or in private
the nicotine improves ur focus, much like the caffeine in coffee works
>>
>>52443266
it's a meme you're dip
>>
>>52443481
Sometimes algorithms are most easily written sequentially. Python has order of magnitudes more libraries for IO (files, databases, network, etc.) than Haskell does.
>>
>>52443448
by blowing 9/11 smoke everywhere
>>
>>52443545
Yes exactly
But I'm also 2% hooked on it, so when I'm bored instead of browsing the internet I work because working = more nicotine
>>
thinking is too hard
time to jerk off and play video games
>>
File: random.png (7KB, 500x500px) Image search: [Google]
random.png
7KB, 500x500px
Made this in java today. Just playing around.
>>
File: cool.png (128KB, 500x500px) Image search: [Google]
cool.png
128KB, 500x500px
And this. haha
>>
>>52443567
should've used mspaint instead.

way easier
>>
just lerned c

what shhould i program now
>>
>>52443567
kill yourslef
>>
>>52443597
this
>>52441666
>>
>>52443596

Agree, but it teaches you how to use certain things in java
>>
>>52443597
you can't just learn c
>>
>>52443597
program how to learn c++
>>
>>52443624
mayb u cant ;D
>>
>>52441410
>tripfag
>having a good opinion
Pick one and only one
>>
>>52441410
go home OSGTP, youre drunk
>>
>>52443798

I haven't even started yet.
>>
can someone explain to me how mergesort works? this textbook is making my brain convulse
>>
>>52443805
What is even a gtp?
>>
>>52443948
Some really shitty car if I'm not mistaken.
>>
>>52441562
We don't want people plugging their shit in OP threads, it's a slippery slope.
>>
>>52443943
https://www.youtube.com/watch?v=EeQ8pwjQxTM
>>
is gpu programming fun in any way?
>>
>>52444002
You mean OpenGL?
>>
>>52443943
Go here anon. Better than any kumaryoutube video http://visualgo.net/sorting.html
>>
Please don't include that insufferable autist in the OP of future /dpt/ threads, it's triggering enough that he's in the sticky.
>>
>>52444039
Better than pedophile cartoons
>>
File: wk95_bbennett.jpg (26KB, 450x245px) Image search: [Google]
wk95_bbennett.jpg
26KB, 450x245px
>>52443948

It's a trim level for the Pontiac Grand Prix. Not the world's greatest car, but I have absolutely no regrets.
>>
File: lolicon aftermath.jpg (135KB, 833x1200px) Image search: [Google]
lolicon aftermath.jpg
135KB, 833x1200px
>>52444075
nah desu senpai
>>
How do I put the content of a file as an argument in lldb ?
>>
>>52444098
>Why did it only happen to meeee...
So she was raped and she's crying because other people didn't get raped too?

What a cunt.
>>
>>52444098
>aftermath
>after
>math

must be some pretty hard math homework.
>>
>>52444123
ikr? thankfully she ended up getting raped a 2nd time in the sequel and ended up killing herself
>>
>>52444039
>>52444075
You two can leave whenever you want
>>
Threadly reminder that you should not refer to the act of programming as coding. It is improper and makes you look like a 16 year old

You are a programmer, not a coder

Software Alchemist is GOAT
Developer is okay
Magician is okay
Software Magus is okay
Software Engineer is okay
Software Architect is okay
Code Guru is okay


Archmage is reserved for only the most senior of programmers

Writing in HTML and CSS is not programming, therefore it should be referred to as designing
>>
>>52444138
???

I'm not familiar with this.
>>
>>52444154
The comment about Stallman is right, I think we've all outgrown him to be honest.

X11 is the way to go when open sourcing your shit.
>>
is it hard to learn functional programming?
especially if im still pretty bad at oop
>>
>>52444160
what's the difference?
>>
Ask a programming illiterate anything
>>
>>52444160
Ninja is god tier. "I'm a HTML and JavaScript ninja guys, haha :D!!"
l33t h@xor, reserved for god mode programmers only. "you see anon, the '3's look like backwards 'E's, do you get it? clever right??"
>>
>>52444214
Stop shitposting.
>>
>>52444245
It's just a bit of fun anon. You can relax.
>>
Ask a literature programmer anything
>>
>>52444275
When are you going to kill yourself?
>>
File: 1452351559589.gif (131KB, 600x338px) Image search: [Google]
1452351559589.gif
131KB, 600x338px
>>52444245
It's not fun, it's bullying.

People that use JavaScript have feelings too.
>>
>>52444284
When the sun falls out of orbit and crashes onto earth
>>
>>52444286
there's literally nothing wrong with JS.
>>
>>52444275
I will when i find one
>>
>>52444014
I meant as in scientific shit / number crunching
>>
File: 1440610926811.jpg (2MB, 2915x1805px) Image search: [Google]
1440610926811.jpg
2MB, 2915x1805px
What are some good programming-related YouTube channels, /dpt/?
>>
>>52444289
You seem to have a very loose grasp of orbital mechanics there anon.
>>
>>52444317
You seem to have a very loose grasp of memes
>>
>>52444314
the google developers channel has some good shit
>>
>>52444177
Agreed, i can't wait till that worthless faggot dies, I'll be a happy man. He contributed nothing to technology and is a parasitic communist piece of shit degenerate.
>>
>>52444370
Stop false flagging, anon.

We've all grown out of Stallman, accept it.
>>
>>52444079
I bet that car terrifies jews.
>>
>>52444370
So much this. Stallman is a burden on OSS and society in general at this point.
>>
File: 1444522012132.png (286KB, 636x356px) Image search: [Google]
1444522012132.png
286KB, 636x356px
>yfw ALGOL has more appealing syntax than most languages today
procedure Absmax(a) Size:(n, m) Result:(y) Subscripts:(i, k);
value n, m; array a; integer n, m, i, k; real y;
comment The absolute greatest element of the matrix a, of size n by m
is transferred to y, and the subscripts of this element to i and k;
begin
integer p, q;
y := 0; i := k := 1;
for p := 1 step 1 until n do
for q := 1 step 1 until m do
if abs(a[p, q]) > y then
begin y := abs(a[p, q]);
i := p; k := q
end
end Absmax

https://en.wikipedia.org/wiki/ALGOL#ALGOL_60
>>
RIP my dog 2001-2016
;_;
>>
>>52444370
If you're going to false flag at least make it sound realistic.
>>
>>52444400
Ugh, I'm so sorry anon.

I'm dreading the day my cat finally dies. I grew up with her and I've known her longer than I've known any of my friends.
>>
Why do most IT and CS professors use IE?
>>
>>52444392
Looks absolutely awful
>>
>>52444400
RIP your dog

and RIP zyzz brah

never forget

zyzz lives on in spirit

we're all gonna make it brahs
>>
File: sh.png (579KB, 1600x2160px) Image search: [Google]
sh.png
579KB, 1600x2160px
Do you ever get the feeling you're too mature for 4chan, /dpt/?

I wish I had somewhere else to go.
>>
>>52444443
because they're technology illiterate

most professors aren't all that competent

"those who can, do; those who can't, teach"
>>
>>52444488
>weebshit
>too mature for 4chan
>>>/reddit/
>>
>>52444488
I hear reddit is pretty good.
>>
>>52444488
4chan makes you less mature, you're only too mature if you matured before coming here regularly.
>>
File: l.png (291KB, 533x698px) Image search: [Google]
l.png
291KB, 533x698px
>>52444502
See what I mean, /dpt/?

We're surrounded by retards.
>>
>>52444522
4chan ruined my life

true story.
>>
File: 1451206925244.jpg (132KB, 500x1200px) Image search: [Google]
1451206925244.jpg
132KB, 500x1200px
>>52444488
>>52444523
How about you quit beating around the bush and end your weeb life?
>>
>>52444314
Jonathan Blow's channel
>>
File: 1426024345231.gif (967KB, 490x367px) Image search: [Google]
1426024345231.gif
967KB, 490x367px
>>52442307
>>
At work, we're starting to finally move code to production. The prod box we're deploying to is a new box. It's not actually acting as the real prod yet, so there is less risk if something fucks up. The plan is to setup this new prod box and then switch over to it and shut down the old one.

The big struggle has been with security. Management has been reading a lot of articles about big security breaches at large companies and has instructed the admins to lock down the box. The problem is that they've locked it down so much that we can hardly do the shit we need. This entire week has been nothing but repeatedly running the program and putting in new permission requests when it crashes because it couldn't read a file or call some stored procedure. Repeat 100x time with the program only getting a tiny bit further each time.
>>
File: iio.png (614KB, 640x890px) Image search: [Google]
iio.png
614KB, 640x890px
I think I'll make a stack overflow account.
>>
>>52444568
How are they sandboxing it?
>>
>>52444632
Just through normal permissions. The application runs as a specific user. The user is given specific file permissions in Linux. The database login is given specific database roles.
>>
>>52441562
No. First it'll be you, then that faggot from reddit is going to start astroturfing again.

In any case good luck getting these thread clashing autists to add anything to the OP other than their shitty OP images.
>>
>>52441651
Thats not a calculator
>>
>>52444488
Yes. I want to make my own programming website but I'm afraid the script kiddies will pollute it if I link here.
>>
Java a shit
>>
>>52445122
no u
>>
Reading through C Programming, A modern approach (1st edition), skipping along at like 4 chapters a day for the first couple of days, a few exercises here and there, then I finish chapter 9, on a subject I already understood from what little reading up on C++ I did and oh my god, theres 3 pages of Q&A, and 2 and a half of exercises that are mostly "use an algorithm to return the right value in a function other than main" even though all the program does is call the other function once. How many times does it think it needs to tell me to pass variables back and forth?
>>
>>52442612
iirc that is the only way to do it in lua, but I haven't used lua in a long time
>>
>>52444930
The specifications didn't say it had to be a calculator.
Also, I looked on github and literally everyone solved this challenge the same way, they just threw the first 5000 digits of pi into a string literal.
>>
File: WhatToInstall.png (136KB, 1113x488px) Image search: [Google]
WhatToInstall.png
136KB, 1113x488px
Need to install a Java Development thing for a class, /g/uys...

I've never used Java...

What environment? I have 2 installers ready:
The lowest level NetBeans (SDK/SE/FX)
or BlueJ without JDK (just installed 1.9.0_66)

Also, is FileZilla a good FTP client? I never used FTP on my home dev server. It's just a standard EasyPHP 14.1 install
(on a related note... will FileZilla work with said install? If not, what will? I have no intention of removing EasyPHP, because I never had good luck with other WAMPs)
>>
>>52443458
Please respond.
>>
>>52445294
>suppose function f has the following definition
>int f(int a, int b) {...}
>which of the following are legal? (assume i is int and x is float
>i = f(83, 12);
>x = f(83, 12);
>i = f(3.15, 9.28);
>x = f(3.15, 9.28);
>f(83, 12);

they're all LEGAL right? just the last 3 are a tad stupid since 3 & 4 lose information, and 5 does nothing with it.
>>
>>52445456
jGRASP
>>
>>52445456
just install linux and openjdk-8-jdk
>>
>>52445456
IntelliJ
>>52445533
Nice triple dubs
>>
algorithmic cryptocoin trading
2nd profitable month, could make a basic living off it
used to be Python, rewrote much of it in Java
i like to think of dpt autists whenever the Java program generates profit :^)
>>
File: out.webm (286KB, 1920x1080px) Image search: [Google]
out.webm
286KB, 1920x1080px
>>
>>52445560
You'd be making more money if it was written in C.
>>
>>52445521
That... looks confusing as all hell.
Can I make it look like Code::Blocks or Notepad++?

I don't want a metric shit-ton of random bullcrap. Just a basic Java IDE.

>>52445533
No, this is a Solid State Drive, and I have like 45GB of Over-Provisioning.
I'm not adding Linux as a dual-boot, because it was incredibly annoying the last time I did that, and I don't use it for anything, so it's a waste of space.

>>52445552
I mean, that looks cool, but... something more... basic?


Does anyone just have an opinion on either NetBeans or BlueJ?
I just looked at their interfaces, and they both seem ok... I'm kinda leaning towards NetBeans, but does anyone know the pros/cons of each?

Like I said, just a basic one. Gets the job done, not too many frills.
If you all think both suck, I'll use IntelliJ, because that shows up with a black background.
>>
>>52445724
>bullcrap
it's ok, you can say shit on the internet

also, just install linux
developing software on linux is just so painfree and easy
unix systems were literally designed to be programmer friendly unlike windows
>>
When should you use the register declaration in C?
>>
Good morning.

I slept in again today.
>>
>>52445868
Never
>>
>>52445868
never
modern compilers ignore it
>>
>>52445776
I know that, but Linux is not USER-friendly.
I've tried Linux, and it doesn't do what I need it to do on a regular basis.

I'd personally like to make my own UNIX OS at some point, but the reason I don't use one atm is because the only halfway acceptable UNIX system on the market is OS X, and I'm damn sure not buying Mac hardware.
(I had considered a Crackbook, though... But Apple hardware is cocking shite)

Alright, I'm just gonna go with NetBeans, I think...
>>
File: MURRIKA.jpg (65KB, 540x405px) Image search: [Google]
MURRIKA.jpg
65KB, 540x405px
Is there a way to display an independent webpage within another webpage without using javascript?
>>
>>52445919
IFRAME
>>
>>52445901
>I've tried Linux, and it doesn't do what I need it to do on a regular basis.

And what's that?
>>
>>52445878
>modern compilers ignore it

False.
>>
>>52445924
Oh, huh
I guess I was looking up shit wrong
Sorry for asking a dumb question, I've never done webdev before
>>
>>52445878
>>52445934
You're both wrong.
>>
>>52445930
Internet, porn, and gayming
>>
File: WhyI'mNotIntoLinux.jpg (516KB, 2966x900px) Image search: [Google]
WhyI'mNotIntoLinux.jpg
516KB, 2966x900px
>>52445930
>pic related
>>
>>52445868
There's extremely rare scenarios in which the compiler might not be able to determine how often a variable is accessed and optimize it appropriately, so using register might help if the compiler decides to listen to you. Don't expect any performance gain to be portable, though. Also, you'll literally never run into such a scenario so it's pointless to worry about it.
>>
>>52446011
I don't see anything that can't be done with Linux
>>
>>52446011
Cirno is very cute.
>>
How do I learn about linking, compiling and all that other good stuff? I'd like to understand it more before I move onto an IDE or something.
>>
>>52441437
I wished for them to get hit by the ball
>>
>>52446146
Well, not nearly as easily. Not from my experience.

Windows Environment has by far the most tools available for modification.
(Most 3rd party sadly)
>>
>>52446262
>Windows Environment has by far the most tools available for modification.

LOL?
>>
>>52446011
Those both look awful
>>
>>52445294
>unironically reads a programming textbook
>gets upset that there's a few pages of Q&A and exercises

>>52445490
legal in C yes

>To this day, many C programmers believe that 'strong typing just means pounding extra hard on the keyboard.
>>
>>52446262

ironically, the sky is the limit for ricing linux. you should check out one of the rice threads on /g/

i was a little dubious about linux at first as well, and the initial learning curve was pretty steep coming from windows. right now i'm running arch, no DE, just a tiling WM, and my workflow is immeasurably better than it could ever be on a windows machine.

seriously, from a workflow perspective, linux is worth it just for the ability to use tiling instead of mouse-based UI bullshit.
>>
>>52446011
this nigga serious?
>>
>>52446011
I think he means that some VNs and shit do not run on GNU/Linux.
>>
>>52446273
>LOL?
Fuck it, fine.

I have no idea how to get all the damn features (or even know what they're called), and I only had experience with Fedora, Ubuntu, and RedHat (server/CLI) versions.

I'm not willing to give it a REAL try, because it's not GUARANTEED to do what I want it to do with little effort.

In addition, I hate the idea of the GPL. I don't mind freeware, but I don't like open-source.

But, I DO need Office with Visio for school, and THAT I'm pretty sure won't work on Linux.


Essentially, why would I get a full operating system that doesn't do basically EVERYTHING? Windows may have it's flaws, but it DOES do ALMOST everything.
Sadly, it's NOT UNIX. If they went with the Xenix instead of the .NET Framework, maybe it'd have been assloads better, but they didn't. They fucked up with bad code and .NET.

But, they still have over 9,000 times the software available on Linux, so I don't have to SCOUR every nook and cranny to find something I want.

>inb4: Afraid to try something new
You know what, yes. Pretty much. I'm not willing to give it a try without a Satisfaction Guarantee.

>Am I SATISFIED with Windows?
For the most part, yes.
>Was I dissatisfied with Linux?
Eh, I wasn't SATISFIED.

That's all there is to it. I'm not using Linux. I'll get a proper UNIX with official support that does fuck-everything, or else I'll MAKE one. But I won't use a cheap knockoff that doesn't even come with some Indian guy who can sort-of give me advice (not that I should ever NEED to do anything more than Google/Bing my question and search through the top 5 results... and yes, some of the crap I do on Windows DOES require more than that, which means it's NOT good enough... but Linux certainly isn't even close on hits...)
>>
>>52446539
>i don't like open source
nevermind
just stay on windows
>>
god what a horrible babby language

######python is a meme######
memetext = raw_input('Enter dank meme: ')

print(memetext)
memelength=len(memetext)

for x in range(1, memelength):
print(memetext[x])
>>
>>52446350
I mean, I DO prefer to use keyboard shortcuts to move around, but I won't go entirely mouse-free. That's not good... Especially for things like Photoshopping and precise audio/video editing.

>>52446495
Well, surprisingly, I haven't done many VNs...
I'd like to start at some point, though... maybe make my own, too...

>>52446454
Yes
>>
>>52446550
memetext = input('Enter dank meme: ')

print(memetext)
for c in memetext[1:]:
print(c)
>>
>>52441370
Hey /g/uys I'm on a bit of a stump here with this piece of python code that I'm working on.
import json

class Area:
def __init__(self, txt):
self.txt = txt
def __str__(self):
try:
object = json.dumps(self.txt)
area = [x["area"] for x in object]
area = sum(area)
except ValueError:
return "Invalid value"
except TypeError:
return "Invalid type"
else:
return str(area)

What I'm trying to do is get the sum of area from every json array or an error message with the help of using exceptions.
For some reason in the output instead of the sum of the area i get an error. Is it something to do with the order of my exceptions?
Please explain to my retarded self why when iterating through the json arrays it stops just before the json object, making the code handle it as an exception.instead of returning the areas??
Here is the helper function:
def areas():
a = Area('hello world')
b = Area('[a,b,c')
print('a =', a)
print('b =', b)

c = Area('[1, 2, 3]')
d = Area('["Hello", "World"]')
print('c =', c)
print('d =', d)

e = Area('[1, 2, 3, {"area": 123, "weight": 1000}]')
f = Area('["Hello", "World", {"area": 999}]')
print('e =', e)
print('f =', f)

g = Area('[{"height": 100}, {"size": 123, "weight": 1000}]')
h = Area('["Hello", "World", {"volume": 999}]')
print('g =', g)
print('h =', h)

i = Area('[{"area": 100}, {"area": 123, "weight": 1000}]')
j = Area('["Hello", "World", {"area": 999}, {"area": 1}]')
k = Area('[{"area": -1000}, {"area": 999}, {"area": 1}]')
print('i =', i)
print('j =', j)
print('k =', k)

areas()

Any help would be appreciated
>>
File: smiley-face-thumbs-up-14491322.jpg (27KB, 400x299px) Image search: [Google]
smiley-face-thumbs-up-14491322.jpg
27KB, 400x299px
>>52446588
>>
File: Screenshot_2016-01-15_21-59-59.png (8KB, 438x207px) Image search: [Google]
Screenshot_2016-01-15_21-59-59.png
8KB, 438x207px
>>52446550
Post 'em
import std.stdio;
import std.string;

void main(string[] args)
{
write("Enter dank meme: ");
string meme = chomp(readln());

writeln(meme);

foreach(i, ch; meme)
{
i != 0 && writeln(meme[i]);
}
}
>>
>>52446549
>not sure if sarcastic comment
But no, I do not believe that random user bases should interfere with the operating system itself.
Individual programs, fine.
Hacks, fine.
Mods, fine.

Best OS would be one that you don't NEED to hack or mod, because it's built-in when it installs.

The OS should have an API that's ready to mod, however, and offer every imaginable feature, but it should not have completely accessible source. I believe in code copyrighting. You don't HAVE to, but you should be ABLE to.
>>
>>52446602
python is absolutely disgusting kill yourself
>>
>>52446622
STAY
ON
WINDOWS
>>
File: s9luKoy.jpg (41KB, 312x500px) Image search: [Google]
s9luKoy.jpg
41KB, 312x500px
So I'm relatively new to java, but not programming in general.
Netbeans is attempting to make me VERY vigirously javadoc everything. Should I listen to it and javadoc everything it tells me to, or would that be excessive?
>>
>>52446630
thanks for the help anon.
>>
>>52446602
json.dumps converts an object into json text. Maybe you meant json.loads?
>>
>>52446622
You can copyright open source code you know.
>>
>>52446642
turn it off

>method getThing
>returns thing

yes it returns thing
>>
#include <stdio.h>
int main () {
int i;
char str[1024];

printf("Enter whatever: ");
scanf("%s", str);

printf("\n%s\n", str);
for (i = 1; i < strlen(str); i++) {
printf("%c\n", str[i]);
}
return 0;
}
>>
NEW THREAD!

>>52446698
>>52446698
>>
File: 1446962972638.gif (479KB, 320x240px) Image search: [Google]
1446962972638.gif
479KB, 320x240px
>>52446702
Dumbass
>>
>>52446602
I gave it a gander, but I don't remember how python works well enough to help much. My advice is to just throw a brief, but descriptive print statement after every line of that try block to help pinpoint where things are going tits up.
>>
>>524466
Oh crap sorry that was an old piece of code.
Here is what it is now
import json
class Area:

def __init__(self, txt):
self.text = txt

def __str__(self):
try:
objects = json.loads(self.text)
self.text = [x["area"] for x in objects]

except TypeError:
return "No areas"

except ValueError:
return "Invalid JSON"

except LookupError:
return "hello world"

else:
return str(sum(self.text))
>>
>>52446721
i did that and it fucks up just before it hits the dictionary parts in a json array. This only happens when the dict is not at the beginning of the code.
Anyone know why this happens?
>>
>>52446676
Yeah i fixed that but i still get the wrong output
Here's what i've got
import json
class Area:

def __init__(self, txt):
self.text = txt

def __str__(self):
try:
objects = json.loads(self.text)
self.text = [x["area"] for x in objects]

except TypeError:
return "No areas"

except ValueError:
return "Invalid JSON"

except LookupError:
return "hello world"

else:
return str(sum(self.text))
>>
>>52446769
>>
>>52446732
>>52446747
What the fuck is that
self.text = [x["area"] for x in objects]

part doing? Neither of us are smart enough to debug that, so you should try rewriting it in a way that's more clear.

Also, which error is it throwing?
>>
>>52446788
dumbass
>>
>>52446788
btfo
>>
>>52446784
Just ran it and it gave correct output.
a = Invalid JSON
b = Invalid JSON
c = No areas
d = No areas
e = No areas
f = No areas
g = hello world
h = No areas
i = 223
j = No areas
k = 0

What else do you expect?
>>
>>52446696
wew
#include <iostream>
#include <string>

int main()
{
std::string memetext;
std::cout<< "Enter dank meme: ";
std::getline(std::cin, memetext);
std::cout<<memetext << std::endl;
for(int i=1; i<memetext.length(); ++i) std::cout<<memetext[i]<<std::endl;
}

>>
Why did both new threads get deleted??

NEW THREAD
>>52446834
>>52446834
>>
Revised because I'm an idiot.
#include <stdio.h>
#define BUFF_SIZE 1024
int main () {
int i;
char str[BUFF_SIZE];

printf("Enter whatever: ");
fgets(str, BUFF_SIZE, stdin);

printf("\n%s", str);
for (i = 1; i < strlen(str); i++) {
printf("%c\n", str[i]);
}
return 0;
}
>>
>>52446838
Because you're posting before the post limit you utter retard
>>
>>52441370

public class Faggot{

String name = "";

public Faggot(String n){
this.name = n;
System.out.println( name + " is a fucking faggot");
}

}



import Faggot

public class Main{
public static void main(String[] args){
new Faggot("OP");
}
}
>>
>>52446838
You do realize this post is below the bump limit and on page 1.
>>
>>52446838
Thread still at page 1, don't need a new thread.
>>
>>52446850
what's the post limit?
>>
>>52446865
the title of the movie where the sandnigger said this is sparta
>>
>>52446865
310 like it has been for the past 6 months
>>
>>52446855
10 space tab

?????
>>
Absolute Beginner's Guide to C teaches you first how to sort two arrays (int custId{} and float custBal{}) with a bubble sort before it teaches you how to use pointers and structs. is that really bad?? because my friend who knows programming says the book is garbage but i've already worked through 2/3rds of it. the first two chapters teach you how to install and use code::blocks, but he told me to use vim and gcc in msys2 so i do that instead. only thing is i have to put fflush(stdout); before any form of user input for the printf("whatever"); preceding it to even show up in my shell.

i ordered 'the C programming language, 2nd edition' but ill probably finish this book before it gets here. meanwhile i have it in pdf form but i can't be fucked reading an entire book on a computer screen, i like to have a physical copy.
>>
>>52446814
for e and f i should get areas
.>>52446790
Sorry I was using list comprehension
Here's a screen shot and a simpler loop
>>https://gyazo.com/2c3410f78aee4a337f0e507e03144fda
>>
new thread
>>52446896
>>52446896
>>
>>52446871
911?
>>
>>52446874
so... we need a new thread now? it's past 310 posts and off page 1
>>
>/dpt/ is no longer allowed on /g/
>no new /dpts/ are allowed

PANIC
>>
Why the fuck are mods so fast at new /dpt/ but nothing else? Stop lurking /dpt/ and get back to programming!
>>
>>52446910
Yes
>>
>>52446898
e and f will trigger a TypeError on the list comprehension because in the elements they don't contain dicts, which is what the list comprehension expects.
>>
Mods stop fucking deleting the new /dpt/.
We're past bump limit.
>>
>>52446916
where will we go? what will we do?
>>
>>52446910
We don't "need" a new thread. Make a new thread when there's something to talk about.
>>
We can only blame the retards who couldn't wrap their head around the simple concept that the bump limit is 310, and not whenever they felt like it
>>
>>52446916
SHUT DOWN EVERYTHING
>>
>>52446929
But there are dictionaries in e f as well as i j and k
>https://gyazo.com/a8f6a388fce695c92a479fe41310c524
>>
main = putStr "Enter whatever:" >> getLine >>= \x -> putStr . unlines $ x : map (:[]) (tail x)
>>
>>52446959
I created a second thread because the first retard put the IRC in the OP.
>>
If this NEW THREAD gets deleted /g/ is truly dead.

>>52446984
>>52446984
>>
>>52446973
Jesus Christ of memetexts?
>>
>>52446990
Nah, I'm sure someone can do it shorter.
>>
>>52446970
[x["area"] for x in objects]

this expects that all elements in objects are dicts.
But,
[1, 2, 3, {"area": 123, "weight": 1000}]

will parse to int, int, int, dict. So it will complain when passed to the list comprehension, same for the rest that you mention.
>>
>>52447011
So what am i supposed to do? If i cant iterate through the list without having it act up before the exception phase?
>>
>>52447118
Add a filter.
[x["area"] for x in objects if type(x) == dict and "area" in x]
>>
>>52447155
Ok I see where you're going with this.
But now it's not exception handling the no areas part for c,d,g and h.
Would it help if instead of for x in objects, i use use for x in range(len(objects))??
>>
>>52447204
If you want more control on each cycle, then sure change it to a for loop, append the correct records to a list, and report on the exceptions.
>>
File: 006164073106.png (33KB, 707x861px) Image search: [Google]
006164073106.png
33KB, 707x861px
>>52447224
Hey anon thanks for the help!
This is the output i was trying to get.
Is the way i did it ok? Or is there a more efficient way
>>
>>52447497
I'd move the validation of each element on the parsed json to another function:
def validate_element(x):
if type(x) != dict:
print("element is not a dictionary")
return False
elif("area" not in x):
print("element does not contain key")
return False
else:
return True

[x["area"] for x in objects if validate_element(x)]
>>
>>52447615
Ahh right, that would make it so much cleaner.
How are you so good at coding and how long did it take??
I only know the basics of python at the moment and would like to learn how to make my codes more efficient. I heard by reading about Big-O it would make you a much more efficient programmer.
Is this true??
>>
File: memeText.png (1KB, 142x120px) Image search: [Google]
memeText.png
1KB, 142x120px
>>52446550
using System;

class MemeText
{
static void Main()
{
Console.WriteLine("Enter dank meme: ");
var input = Console.ReadLine();

foreach (var memeChar in input)
{
Console.WriteLine(memeChar);
}

}
}

Thread posts: 346
Thread images: 42


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