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

/dpt/ - daily programming thread


Thread replies: 313
Thread images: 35

File: object-hierarchy.png (24KB, 471x366px) Image search: [Google] [Yandex] [Bing]
object-hierarchy.png
24KB, 471x366px
git edition

old >>55375964
>>
>>55395402
First for D
>>
File: 1467570941060.jpg (517KB, 1521x1076px) Image search: [Google] [Yandex] [Bing]
1467570941060.jpg
517KB, 1521x1076px
12 posts too early edition


What are you working on, /g/?
>>
Hey /dpt/, I was wondering what the best way to terminate a python application when a certain key combo is pressed would be?
>>
Fourth for Rust
>>
Fifth for Forth
>>
>>55395502
I'm the guy who wanted to write a scheme interpreter. I finished the lexer and parser, so I'll get to start designing the VM soon. If I implement unhygienic macros and quasiquotation then I'll still be able to implement many of the syntax keywords in terms of others, and I can make it available to players since I have a good idea of how to break the evaluation up into interpreter steps.
>>
why do weebs gather in these threads?
what's the relationship between coding and being a goddamn faggot?
>>
https://forum.dlang.org/thread/[email protected]

I mean, this guy does bring up some good points, but I find it funny he was butthurt enough to make an account just to post this entire rant.
>>
>>55395502
Animu indexer.

Wrote my own simple decoder for Usenet articles since the one I was using was shit. Also changed the design after an anon on the /wdg/ hugely helped me with the styling.
Hopefully tomorrow I can start downloading a few thousand images for the series I've indexed, then I can start working on a proper API.
>>
>>55395402
Please delete this pajeet thread.
>>
File: it's a trap.png (873KB, 1275x677px) Image search: [Google] [Yandex] [Bing]
it's a trap.png
873KB, 1275x677px
>>55395854
calm down anon there's no point making a fuss at this point
old thread at 313 and we're 10 posts into this one
>>
So what do I do after learning the basics of a language?
>>
>>55395889
Is that language Haskell?
>>
>>55395782
Point 8 is cancer, he should be embarrassed of himself.
>>
>>55395929
It's nice that the D community is so normal and non-SJW that someone can go to their forum and post a dozen paragraph "your language is shit" thread without being banned

Much better than 4cha-
>>
>>55395921
I know the basics of c, c++, and python but don't know what to do now
>>
>>55395958
Unlearn Python
>>
File: Intro+to+Algorithms.png (244KB, 607x681px) Image search: [Google] [Yandex] [Bing]
Intro+to+Algorithms.png
244KB, 607x681px
I need the solution manual to the 3rd edition of Intro to Algorithms. Anyone know where I can find it?
>>
>>55395958
Learn the new C++ standards, they are pretty interesting.
>>
>>55395958
>>
I'm trying to grab a variable within a function within a class in python.

main file.
#!/usr/bin/env python

class Aclass():
def __init__(self):
self.returnPrint()

def returnPrint(self):
x=2
if x:
print("returnPrint function")
import second

Aclass()


imported file
#!/usr/bin/env python

h=__import__('__main__').Aclass.returnPrint

print(dir(h))


The imported file doesn't see the variable 'x' at all. How do I fix this?
>>
>>55395402
22th for Go is the best language/platform ever invented
>>
I'm making some simple stuff in PyAudio. I'm new to audio programming

How do you do real-time audio when you have this small buffer you have to constantly fill with a specified number of frames?

I tried setting up another bigger buffer but the audio thread keeps catching up and I get stuttering
>>
I was working my way through K&R and SICP last week, and finished all the exercises for the first chapter of each. Then got really lazy and did nothing this week. Want to change that tomorrow.
>>
Building a regular expression parser entirely in C.
So far it accepts ab, (a|b), a?, a*, a+,
I'm working on escape sequences and compound characters, e.g. "\d" or "[a-z]"
>>
>>55396114
Show code, senpai.
>>
I want to start getting used to .NET Core before work switches over to it - any ideas on console applications to start brushing up on it?
>>
>>55396029
Does python let you introspect a function to get the variables it uses? What kind of shit would that be? The variable x probably doesn't even exist until the function is run, and it will only exist until the function finishes and its environment is dead
>>
>>55395977
You can find it on google
>>
>>55396123
http://pastebin.com/RRRnEGeN
>>
>>55396160
Link? I can only find the 2nd edition solution manual.
>>
>>55396114
I hope you're using abstract algebraic structures like monoids and rigs for these expressions
>>
File: 1466390441961.png (319KB, 850x683px) Image search: [Google] [Yandex] [Bing]
1466390441961.png
319KB, 850x683px
>code has been running for more than 3 days
Is this normal for you guys?
>>
>>55396196
>Abtract algebraic structures
>like monoids and rigs for these expressions
This is C, not haskell... I'm building a state automata because that way it matches expressions quickly.
>>
>>55396197
Sounds like it's working
>>
>>55396197
Yeah, that's about the average length of time for most programs
>>
>>55396196
If rngs are rings without identity, are rigs rings without nullification?
>>
>>55396221
>state automata
Are you perhaps using a monad for the state or a comonad for the automata?
>>
>>55396239
rigs are rings without negation
also called semirings
i.e. no additive inverse (and hence no subtraction)
>>
>>55396243
those haskellers trying to put math in everything amirite? xD
>>
>>55396257
Ok, thanks. I know about semirings, but never knew that they could be called rigs.
>>
>>55396179
Hmm cant seem to find it now. I do have it on my home computer though. Ill see if i can find it when i get bqck
>>
>>55396243
Did you did you not read the part about using C?
>>
>>55396280
>>55396265

I really wish Haskell were better for this sort of thing, you can't for instance represent laws or show that something is an instance in multiple ways, or really provide a generic instance for ADTs
>>
>>55396320
C is turing complete
Idris compiles to C
Step up your game


but it would be nice if C had HKTs
>>
>>55396257
>calling inverses "negation"
What is this debauchery?
>>
>>55396341
additive inverse is called negation
no idea where that could have come from

but an indian invented negative numbers
>>
>>55396364
similarly the multiplicative inverse function is often called reciprocation and represented as f(x) = 1/x = x^-1
>>
>>55396223
>>55396225
Thanks for the reassurance anons.
>>
>>55396400
What's your program doing? Finding primes or something?
>>
anyone have any experience with web scratchers?
how do i circumvent ajax?
>>
>>55396326
Want Haskell with dependent types?

"Multiple instances" usually means using records instead of typeclasses, since one of the advantages of typeclasses is exactly that there is at most one canonical instance. Things like Map rely on this coherence to avoid bugs like using a different ordering on different operations. If you wanted to be able to require these instances to satisfy laws, then you would need dependent types just as you would need with a single instance.
>>
>>55396400
it could be just throwing exceptions and populating a log file without you knowing though, had that happen before. ¯\_(ツ)_/¯
>>
>>55396418
There's an alternative, which is to allow defaulting and priority exactly the same way operator precedence works, and allow explicit choose of instances like in Idris, e.g.
fmap#{instName}


Alternatively if you could just have something like
instance Functor MyType where
fmap1 :: fmap
fmap1 = ...

fmap2 :: fmap
fmap2 = ...

someOtherThing :: fmap
someOtherThing = ...

default fmap to fmap1

And other things that rely on something being a functor and optimisations and such can use this
>>
File: based nigel.png (440KB, 989x437px) Image search: [Google] [Yandex] [Bing]
based nigel.png
440KB, 989x437px
>>55396282
Please do. Thank you. Can any other anons find this? >>55395977 Also, check em.
>>
>>55395967
What do you mean by this? I'm learning Python as we speak. I might want to learn some C later.
>>
>>55396483
In these threads we only like obscure languages that no one actually uses for work.
If they have awful syntax and are verbose even better.
>>
>>55396145
last bump for this, sitting here idle. alternative is going outside
>>
File: 1448013225524.jpg (24KB, 679x579px) Image search: [Google] [Yandex] [Bing]
1448013225524.jpg
24KB, 679x579px
How old is too old to learn programming?
>>
>>55396541
12
>>
>>55396522
I still don't understand.
>>
>>55396409
It's solving the 2D gap equations for the magnetic orderings in the graphene QHE edge states as a function of magnetic field. My 1D code took about 1.5-2 days to run.
>>
>>55396571
Well then you must be doing something wrong.
Mine took only about 5 minutes, I'd recommend you to shut it down and reexamine your code.
>>
File: 1446260397401.png (755KB, 720x544px) Image search: [Google] [Yandex] [Bing]
1446260397401.png
755KB, 720x544px
>>55396648
Anon please
>>
>>55396571
What's it using to solve them? Logic or a genetic algorithm?
>>
>>55396834
Logic I believe. I derived the gap equations theoretically and then use a sort of root finding algorithm to find the orderings.
>>
>>55396878
What do the root algo's use?
Numeric or genetic?
>>
>>55396957
Numeric
>>
>>55396559
Sweet summer child, run away from this place before it's too late
>>
>>55396541
Never. Just buck up and read tutorials until it sinks in. It's just thinking and typing,
>>
>>55396969
Is there a reason it's taking so long?
>>
File: eaZrosc.png (363KB, 5000x5000px) Image search: [Google] [Yandex] [Bing]
eaZrosc.png
363KB, 5000x5000px
tfw .net wageslave
>>
>>55397030
I'm using Mathematica if that's relevant
>>
>>55397034
but the pay is so high ;_;
>>
>>55397054
Well that might explain it

Try doing it in C or C++ and run it simultaneously
>>
>>55397102
Why does Mathematica run so slow senpai?
>>
(.=) :: MonadState s m => ASetter s s a b -> b -> m ()


>Replace the target of a Lens or all of the targets of a Setter or Traversal in our monadic state with a new value, irrespective of the old.

What did he mean by this, /g/?
>>
>>55397275
assign a new value
>>
>>55397381
But Haskell doesn't support assignment
>>
>Tfw programming is too hard to make a good application
>>
>>55397422
monadic side effects
>>
>>55397470
I don't know what that
>>
I have to create an ASP dotnet core webapp for school, but I dont feel like starting. It's a simple task but I hate dotnet. I just want to pull the strings, I dont want to be pulled by dotNet.
>>
>>55396541
Never, unless you are burned out cunt who doesn't care about learning completely new stuff.
>>
>>55396541
I started at 24, I was NEET the whole time, year and a half later, after spending almost 10-12 h a day every day literally on tutorials and books and doing projects, I am full time employed abroad in germany with starting salary close to 120k/year
>>
>>55396464
I guess with dependent types you could also put the instance that was used (in the Map example) in the type, and only allow things (e.g. intersection) with Map whatevers that used the same instance/implicit?
>>
Haskell has implicit parameters, now please stop trying to ruin typeclasses.
>>
>>55397585
Can't ruin what doesn't work
>>
A 3D cheese pizza MMORPG in WebGL. Gave up on looking for loli / shota models and just shortened and flattened the tits on adult ones lel
>>
First for Python is the fastest.
>>
>>55397622
why do you keep coming back
>>
>>55397631
Fastest runtime failures
>>
>>55397657
It gives me lots of attention and butthurt from autists
>>
>>55397505
This is very encouraging. Thank you
>>
>>55397631
Ya blew it
>>
>>55397631
>first
>91st post
No wonder you like Python.
>>
>>55397674
it's basically spam at this point
>>
>>55397505
>I am full time employed abroad in germany with starting salary close to 120k/year
How did you get the job? need advice please ;_;
>>
>>55397659
No, Python's runtime failures are pretty slow too
>>
>>55397608
Oh, which non-issue are you going to complain about, I wonder? Gee, I can't wait to have to pass everything around by hand, just like in Scala
>>
>>55397481
You should learn some of the common libraries/abstractions before trying lens, in this case State and MonadState. "MonadState s m" means that "m" is a type constructor such that the type "m a" represents some computation that conceptually has some kind of state of type "s" in the background, which can be used to compute the value, or may be changed by the value. Here is the basic "State" type constructor, which you can easily make MonadState instances for:
newtype State s a = S (s -> (a, s))


It is a function that takes the current state, and outputs the requested value, and also the new value of the state. You can "get" the state by just giving the passed-in state as the result, and you can "set" the state by returning the new state in the state part of the output.

If you don't Monad/Applicative/Functor etc., you should learn those, since they are standard APIs for lots of things in Haskell.

So basically, if you specialize MonadState to use State s, you get something like

asetter .= newval =
S \oldstate ->
((), oldstate & asetter .~ newval)


It takes the old state, and sets the things pointed to by asetter to the value requested.

There are other types that satisfy MonadState, notably monad transformers, but maybe you made a custom type that manually keeps its own state and you gave it a MonadState instance to let it work with existing libraries.
>>
>>55397690
it's more relevant to the thread than crying about what's being posted.
>>
>>55395799
Link?
>>
>>55397730
specialize .= to use State s*
>>
How should I parse IRC messages in C?
I want a lexical analyser/incremental parser with BNF syntax, but I'm unsure how to accomplish this.
>>
>>55397750
whatever
>>
>>55397715
>Oh, which non-issue are you going to complain about, I wonder? Gee, I can't wait to have to pass everything around by hand, just like in Scala
>>
Im working on something in C++ and I need to create a pop-up that I can style, nothing too fancy.

What's the preferred way to do that? Would be cool to just embed HTML
>>
>>55397762
don't pout on me bbygirl *pinches cheeks*
>>
>>55397784
Stylish headwear, my man! However, I feel it suits you more than it ever could me.
>>
>>55397761
send format: (NAME ARGS :string)
reply format: (:hostname NAME ARGS :string)
that's the format for most messages.
i made an irc server (https://github.com/agrecascino/TinyIRC/blob/master/main.cpp) that has a simple parser, so you could check out that.
>>
>>55397761
I did it with regexp and I regret nothing.
>>
>>55397792
Qt
>>
>>55397824
http://irchelp.org/irchelp/rfc/rfc.html is also the best thing ever for learning the protocol, and every message ends with '\r\n'.
>>
>>55397505
Wow, very inspiring. Did you also learn about algorithms & data structures? Or just pure coding?
>>
>>55397792
Either use Qt/QML or use Electron and write your code in C++ as a V8 module then invoke it from there.
>>
>>55397856
How the fuck do you want to get employed without the knowledge of data structures and algorithms?
>>
>>55395515
x=raw_input("enter 'c' to terminate the program.\n\n")

if x.lower()=="c":
exit()
>>
>>55397874
see
>>55355930
>>
>>55397895
Oh, right.
>>
>>55397874
Well I don't know, my boy. It twas just a question that I smittened. Nothing farce, nothing fast. Good day to you, my good sir.
>>
I have the following URL:

site/auth/logout

Is it completely ass-backwards to use DELETE instead of POST here?
>>
File: Intro+to+Algorithms.png (262KB, 601x675px) Image search: [Google] [Yandex] [Bing]
Intro+to+Algorithms.png
262KB, 601x675px
Does anyone have the instructor's manual to Intro to Algorithms? I can't find it anywhere.
>>
>>55397920
DELETE (or possibly PUT) is better than POST here, because it tells the client that the action is idempotent and can be done multiple times (e.g. no "do you want to resend" prompt in browser).
>>
>>55395515
ctrl+c and catch the KeyboardInterrupt

>>55397886
>python 2.x
>>
>>55396021
Based Meyers
>>
>>55396029
>>55396151

first off, you have to actually instantiate the class. Meaning you have to assign it to a variable.

(this has to be in the file you run, not in your classes file)

Try doing the following instead of what you have now:

#!/usr/bin/env python
from folder import Aclass

myClass = Aclass()
print myClass.x

(for this to work you x = 2 has to be self.x = 2, that way you are setting Aclass's x attribute to be 2)
>>
>>55397935

It's in the gentoomen librrary
>>
>>55397856
actually, "coding" and programming language syntax was just 4-5 months at most, for several languages, when I just snapped and said to myself that this won't get me job, so I started learning patterns and algorithms mostly after that, and if I wanted to know something that I didn't about some lang or syntax concrete thing, I just google it.
>>
>>55398032
Only the 2nd edition, not the 3rd. Thanks though.
>>
>>55396197

Blame the library, call it a day.
>>
Scheme interpreter person here, I just realized that simple unhygienic macros wouldn't work even in very simple cases, like defining "let" in terms of "lambda", since lambda could be shadowed at the use site.
>>
>>55398083
I don't believe you Give us a sorting algorithm to sort an array in descending order without using one of the native Java libraries. GOOD LUCK NOOB

{3,1,6,3,7,1,6,4,2,6}
>>
>>55396541
Not sure, but I do know that it doesn't benefit to learn it during childhood.
I was learning C since about 12 years old, but I never understood it until I turned about 16-17 when my brain matured, and I'm still learning more even now at 19.
The important thing is that you develop a habit of programming.
>>
>>55398296
isSorted [] = True
isSorted [_] = True
isSorted (x:y:xs) | x < y -> isSorted xs
| otherwise -> False

sort x = (if (isSorted x) then id else (sort . shuffle)) x
>>
What country can you make the most money programming? How much less money would you make if you worked remotely (i.e., from home or you live in Thailand working on projects across the globe)? Would be nice to get my Bang cocked and make money.
>>
>>55398365
>shuffle
I M P U R E
>>
>>55398365
I said without using native libraries you have failed and therefore are a liar gg get rekt
>>
>>55397947
Good point, but what about cookies etc..?
>>
Is it difficult to compete with Pajeet's from Abu Dhabi or Chang Bong's from Chang Muay in the programming field? They'll work for $5/hr for H1B and have 3 Ph.D's from Balabala IT University, no?
>>
>>55398491
What about them?
>>
File: flag.webm (506KB, 1366x768px) Image search: [Google] [Yandex] [Bing]
flag.webm
506KB, 1366x768px
not really programming, but I finished my screen-recording script and my flag-hunting script.

Anyone has the programming challenge roulette? I've started learning Ruby, but I don't really know what to make: the only noteworthy thing I've wrote was a 4chan catalog searcher.
>>
>>55398449
quicksort [] = []
quicksort (x:xs) = quicksort small ++ (x : quicksort large)
where small = [y | y <- xs, y <= x]
large = [y | y <- xs, y > x]
>>
>>55398510
Only Chang because they are the best programmers
>>
>>55398526
That's my question.

I'm a bit green on how to best/securely log people out. Visiting a link with GET is unsafe, but a POST with a token works better. Visiting that link will clear the current session for my user.
>>
File: image.jpg (12KB, 474x473px) Image search: [Google] [Yandex] [Bing]
image.jpg
12KB, 474x473px
First for Haskell a shit
>>
Scheme interpreter guy again, I think I will use syntactical closure for the macro system, since they look not too hard to implement but still allow hygienic macros.
>>
>>55398649
it's breddy gud tbqh
>>
File: invaders.webm (634KB, 828x352px) Image search: [Google] [Yandex] [Bing]
invaders.webm
634KB, 828x352px
Little invaders script

I wanted to have multiple invader characters but my code needs cleaning up first. It's really sloppy.
>>
File: file.png (84KB, 1134x604px) Image search: [Google] [Yandex] [Bing]
file.png
84KB, 1134x604px
could I just have a tiny bit of help
been trying to figure this out for a while

what am I doing wrong here? I put this package in my build path and I can't seem to be able to import it
this is so bizarre
>>
>>55395774
>faggot
We don't speak about one another like that on this website, perhaps you got lost on your way to librechan.
>>
File: I_cant.jpg (241KB, 1010x778px) Image search: [Google] [Yandex] [Bing]
I_cant.jpg
241KB, 1010x778px
>>55398838
Show me something done it for scientific computing that is actually useful.
Protip: you can't, because its a shit language for doing babby tier shit and to make you feel better by making you think you're smart.
>>
>>55398964
here is the package btw

https://github.com/kwhat/jnativehook/releases

and it says to import it through org but the jnativehook doesn't even show up under that
>>
>>55398979
you have to google this specific problem it is most likely conflicting java versions of java 8 and java 7
>>
>>55399022
ok I'll try that thanks
>>
>>55398964
I think it's because you need to add the .jar to your build path and instead you added the .zip file that probably contains the .jar file.
>>
Finally starting to look at graphics library options for the chip8 emulator.

This piece of code still feels obscenely ugly there has to be more I can do to clean it up. I might just be obsessing over it.

    fn load_rom (&mut self, path : &Path) -> Result<(), io::Error> {
let mut f = try!(File::open(&path));

let mut data = Vec::new();
let size = try!(f.read_to_end(&mut data));

if size > 3583 {
let err = Err(Error::new(ErrorKind::Other, "Rom too large"));
let ret: Result<(), io::Error> = err;
return ret;
}

let mut y = 0;
for x in data {
self.mem.ram[0x200 + y] = x;
y = y + 1;
}
println!("Size: {}", size);
Ok(())
}
>>
Im in a bit of a pickle. I need a function to run after a call back. The function is part of a class say func. I made the callback function a friend. But I cant call func from the call back.
>>
File: happy pepe.jpg (71KB, 400x388px) Image search: [Google] [Yandex] [Bing]
happy pepe.jpg
71KB, 400x388px
>>55395502
>my oc reposted this soon
>>
Programming god here, post your university or college programming assignments and I will help you with it
>>
File: mfw.jpg (58KB, 528x792px) Image search: [Google] [Yandex] [Bing]
mfw.jpg
58KB, 528x792px
>>55399320
you're just jealous bc your oc is shit and no one posts it. pic related, more oc i made and i see posted around all the time
>>
File: 3.png (35KB, 738x665px) Image search: [Google] [Yandex] [Bing]
3.png
35KB, 738x665px
how does google verify in less than a second, (prolly in a microsecond) if a google account exists?

Don't they have to hash it first, send to servers, ...

i'm really confused...
>>
>>55399368
Very powerful hardware and extremely efficient infrastructure
>>
>>55399368
That could be made by a simple regexp, your "email" doesn't even has an @, or a .com substring in it. So there's no even need to send it to the servers.
>>
What's the best language to write a simple text editor in?
>>
>>55395774
http://www.phauna.org/papers/anime/anime.pdf
of course, you're also on a website that was created for the sole purpose of discussing anime
>>55396464
which is essentially the use of modules to perform the work of a typeclass and then using some kind of modular implicit for the default case. with first-class modules and some structure for applying args implicitly (like "using" in Idris) you could pick what module to use for something like Map without having to specify which Map to use (forming a partially implicit functor). I think OCaml's modular implicits branch has some form of implicit functor that solves this problem but I have yet to look into it
>>
>>55399368
I think that Google especially is an expert in fast searching.
>>
>>55399390
google interprets what's behind the @ automatically, so if you type "john.doe" it'll interpret it as "[email protected]"
>>
>>55399434
Oh, you're right.
>>
>>55399390
If you vaildate emails by checking if they end with ".com", you need to stop.
>>
>>55399469
I was assuming the ".com" because it was gmail.
>>
>>55399481
You don't need a gmail address to have a google account, you can use any other email address at registration.

Also, gmail allows you to use a custom domain if you pay them.
>>
>>55398529
link for the mascot?
how do you have the qr like this?
>>
>>55399518
https://i.imgur.com/BxJylsO.png
(I've got grayscale mode enabled in oneechan)

set "autohide style" to "vertical tabbed" in oneechan
>>
>>55399535
Thank you anon. Also, you have a good taste for waifus.
>>
>>55399055
you were right by the way thanks
>>
>>55399544
Shiina isn't my waifu, Yui Yuigahama is. Still, Shiina's a bretty good girl.

It was in the default oneechan mascots, iirc.

Anyway, does anyone have the programming challenge roulette?
>>
>>55395402
can someone make a new thread with the bird with the knife in it's beak /g/ is so boring rn desu
>>
>>55399561
http://better-dpt-roll.github.io/
>>
What should I read after pic related? I'm thinking of The C++ version and finally moving onto books that aren't intros.
>>
>>55399084
>This piece of code still feels obscenely ugly
That's because it's Rust.
>>
>>55399640
What does the "t." actually means? (English is not my first language btw.)
>>
>>55397505
I started out by finding a well known university and discovering their calendar was open, with all the lectures, so I started taking CS.

The university taught mainly C so that's all I did combined with The Unix Programming Environment Book.

After 3 courses I had a solid understanding of
- data structures in C
- how C abstracts the memory model
- assembly in x64 (Linux/BSD).
- binary/floating point/ect.

That's not enough to program shit. The Unix Programming book however I learned to use awk/sed/grep and that actually landed my first job since I could prove I could slice through nasty log files.

While I was at that job I started doing microcorruption.com which is all in assembly. Aced that and used it as a resume to apply to a security corp which hired me as an intern now all my courses are through them.
>>
>>55399691
it's a meme from /pol/ by Finnish posters basically which means "signed".

t. meme magic programmer
>>
>>55399691
terveseit, polish for "signed"
>>
>>55399729
No, in Polish it would be "podpisano".
>>
>>55399764
It's Finnish
http://www.wordhippo.com/what-is/the-meaning-of/finnish-word-terveiset.html

Rgrds,
Terveseit,
- Internet
>>
is there a programmatic way to disable all keyboard output when caps lock is enabled? Was thinking of something that might consume the event and would rather not dig into the registry
>>
>>55399368
Probably a local database for each server that only contains usernames (and maybe password hashes & salts if you also put in a password) to verify the username quickly, then proceed with the actual login process.
>>
>>55399779
On Linux you could just use xbindkeys to call xinput
>>
>>55399687

Honestly it's not too bad in comparison to my previous C / C++ experiences.
>>
>>55398973
Dunno, I use it for prototyping or writing small scripts. I've implemented textbook RSA in it, which I suppose is scientific and useful in some way.
I'm not an expert with the language, but I enjoy writing it.
Maybe you should try having some fun with programming some time again too.
>>
File: Intro+to+Algorithms.png (270KB, 589x662px) Image search: [Google] [Yandex] [Bing]
Intro+to+Algorithms.png
270KB, 589x662px
Does anyone have the instructor's manual to Intro to Algorithms 3rd edition?
>>
I made an optimizing brainfuck compiler.
http://pastebin.com/LqBwBGnJ
>>
When should I use something_t vs struct something in C? Is there any difference besides what's acceptable for the project at hand?

Curious because I see them intermixed in structs sometimes.
>>
>>55400214
Nice, have you thought of transpiling to C or LLVM, which may then be able to execute more optimizations?
>>
>>55400278
struct something a best
>>
>>55400302
I've thought of transpiling to C but that's too easy and boring.
I have not thought of transpiling to LLVM though, I might consider it one day.
>>
File: 1420500175412.jpg (438KB, 900x2134px) Image search: [Google] [Yandex] [Bing]
1420500175412.jpg
438KB, 900x2134px
What should I be learning after getting a little dirty with languages and structures? I didn't study CS, but I would have at least double majored in it if I didn't take the compulsory CS so late. There's architecture, algorithms, databases, cybersecurity, networking, operating systems, compilers, optimization, etc. I studied pure maths and took OS and architecture as electives, but I don't really know where to go from there.

I feel like starting from 0 and moving up from there. Python and C++ seems like a good combo.
>>
>>55400438

Depends on the type of projects you intend on doing. Mathematically you'd be better off with a functional language. It expresses programs closer to what you're used to. You did work with lambda calculus right?
>>
Post /dpt/ related movies and documentaries
>>
>>55400528
I did not. My school is very weak and I'm not saying I'm above it, even with the graduate math courses, I still didn't cover a good portion of maths.
>>
>>55400528
>>55400583
Also, I don't think I'm picking up any other languages right now. I'm sticking with C++, Python, and the C covered in OS. On what I want to do? I have no idea. Helping the emulating scene would be neat, but that's way out of my scope.
>>
>>55400438
You should learn algorithms and data structures, then you should learn about the Communist takeover of CS.

>>55400528
Real math isn't a bunch of incoherent bullshit like """"functional"""" "languages" are. Being popular with SJWs and Communists doesn't make something bad, but you have to wonder why real mathematicians don't use it.

>>55400583
That's because "FP" isn't really math. It's fake math that's part of a failed Communist plot from the 1930s.
>>
can I overload glfw callbacks? I need a function to run which I dont really have access too from the callback. Particularly resizing the window.
>>
So I have kept statistics over events where I use math to prediect a value, let's call it x. The problem is that there is another variable in the data called y, which affects x in some way I don't know, other than knowing a value of y over 1 will exponentially make x lower. How would I go about making a formula for how y affects x, with the data I have? Do I just guess formulas by looping through different values in them and see which one comes the closest to the statistics?

send help
>>
Compilers: Principles, Techniques and Tools should be renamed to Compilers: You won't understand a damn thing without the two erratas for the book, Using proper names for variables in code snippets would literally kill us and Enjoy a completely ridiculous difficulty curve on the exercises
>>
>>55400046
I was aiming at machine learning, but apparently haskellers are too preoccupied with muh types and muh monadic uslessness than real applications. You're doing ok tho, programming in haskell for the joy of it, and not because "it makes me smart 3hard5you".
>>
File: download.jpg (6KB, 190x265px) Image search: [Google] [Yandex] [Bing]
download.jpg
6KB, 190x265px
Going through this thing atm.
One thing that really bugs me about it is that it often gives me the (almost) correct answer with a really obvious flaw, then spends 2-3 pages confusing the fuck out of me by giving me obviously bad solutions until finally settling on the solution I thought it'd do from the get go...
>>
>>55400630

Well for the emulation scene you'll end up picking up a lot of information that is only used at the bare bones level (Op codes, chip interactions, etc) and a decent amount of parsing / compilation. It's not overly difficult project for the older systems (NES, Zx Spectrum, Chip8, Gameboy).

Just get used to data storage, basic logic operations, working with binary data, and loops. After that find and get comfortable with decent easy to use graphics / audio / input libraries (Make things like pong, picture viewers, etc). Then the final step is find all the information and data sheets you can on the system and model it in code.

I should probably mention that programming is a bigger bitch than advanced mathematics to learn
>>
>>55400583
he's memeing you, lambda calculus is an advanced topic that you wouldn't cover in a simple maths major
>>
File: Panic.gif (387KB, 269x270px) Image search: [Google] [Yandex] [Bing]
Panic.gif
387KB, 269x270px
>>55400806
>I should probably mention that programming is a bigger bitch than advanced mathematics to learn
It can't be that bad.

>>55400810
>>
Is he right?

https://www.youtube.com/watch?v=5-4hV9x-EtY
>>
>>55400806

>programming is a bigger bitch than advanced mathematics to learn
Programming is easy
Programming emulators that use dynamic binary translation is hard.
>>
>>55400863
why did you quote me

if you're the guy I replied to, then never reply to me or my wife's son with an anime image ever again
>>
>>55400880

Learning to program would imply gaining some level of mastery (Complete mastery is a impossibility).

Learning to just churn out code to get shit done adequately is easy. Learning to actual make maintainable clean code and to start working on new materials that haven't been rehashed 1000 times over is a real bitch.
>>
File: Mashiro dancing.webm (3MB, 720x405px) Image search: [Google] [Yandex] [Bing]
Mashiro dancing.webm
3MB, 720x405px
>>55400900
I'm sorry familia. I will never do it again, I promise.
>>
>>55400931
you can go fuck yourself, shitposter

why would you come in dpt asking questions while posting thread-ruining animeshit at the same time
>>
>>55400973
Anon, we can stop now. The only one that's ruining the thread is you.
>>
>>55400085
Am I in some weird hell where some one just keeps on asking this question?
>>
You're all fedorable.
>>
>>55401142

Nah, some desperate college student just wants to try and cheat on a shitty course that just has them do the problems in the book.
>>
JavaScript, Java, C++, and C# are all functional programming languages.
>>
reminder that underscores > camelcase
>>
>>55400788
>the machine learning meme
kys
>>
>>55401296
I'm not sure if this is post ironic general posting or unironic ironic shitposting.

[spoiler]I hope it wasn't because I'm learning them.
>>
>>55401298
No, they require more keystrokes.
>>
>>55401327
They all have functions as first class values.
>>
File: ec0936fe7f.jpg (10KB, 333x57px) Image search: [Google] [Yandex] [Bing]
ec0936fe7f.jpg
10KB, 333x57px
>>55395402
Just added a ctrl + shift + m command to toggle between the main player and mini player.

>>55401329
This desu.
>>
>>55401281
Gods, what a shitty course.
>>
>>55398886

Someone rate my webm I need replies
>>
File: Me with Chester.jpg (13KB, 236x335px) Image search: [Google] [Yandex] [Bing]
Me with Chester.jpg
13KB, 236x335px
>>55401142
>>55401281
No. I learn from doing the end of chapter problems. I'm not in school. I'm trying to teach myself programming. Now, if either of you kind gentlemen would kindly assist in my fruitful endeavor, I would be ever gracious at your generosity. Good day, Sirs.
>>
>>55401383
Why not just buy a copy
>>
>>55401395
>Why not just buy a copy

>Instructor's copy
>buying a copy

Well, I don't have a Ph.D, so they won't sell me one.
>>
>>55401383
I'm pretty sure someone already answered your question. I'm not going to spend my time to look for the book, so if you can't find it, you might have to buy it or rent it.
>>
File: 1466735226708.jpg (35KB, 564x428px) Image search: [Google] [Yandex] [Bing]
1466735226708.jpg
35KB, 564x428px
Where do I even start. I'm learning JS ok but I just feel like there's a shit ton of stuff I'm not learning.
>>
>>55401426
JS is a good start. You'll get there. Just take a bunch of tutorials, you can end up like this guy >>55397505
>>
File: 1466554161105.jpg (99KB, 426x640px) Image search: [Google] [Yandex] [Bing]
1466554161105.jpg
99KB, 426x640px
>>55401420
>Rent book at school.
>Scan all 800 pages
>Return it the next day for a full refund.
Fucking nerds didn't know what hit them.

When I was getting my books for med school I made the stupid choice of buying them instead of looking online, where they had them free.
>>
>>55401415

Is this not what you're looking for?

http://computerju.com/Materials/Algorithms/Introduction%20to%20Algorithms%20Instructor%20Manual.pdf

I've never read Intro to Algorithms so idk if this is right but that was the second search result for instructors manual
>>
>>55401426
If you wanna be a natty programmer, learn C, then move to a higher level language. (After grasping the basic concepts).
>>
>>55401426
You're not going to learn everything in one go. If there was a course that did that, most people would give up. What do you feel you're missing?
>>
>>55401420
Don't learn JavaScript, learn Agda first
>>
I took two semesters of Java, a class on discrete mathematics, and a class on computer organization.

What do I do? I have no idea what to make. I want to make something. Or contribute to something. What do I do?
>>
>>55401462
Command line blackjack and poker

Add networking for multiplayer
>>
>>55401448
Yup, I would also suggest he gets the book from their school if they're enrolled. But since they want the answers on a silver plate, there's nothing we can do. I checked too, out of curiosity, but someone already adequately answers his question.
>>
>>55401426
Don't learn JS, learn Agda first
>>
>>55401365
Would be pretty baller to create an image based on that, to use it as a wallpaper.
>>
>>55401486
Nope, I would suggest C0.
>>
>>55401502
Let's compromise and use Coq
>>
>>55401449
Thank you, young squire. But as another posted, this is the 2nd edition, in which I haven't an interest. Should you come across the 3rd edition, it would be highly desirable by me.

Graciously,

Lord Anon of Anonbury
>>
>>55401446
>>55401454
Thanks man, I don't want to be rich I just want to be able to make a standard 40k a year.

>>55401455
I'm not sure, but I just know I'm missing something, I feel like I'm learning multiplication before addition. Even though JS is pretty simple.
>>
>>55401520
Thou art but a slimy toad. Thou runnest amok in this thread, and we shall brook no further insolence. Begone, pitiful begging knave!
>>
>>55401530

Nearly half of college graduates are being forced into jobs that don't require a degree. There are projections saying there will probably be a big global crash / collapse of the economy. You're expecting to get a $40k year job in this environment?

If you're lucky it can happen.
>>
>>55401608

Oh and I should note that in most major cities $40 k a year is enough to be full on poverty or bordering it.
>>
I want to make a contribution to 4chanX. Where do I start learning whatever the fuck language that was built in?
>>
In c++, if I inherit from a class, can I change the friend functions in the class if I make them virtual?
something like
class foo
{
private:
friend virtual int func(){return 5;}
};

class boo : public foo
{
private:
friend int func(){(return 6;}
};
>>
So I'm making a videogame and I was thinking that maybe for the sections where there's this reverb effect i should somehow reverb all the users sound, like music in the background or VOIP. That'd be pretty cool right? Those who are concerned are would turn reverb off anyhow.

But I'm not sure how to do that? Is there a way to get a OS-wide directsound object on windows?
>>
>>55401643
I don't bother learning about C++ details. Try it and report back results.
>>
>>55401626
40K is middle class in my city.

But yes I do expect to find a job like that, I don't plan on getting a degree, at least just a bullshit one in science.
>>
>>55400880
>programming is easy
Try mastering APL in a week.
>>
>>55401691
J is refreshingly simple. How's it compare?
>>
Got an onsite interview in a week. Just doing coding exercises.
>>
Posting this again from /sqt/... So I'm new to designing web-pages, and I was wondering how I could link to an RSS feed such that it would look like pic related...

So far, I have the following code, but it doesn't seem to actually link to anythiing:
      <link rel="alternate" type="application/rss+xml" href="http://www.wired.com/rss">Click Me!</link>
>>
>>55401255
this
bunch of "elite" NEET faggots ITT
>>
>>55399623
Algorithms and Data Structures.
>>
>>55401750
Frankly looking at DPT they're certainly more elite than what i seen from industry programmers.
Most have absolutely no idea how to structure programs to make them easy to modify.
>>
>>55401747
You need the href attribute
>>
>>55401785
Really? To me most of /dpt/ is fumbling around in the dark and thinking they're too good to use the lights
>>
WHAT THE FUCK DO I CODE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
>>
>>55401785
>certainly more elite
How can a group of idiots who can't even write a FizzBuzz be "elite" programmers?
>>
>>55401789
...But it is on there next to the type attribute
>>
>>55401801
Reinvent the wheel.
>>
>>55401801
Sort the color of an image so that the difference from pixel to pixel is minimized.
>>
>>55401801
A Doomsday Machine
>>
>>55401785

Not saying much when the average industry programmer has more incentive to make unmaintainable messes (Less likely to get fired, harder to find someone willing to clean up the shit hole).

Also, dpt tends to be hobbyists who actually want to be better rather than just do enough to get the paycheck and attempt to meet dead lines..
>>
>>55401798
>>55401805
Well you have to look at the githubs that are posted. And you can't really judge code by 'averaging ints' or the Fizzbuzz. Also people learning like >>55401643
would probably not be a good measurement either.

So I'm excluding quite a few people here.

But from what I see of non-dpt it's so frequently people who stick to principles far too much, like making OOP their life is probably the most common problem. Pretty much any place where there isn't OOP (becuase it's forbidden or they don't use languages like that) is heaven.

I've had a look at a electrical coal plant filter electrical filter system (you ionize particles in the filter and attract them to large plates which are then cleaned). And the code was really sweet despite it being clear they weren't good at writing C (because they're not that type of engineers, they're focused on other things). I could still work with it. I imagine the equivalent to be an absolutely unworkable mess you can't follow at all without weeks of looking at it.
>>55401856
Yeah I've considered if it's intentional. Maybe good programmers get fired?
>>
>>55401864

Good programmers write code that can be maintained by cheaper bad programmers. When management realizes this they get rid of them.
>>
>>55401864
OOP truly has a lot to answer for.
>>
>>55401893
Well we can't draw this conclusion yet.
>>
>>55401905

Well it is anecdotal. I won't name call but I've literally been told in interviews that "we want a good American programmer to write the initial code base so we can outsource code maintenance"
>>
>>55401977
>I won't name call
Please do. Why not?
>>
>>55401995

Because those interviews don't necessarily reflect the company practices as a whole. They could be just that specific team / section.
>>
>>55401643
So it looks like friend functions cannot be virtual. Can I override or overload the friend function then?
>>
>>55402025
A friend function means the function can access private fields of that class.
friend virtual int func(){return 5;}

Means that a function named func() which takes void and returns an int can access the member fields. It's not really part of the foo class.

See what happens when you do foo::func

But realize that unless you find OOP to be incredibly nice except for this, this is a good sign that you shouldn't be using OOP.

Is it not wiser to just friend the entire class though?
>>
>>55402086
Well what I have is a bit more complicated. I have a program but dont really want to change the source too much. Only add to it. Thing is I need to use a friend function in a class to call a function in another class. Looking into if this is possible without editing the current solution.
>>
>>55401897
OOP lets even low IQ non-white people create useful products. Some people have a problem with that.
>>
>>55402166
>anti-OOP is racist
Yeah right..
I'm confident anyone who tries to write anything not OOP would succeed once they learn how to.
>>
>>55402181

Oop is going to become less common as we need more parallelization. Mutable state / Side effects is very big in oop. Both make programming parallelized applications painful.

All of these big database / search / calculation / distributed applications are within the problem domain that functional languages perform well in.

Oop isn't going to disappear anytime soon. It's just going to slowly become less prevalent.
>>
>>55402254
Functional programming has big issues too right now. Memory is slow and without the ability to express how to use memory that most imperative languages allow you to you run into issues.

I think. I'm not gonna say I've written anything significant in a functional style. But I have trouble imagining translating to functional without issues.
>>
>>55402282

It isn't necessarily going to be a transition to functional languages. It's going to be more of a transition to functional paradigms / patterns in code / languages.
>>
>>55402326
I doubt that. OOP came about because of Java and later C++.
If something is gonna change it's going to be because of a imperative language with good functional support in conjunction with talks and such on the importance of parallelism.
>>
>>55402355
A lot of languages nowadays let you program in a functional style.
>>
Daily reminder you are all shit at programming
>>
>>55402386
Yeah but they don't support functional programming well usually. You rarely have imperative languages have a 'I don't have any sideeffects'-keyword that ensures there's no sideeffects so it can do all the fancy functional stuff. Many languages don't even do the fancy functional stuff at all or well.
>>55402391
Rude.
>>
>>55402391
I might be shit but still better than you ;^)
>>
>>55402411
>He thinks OOP is bad
>Noob
>>
>>55402431
My cat is even better at you than programming please
>>
>>55402254
>>55402282
https://en.wikipedia.org/wiki/Lighthill_report
>The report stated that functional programming researchers had failed to address the issue of combinatorial explosion when solving problems within real world domains. That is, the report states that functional programming techniques may work within the scope of small problem domains, but the techniques would not scale up well to solve more realistic problems. The report represents a pessimistic view of functional programming that began after early excitement in the field.
This is why they don't want FP to be tested. The original said AI, but it's the same ideology created for the same purposes. AI (symbolic AI) was becoming mainstream and failed because it didn't work.
>>
>>55402355

I doubt if anything will really change in java (It needs to go the way of COBOL). C++ is already gaining more support for a functional style of programming. Just look at the changes introduced in c++14 and the proposed changes for c++17.
>>
>>55402451
>C++ is already gaining more support for a functional style of programming. Just look at the changes introduced in c++14 and the proposed changes for c++17.
Yeah, now I have to find a new language because they're ruining it.
What language is most like C++ but is not planning to dilute itself with the functional paradigm?
>>
>>55402432
Perhaps I'm not explaining myself well. We want a keyword that tells the program that 'this set of data is touched by this function and aside from that there's no side effects'. Essentially. Then you would have the compiler check that there's no accessing of that data (assuming bounds checking and no arbitrary pointers like char* p=0x232;).
That's what you'd want, at least according to what little i've thought of it.
>>55402451
I don't want to use C++. It's always going to be very hard to build software well on a project which uses a language where students are being taught bad programming.

I'm also not talking about changing Java. I just said that OOP was popularized by Java. We need a similar thing for this 'new' style.
>>
>>55402411
>You rarely have imperative languages have a 'I don't have any sideeffects'-keyword
PL/I had that with the normal, abnormal, reducible, irreducible, uses, and sets attributes.

It wasn't something bolted on either. It was in the 1964 NPL manual.

Now you know one of the reasons why universities don't teach those old languages anymore.
>>
subject-oriented programming with elements from logic and functional programming is the future
>>
>2016
>Not having a team of pajeets to program for you

What is your excuses?
>>
>>55402565
You really think there's anyone here that doesn't work for a company that does outsourcing?
Excluding hobby programmers.
>>
>>55402449
>https://en.wikipedia.org/wiki/Lighthill_report

Your citing a study from 1970 on Artificial intelligence.

First of all here is a better source http://www.chilton-computing.org.uk/inf/literature/reports/lighthill_report/p001.htm

Second of all we have done pretty much everything in Category A.

As for category B we're on the road to fulfilling it. Some of it is being done. Others are still in development.

The final point is this is a paper about AI development.
>>
New Thread:

>>55402595
>>
>>55402576
All my co workers outsource all the time even the manager too so much bad code I don't even know anymore. The most fun is to change and correct horrible code
>>
>>55401691
APL is an interpreted language from the 1960's. It's dead for a good reason.

> R∘.×R←1↓ιR⍋∘.⌽⊂⍵

kek
>>
>>55402670
My English teacher said he used to program in APL
>>
>>55401747
>>>/g/wdg
Thread replies: 313
Thread images: 35
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y / ] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
If a post contains illegal content, please click on its [Report] button and follow the instructions.
This is a 4chan archive - all of the content originated from them. If you need information for a Poster - you need to contact them.
This website shows only archived content and is not affiliated with 4chan in any way.
If you like this website please support us by donating with Bitcoin at 1XVgDnu36zCj97gLdeSwHMdiJaBkqhtMK