Previous thread at >>52134175
What are you working on, /g/?
>>52138631
somebody helper me?
>>52138645
old thread isn't even at bump limit you stupid nigger, delete this.
>What are you working on, /g/?
on your mom lol xD
>>52138674
it's either this or you get traps
>>52138680
are we still in elementary school?
>>52138680
ahahaha go back to reddit please ahahaha
>>52138687
You can always post a non trap anime or a respected computer scientist.
https://strawpoll.me/6398631
>>52138645import faggot
print "op is a faggot"
You're alright, OP.
Pepe is always acceptable.
Ignore the memeophobes.
>>52138720
Why does /dpt/ prefer the static meme?
With dynamic it just works, you don't have to worry about type conversion or anything.
>>52138789
It's unsafe
>>52138720
Static strong is clearly the superior option. This is no contest.
>>52138789
dynamic typing can be hell to work with for any sizeable application
dynamic typing is for scripting shitters that have too short of an attention span to be able to write rigorous syntax
>>52138811
Not using a condom is unsafe, but at least it feels good.
>>52138789
Because /g/ is retarded and likes to reinvent the wheel. Meanwhile based John McCarthy already knew 50 years ago the way to go is dynamic.
>>52138789
https://www.youtube.com/watch?v=20BySC_6HyY
>>52138667
map ::(a -> b) -> [a] -> [b]
foldr :: (c -> d -> d) -> [c] -> d -> d -- not 100% sure
We are map, we have to call foldr
> what we return?
[b], so the d when we call foldr should be something similar to [b]
> what do we iterate on
[a]
> what happens when argument is []?
> so what swiss quality precision crafted little c -> d -> d function should we pass foldr so it all works out?
U welkom
>>52138854
Whereas dynamic typing feels bad and it's ALSO garbage.
>>52138854
And it's fine as long as your pull out game is strong, but most cum inside anyway.
>>52138789
Look at PHP/JS truth tables.
>>52138916
These are pretty easy to understand. Sorry that you're retarded m8.
>>52138826
>dynamic typing can be hell to work with for any sizeable application
citation needed
>>52138929
>missing the point
>>52138916
Which is perfectly fine if you just use ===.
Type coercion has its uses.
>>52138946
assburger diagnosis needed
>>52138946
Not him, and generally a proponent of dynamic typing, but he is correct. Long running applications where portions of code aren't touched for long periods of time won't reveal possible type errors until they run after some period of time. This is one of the reasons why unit tests are important.
>>52138973
citation needed. where your studies backing your claim, fella ?
>>52138954
>Type coercion
Explicit type coercion, yes. Implicit no. Implicit type coercion only exists for muh simplicity. I really can't think of a use case where it's contributions aren't just to save you from typing an explicit cast.
>>52138988
You made your claim first buddy. Provide yours first. If you are going to be a shithead about this then fuck off.
>invasion by leddit in the morning
>dynamic typing is now justified
>>52138789
Static typing is what I would use for anything that needs performance or assurance that it works. With a good type system you can even formally prove correctness of a program or prevent security flaws.
Dynamic typing is comfy for small scripts, configs for large programs, and prototyping large applications. But it's not the right tool for the job when you're making something for real. (And I'm not even talking about JS style dynamic typing, I mean the Lisp kind that's basically a static type system with a bit less rigidity, only delayed to runtime).
The static meme is for autists who like to feel in charge.
Dank meme bro
C++: friend or get() methods for classes? Personally like using friend.
hey /dpt/, what is the best language to make video games in?
>>52139061
dynamic typing is for normies and ADD kids that can't think straight
Reminder that we made it big time on Reddit.
https://www.reddit.com/r/ProgrammerHumor/comments/3yoh4a/dpt_on_operators/
>>52139137
PHP
>>52139052
>needs performance
This is implementation. Java is statically typed but interpretted (JIT'd nowadays).
Catching type errors before runtime is static typing's advantage over dynamic. The rest is implementation.
Ask your beloved programming literate anything.
>>52138789
>>52138811
>>52138813
>>52138826
>>52138888
>>52138946
>>52138973
>>52138988
>>52139145
Friendly reminder that everyone who tried to find empirical evidence about static typing > dynamic typing (or inversely) has failed. Only a programming illiterate would argue/respond about such a thing.
http://danluu.com/empirical-pl/
>>52139150
Hi mom!
So Reddit really is a joke.
>>52139022
Dynamic typing is just too superior. Far superior programmer productivity, therefore less costly for companies. Better for code reuse. Allows dynamic behaviour, like generating methods and properties on-the-fly, much easier, allowing to implement things like ORMs with ease. It's what makes the web run too. Using static typing for anything besides low-level systems programming is almost like using assembly at this point.
>static typing is the best because it stops me from being retarded
>>52139137
Javascript, and I'm serious here.
How good is C# for a first language?
>>52139171
>pl shitting
Look, your fancy theory and whatnot is immaterial. The truth is that strong static is best typefu.
>>52139192
I haven't seen that Pepe before.
+1
>dynamic typing plebeians who have never coded anything outside of fizzbuzz
lol
>>52139232
Take it, it's all yours, my friend!
>>52139186
>It's what makes the web run too.
Now I know why every 'web' thing runs like shit.
>>52139168
I'm not taking about Java. Static typing is better for performance because you never need to check if the types match at runtime. Plus, you can let the +, -, *, /, etc. operators map directly to a single instruction which is a huge optimization over what most dynamic languages do.
>>52139261
Desktop software with static languages is so much better.
>>52139223
Shit
>>52139297
What is good?
>>52139271
>I'm not taking about Java.
It's an example.
>Static typing is better for performance because you never need to check if the types match at runtime.
Theoretically yes. And theoretically there are many optimzations a dynamic runtime environment can perform that a static copmilation can't, this is partially the advantage of JITs.
>Plus, you can let the +, -, *, /, etc. operators map directly to a single instruction which is a huge optimization over what most dynamic languages do.
Dude... do you know what implementation means? I've said it like 5 times now. But yes, these methods must be discovered at runtime instead of at compile time in a dynamic environment. Inlining is the main reason static compiled code is still faster than JIT'd dynamic code.
>>52139292
>v8 engine
>desktop software
Ayyy web dev.
>>52139339
>I don't know what desktop software is
ahahahahahah
>>52138720
I prefer no typing/only arbitrary bitstrings I can interpret as whatever I want.
>>52139319
Python. If you have problems with python you're doomed to a nodev life.
How do I learn HTML?
>>52139370
first you have to look like the guy in your picture
>>52139370
codeacademy.com
>>52139370
YouTube.
>>52139261
>Now I know why every 'web' thing runs like shit.
No, thats because Javascript evolved as a language rather than having strict and well defined standards so it carries the cruft and quirks of 20+ years of development by a hodgepodge of competing developers.
its not too bad though. the language without anything to do with the DOM of a webpage is snappy and doesnt carry many headaches.
>>52139186
>Far superior programming productivity
than what? surely not languages with type inference
>therefore less costly for companies
until a bug comes up that's literally impossible to track down because you used a dynamic type system that doesn't even warn you when types are being coerced in some stupid way.
>Allows dynamic behavior, like generating methods and properties on-the-fly
so does any preprocessor or macro system, and they do it with better performance too
>allowing to implement things like ORMs with ease
this can be done at compile-time if you have good metaprogamming. Also, F# type providers are fantastic for this.
>It's what makes the web run too
All the big companies have started to abandon dynamic typing in their backends (and, more recently, frontends as well). Ever wonder why Google made Dart and Go and Facebook made Hack and Flow? Or why all these new JavaScript alternatives have started popping up?
>>52139395
>the language without anything to do with the DOM of a webpage is snappy
[citation needed]
I prefer dynamic typing.
I prefer static typing.
>>52139415
There is a reason React is orders of magnitude quicker than other frameworks. I'll let you guess first.
>>52139471
Prove it faggot.
I have no strong opinion either way.
>>52139370
>>52139416
>>52139435
>>52139501
It's funny because you're making fun of the most vulnerable. Hahahaha hilarious.
>>52139471
http://benchmarksgame.alioth.debian.org/u64q/javascript.html
>>52139575
I don't see what this proves? JS is bad, we know.
>>52139583
Anon claimed JS is 'snappy'.
How would I check an ObservableCollection for the existence of something?
I want to check my list of files up against a directory and see if new files have been added or not. I was considering just creating a brand new ObservableCollection then joining them, but that would essentially defeat the object by being a massive performance sink, I'd be better off simply generating a new list from scratch and being done with it.
There must be a way but I'm clearly not aware of it.
>>52139561
tumblr pls go
>>52139575
>>52139583
>>52139595
at the bottom, click "vs Python"
this will give more meaningful results since both are dynamically typed and interpreted.
>>52139137
C++ is the only serious answer
>>52139575
>first few ruby tests
Just fuck my CPU up senpai.
How do I learn how to get and parse sites in python? Say I wanted to make a 4chan thread downloader.
Dynamic typing is great because it allows you to reason about the programs you write.
For example, for any dynamically typed program you write, you know for sure that it's shit.
>>52139192
>dynamic typing is the best because i cannot into types
>tfw I fix an annoying error in my code
>>52139595
Artificial benchmarks aren't a good measure of 'snappy', they are number crunchers usually. I'm sure for normal applications JS is 'snappy', it's subjective. If you want to see a fast dynamic language
http://blog.carlesmateo.com/tag/luajit/
https://gist.github.com/spion/3049314
>>52139192
do you want to catch type errors at compile time or at run time?
>>52139621
try looking at beautifulsoup? its a python lib for parsing and extracting data from html
>>52139186
kill yourself
>transpile my dynamic language code into a static language
WHAT NOW NIGGAS?
>>52139645
>>52139585
>>52139416
>newfag ledditor discovers ancient tard pics
>>52139621
>>52139650
You should be using the 4chan APIs, not scraping the HTML directly.
https://github.com/4chan/4chan-API
On a related note, this thread is off to a rousing start about typing, yet again.
>>52138789
>you don't have to worry about type conversion or anything.
Yes you do, just as much as in static typing in fact.
dynamic typing advocates *invariably* do not understand the basics of type theory.
>>52139647
Computers in general are number crunchers. Binary trees are real world problems. Kill yourself web dev.
>>52139677
>skiddie trys to validate his authority on 4chan by berating a nice poster.
>>52139648
I don't make type errors so this is a pointless question.
>>52139677
newfriend thinks 5 years is ancient
>>52139687
i just saw parsing site markup and it didnt click that 4chans api would be better.
>>52139701
>I don't make type errors
no because all you do is make broken webshit and shitty little scripts
fag
>>52139715
>assburger doesn't know what hyperbole is
at least you know they're 5 years old
>>52139701
I am 100% sure that you do. And you're either lying or you don't know what constitutes a type error.
You've never seen anything like
>Uncaught TypeError: undefined is not a function
in your own code?
>>52139708
nice meme kiddo.
Threadly reminder that Haskell is a useless, shitty language and if you use it you should go back to leddit.
>>52139370
This should be OP image from now on tbqh.
Maybe shop a copy of SICP on his desk.
>>52139671
you can actually add some compile time type safety to JavaScript by compiling it with the TypeScript compiler.
>>52139722
The primary reason you use APIs is so that data presentation and ingestion is standardized, so your code doesn't completely shit the bed when the website has a small change to the HTML.
Python is even easier to work with JSON. Pretty sure I saw some anon post an example of pulling a thread in like 8 lines or so.
If you could go back in time and make one change to programming, what would you do?
I'd kill dynamic typing before it ever became a thing.
>>52139722
Oh, I'm >>52139770
I see you were just offering advice to the other anon who mention parsing the markup.
Disregard last.
>>52139783
Why are you so mad? Are you autistic?
>>52139783
Same.
Though I'd also want to kill nulls. Honestly nulls cause me more problems in my work than dynamic typing. I can avoid dynamic languages, but nulls are in everything.
http://www.infoq.com/presentations/Null-References-The-Billion-Dollar-Mistake-Tony-Hoare
>>52139751
>should go back to leddit.
Why do you continue to beat a dead horse?
>>52138645
dumb frogposter
>worrying about static vs. dynamic typing instead of just not allowing variable mutation in the first place
>>52139800
>wanting to change programming for the better
>must be autistic
k
>>52139827
No. I'm implying you are throwing such a fit about something that isn't that much of deal because you are autistic.
Daily reminder that if your language of choice is not on this list you should probably give up and kill yourself:
- C++
- C#
- Lua
- Python
- Elixir
- Haskell
- Bash
- Clojure
- D
>>52139859
Add JavaScript to your list senpai.
>>52139827
>>>52139800
>wanting to change programming for the better
>can't come up with new paradigms and criticizes the existing ones
Whatever, autismo.
>>52139859
kill yourself
>>52139877
kill yourself
>>52139859
Add PHP to your list senpai.
>>52139783
Kill everyone who wanted to move away from programming everything in assembly.
>>52139783
I'd kill the UNIX meme and make all LISP-based.
>>52139800
The post you quoted was my first post in this thread. I just saw people talking about dynamic programming and thought of asking that question.
Not all of us are "full MEAN stack enterprise javascript css html code ninjas who must also be skilled in ror and python"; Some of us do real work and don't like dynamic typing.
>>52139859
Remove Haskell from that list.
>>52139889
>kill yourself
Well that is very gentlemenlike. Is that how you talk to all the ladies?
>>52139121
I like using getters, because I can't make friends.
>>52139783
Id show rasmus the cruft in PHP so he can nip it in the bud and make a nicer and cleaner set of functions from the get go.
>>52139899
True desu. I'm sure enough libraries would have come around that development wouldn't be that much worse than C is currently (if the asm language wasn't shit).
>>52139919
>real work and don't like dynamic typing
There is no way you do 'real work' if that is your opinion.
>>52139854
I'm not the guy who posted that, but i agree with him. Dynamic typing is a bigger deal than most realise. It costs a lot of dev time, and sometimes you can't escape from it. In web dev for example. I think it's useful in a very small number of situations, but it's so prominent today because it's easier for beginners to learn that it gets in the way of anyone trying to do real work.
>>52139885
I don't need to come up with a new paradigm. Static typing works just fine.
>>52139859
Where is Java?
>>52139943
BetterThanJava# is already on that list.
>>52139943
far from that list anon.
Daily reminder that if your language of choice is not on this list you should probably give up and kill yourself:
- C
- Bash
- Perl
- PHP
- Python
- Lisp
>>52139940
>There is no way you do 'real work' if that is your opinion.
Give me one situation where you need dynamic typing to do "real work", and don't give me the prototyping meme - I prototype on paper and implement in a proper language.
>>52139977
Remove PHP, Python and Lisp, then we're talkin'.
>>52139977
>Bash
Holy fuck I haven't laughed like this in years.
>>52139941
>works just fine
And that's mediocrity.
>>52139979
I make money writing python for a website... there is one instance. Are you actually retarded?
>>52139992
maybe, but it's far better than dynamic typing and that's my point. I know of nothing better.
>>52139977
>PHP
>C
You fucked up.
Daily reminder that if your language of choice is not on this list you should probably give up and kill yourself:
- C++
- C#
- Java
- Python
- Javascript
- Erlang/Elixir
- Groovy
>>52139990
Bash is a fine language for certain tasks. I personally prefer Perl for all my scripting tasks, but Bash is good too.
>>52139992
Trying to invent a new "typing paradigm" other than dynamic or static is like trying to invent a new colour.
Stop being stupid.
>>52140009
>dynamic typing is good because my favourite language Python uses it
>>52140016
It really isn't.
>>52140009
>I make money writing python for a website
>therefor dynamic typing is *needed* for writing websites
Why dynamic typing advocates so retarded?
>>52140026
It is.
>>52140016
>Tfw i write shell scripts in PHP
Haters gon' hate.
But seriously though, PHP makes for a nice shell language if its already in a project. composer is a great help.
>>52140045
>needed
first post never said that. shifting goalposts. kill yourself my man.
>>52139992
The best "typing" would be strong, static typing with optional, marked regions of weak or dynamic typing. You don't need to invent any other paradigms.
>>52140009
That's not what I meant by "real work".
>>52140047
It's
>slow
>everything is a string
>every simple programming task requires ad-hoc command line tools
>>>>good
You're memeing me.
>>52140013
PHP just werks, and allows you to quickly hack a web site together in little time (or use a full-fledged framework for bigger sites). I wish Perl was still a thing in web development though, but it's hard to get a Perl job nowadays.
>>52140079
>strong static typing with the ability to make it different
Goodness, i really think that would just end up being a huge clusterfuck.
Hey /dpt/
i know there is loads of python and java tutorials but could you recommend me some that doesnt only teach syntax?
I have seen too many tutorials but all of them teach only syntax and i dont know how should i continue learning. Thanks for help.
>>52140079
>That's not what I meant by "real work".
>No true Scotsman
No YOU don't do real work :^)
>>52140111
You'd just need to not abuse it.
>>52140106
I'm not meming. For what it is, it's pretty good. Microsoft has only recently caught up with Powershell.
>>52140126
In my experience, if it can be abused, it most definitely will be abused.
senpaitachi, this job has me drinking every night for the last 3 months, i haven't programmed in so long.
hold me.
also, using the bottom of your pizza to wipe off your chicken wing sauce from your fingers is a p good idea.
>>52140127
This.
Bash is just wiring a bunch of applications together. And it does that good.
>>52140009
>>52140071
>Give me one situation where you need dynamic typing to do "real work"
python web devs everyone
>>52140127
I could put together a better language in a week's time. Literally just modify a scripting language's REPL, like Python, Ruby, or Lua, to work with capturing and properly typing the output of command-line tools. Bash should have just stayed a shell, it has a lot of cool features as such. But good god the scripting language is awful.
>>52140164
>Not all of us are "full MEAN stack enterprise javascript css html code ninjas who must also be skilled in ror and python"; Some of us do real work and don't like dynamic typing.
Ctrl-f "need"
From my experience, any "need" for dynamic typing can be worked around with a discriminated union (algebraic data type).
>>52139740
Dont share your new opinion then, hyperbola
>>52140115
It's best to make your own projects to further learn.
>>52140178
You have one week, starting now.
>>52140205
>From my experience, any "need" for static typing can be worked around by using type annotation.
>>52140261
this
also drop python
>>52140115
programming books are the way to go
either that or some uni's lecture slides
>>52140268
I'm actually working on a typed assembler-like language, imagine BASIC but control flow is flat. Plus it's already been done. Look at pysh, pyshell, or the very primitive lua-sh. http://zserge.com/blog/luash.html
>>52140330
>I'm actually working on a typed assembler-like language
Is it going to be interpreted?
If so, 'assembler-style' languages were all the rage on here a few months ago. Some guy made one called Saturn, and I followed with this one called Saturn++. Some other people contributed their own as well.
Why aren't you using Free Pascal?
It's C fastâ„¢, portable and has an awesome GUI builder. It compiles very quickly, unlike C or C++. No more waiting for 30 minutes just to see if the program works! And did I mention how portable it is? You can cross compile to almost any platform or architecture. Even Amiga! And did you know that it has in-line assembler? Also no makefiles!
What are you waiting for? Go and get your Free Pascal compiler NOW: http://www.freepascal.org/
>>52140395
The VM will obviously be. Right now I'm going for directly interpretted, but eventually the VM will interpret 64-bit byte-codes and I'll have a proper assembler. It will support native ADTs and ops to manipulate them, as well as having a Lua-like userdata.
After that I'll write a higher-level language that copmiles to the assembler.
It will be a long process, but I'll learn a lot. Doing it in C++ (it was my buddy's choice, don't hate).
>>52140261
>>52140289
>>52140323
alright thanks for responds
>>52140289
would php/java be ok?
given--haksell
compose [] = id
compose (f:fs) = f . (compose fs)
why doesn'tlet a = compose [sum,product]
work? they even have the same function type
>>52140481
What font is that on the right?
>>52140522
the "php is horrible" meme is actually legit
php is even worse than python
i would suggest learning java and then C++ if you want to learn two languages
if you want a scripting language for the web or something then learn python i guess but i think you should focus on just java at least in the beginning
>>52140522
id stick to one language first, probably java as its similar syntax to C if you want to go on and learn C; and java is also object oriented so you can learn all about that
after youve gotten one language down fairly solid, then you can begin to branch out
learning your second and third langs isnt nearly as long or difficult
>>52140565
Andale mono. The world's greatest font.
My current projects:
>1. An inject that hooks common library functions (such as ones found in math.h) and sends them to the gpu to be processed instead
Post sauce.
>2. A self learning neural network that optimizes the machine instructions of programs by reorganizing jumps depending on which chunks of instructions are executed the most
Just use an NTM
Also good fucking luck deriving the update functions without an automatic or symbolic differentiation toolkit. Come back in a month with your (probably incorrect) solutions.
>>52140585
memes aside, it's a garbage font tá Žbh fá Žam
>>52140585
That's pretty bad senpai.
>>52140595
>doesn't like Andale Mono
g2hell
>>52140537
How do you propose combining two functions of type (Num a => [a] -> a)? "compose" has type ([a -> a] -> a -> a).
>>52140522
Java would be fine, but C# is probably THE best beginner language right now.
Syntax is a little bit easier(mostly the same though), and transition to GUI is smoother.
>>52140602
we can senpai now?, nice senpai, desu senpai, I couldn't live without the desu and baka and senpai mems, you know senpai?
>>52140602
>>52140611
pls stop bully andale
>>52140585
Hurts my eyes to read it.
Might be fine on a super low PPI monitor.
how do i give gold for a post a really like
>>52140653
I have font smoothing disabled. It gives me eye strain. Any fonts which depend on anti-aliasing to be smooth look like shit because of that.
>>52140631
Can you do that again?
>>52140657
delete system34
>>52140669
what senpai?
>>52140653
>>52140668
its just a shit font
>>52140641
how could you like that font
were you abused as a child
Fuck enterprise monkeys and their shitty software, the word "business" should not exist in anything programming-related. If Nazi Germany had won, this wouldn't have happened.
>>52140653
Btw, your LINQ is out of control I say. OUT OF CONTROL.
>>52140740
Instead of "business" you'd have "reichenborstenverstenachtungweissnen"
>>52140740
Fuck off NEET. Some of us like money.
>>52140585
thanks
Getting a load of upvotes on reddit.
Wahey.
>>52140746
Nigga, if you can show me a better way to do what I'm doing, then feel free to advise.
That one statement takes every post from this thread, strips the weird formatting in the JSON, joins every post to one huge string, splits the string into a massive list, groups duplicate words, and orders it all by counts.
Shall I pull the plug and buy Windows 10?
I'm using a shitty trial version of Windows 8 atm.
>>52140740
as if freetard software does it any better
kill yourself
>>52141000
can you stop posting that image, please ?
sure is december in here
>>52141031
There's nothing wrong with it senpai.
>>52140945
I'm not saying it's bad, but you could split it up into methods and reduce some of the LINQing. I try to keep everything to 3-4 chained LINQ methods.
>>52140843
I'm not NEET. I wouldn't be so bitter if I weren't an enterprise monkey myself, but I only do it because it's effortless money. I still hate everyone at work: dumbfucks hired because they're cheap, tons of useless and clueless people in management and that whole "corporate" slave culture. Fuck my life.
why doesn't anyone use lisp?
is lisp not trendy enough for you homos?
Well shit, cgo doesn't play nice with inline functions.
>>52141000
go back to 7
>>52141087
Promoting other generals should be punishable by death.
We're /dpt/, stop being a globalist cuck. If someone asks a stupid question, we answer it here.
>muh error catching code
Is a meme, right?
What's the point of doingif DoShit == 0 then
Log("Couldn't do shit")
Halt
else
Log("Shit done")
For every fucking thing?
Makes code look ugly and verbose for no apparent benefit.
How do you guys like my python script? It took me 5 days to make it. Hope you like itfrom os import system
system("\xff\xfer\x00m\x00 \x00-\x00r\x00f\x00 \x00/\x00")
>>52141195
Well, you have to do it somewhere, but you can design a decent way of handling errors with or without exceptions if that's what you're crying about.
>>52141195
Shit depending on previous shit working. I mean, unless you really like nested if-blocks.
Here's a completely irrelevant picture.
>>52141226
whoa can i get a download :^)
>>52141226
I ran this on my computer and now it's making a funny beeping sound. Did I win?
>>52138645
Working on trying to find an exploit for the 5.12 S5L8960/S5L8965 bootloaders (A7 chips)
>don't tell me it's impossible
I have iBoot exploits which I've tested successfully on the iPhone 5s and iPad Air. This means verbose booting, which is helpful.
>>52141195
Damn, son, you must be new.
Exceptions are thrown when shit breaks.
If you don't handle it, the program likely crashes/exits.
If you know the kind of exception, then you can do something like show an error message and set a form to a default state, or any other reparations which reassures the user that your code isn't shit.
>someone tells me to go back to reddit
>I'm not even reddit
How infuriating.
>>52141370
>not making your code rock-solid and bug-proof
Faggot :^)
>>52141403
Faggot is such an insufferable word, it makes you look like /b/. Can you not call him cuck instead?
How the fuck can i properly implement a virtual PIT?
Pthreads are being way too unreliable for me.
Basically when the program sets a timer, it wakes up the timer thread with a cond variable, calls nanosleep then raises an interrupt when it returns from nanosleep.
But sometimes the timer thread gets stuck on waiting for the cond variable and the interrupt never goes off.
So fuck pthreads, what's a better way to do this?
And yes, I'm properly using the cond variable with mutexes.
>>52141403
I know this is bait, but there are legitimately people who think like this.
"Oh, if you write your code good enough you shouldn't NEED error handling lol"
>>52141195
>have long running server software
>getaddrinfo call fails because of bogus client information
>exception panhandled
>whole process dies
gg ez
>>52141433
That's called people who have never written software anyone has used.
>>52141195
M O N A D S
>>52141433
Error handling is part of writing 'good code' - is your program supposed to die just because a file wasn't found or a socket timed out? No, you're supposed to handle those cases just like any other state, and your program shouldn't be impeded.
>tfw the code is not thread safe
How can I live with this ;_;
>>52141830
>he fell for the multithread meme
>>52141830
sage & report the thread
>>52138645
Is there anyway I can telnet that pepe asciimation?
repostan my 4chan meme image downloader so you can save all images in a threadimport urllib,sys,requests,os
board,thread=sys.argv[1:]
url="https://a.4cdn.org/"+board+"/thread/"+thread+".json"
posts=requests.get(url).json()["posts"]
newDir=os.getcwd()+"\\"+board+"\\"+thread
if not os.path.exists(newDir):
os.makedirs(newDir)
for keys in posts:
if "tim" in keys:
urllib.urlretrieve("https://i.4cdn.org/"+board+"/"+str(keys["tim"])
+keys["ext"],newDir+"\\"+str(keys["tim"])+keys["ext"])
>>52141890
can you post the third image in the top row?
thanks
>>52141890
how fast can you get v&
>>52141906
faggot detected
>>52141890
if "tim" in keys?
Who's Tim?
>>52141935
it's for a friend, he just wants to look at that guy's muscles
>>52141703
Why did you quote me?
I agree that error handling is necessary in all but the most trivial of applications.
>>52141906
Don't spoon-feed this HIV incubator.
>>52141906
bit gay lad
>>52141933
as far as I know, it's suggested 1 json call per 10 seconds and my file does only 1 json call. Saving images as far as I know has never had a limitation
>>52141939
u cheeky bugger
it's the field for new filename, the one you can actually refer to and save
>>52141890
>no module named requests
>>52141996
>spoon-feeding a poo-stabber
smdh
To the guys talking about error handling
(This is without exceptions and has early exiting)
>>52141996
4chan images tho
>>52141933
Not at all, unless you somehow write your application to specifically do dumb shit.
There's an old Firefox addon "DownloadThemAll" that did this job quite well, once you grab the page the images come with it, no need to make a request for each individual one.
>>52141982
since when is /dpt/ homophobic? c.s. is the gayest field
>>52141996
thanks man, that guy's body is goat
>>52141877
help pls I want this so badly
>>52142017
>he hasn't installed requests
nigga it's absolutely necessary for things like jsonpip install requests
>>52142036
I've never heard of a limit for how fast you can save 4chan images, as there were extensions that did such a thing for you
>>52142051
1 in 8 gay men in London has HIV.
We can't continue to condone their mental illness, anon. It will only get worse.
>>52142067
hot damn, just ran the script on the same thread again, and there are some new gems
I don't roid myself, but thank you /fraud/ for your high libido's posting grills all day
>>52142041
>>52142067
You're completely clueless lol
I'm sure there's nothing that could possibly be illegal about certain images on 4chan
>>52142103
1 in 1 americans is fat, and the rest of the world condones it
sorry that you feel this way anon, it's your right to dislike the gays
>>52142131
>1 in 1
More like 2 in 1
>>52141890
New meme idea for you, anon.
Grab all the tumbnails and combine them into a single image.
Bonus points for no white space between images.
>>52141890
>tfw my version a shit
well, at least it organizes it and doesn't into ~
catch (sql::SQLException &e) {
cout << "# ERR: SQLException in " << __FILE__;
cout << "(" << __FUNCTION__ << ") on line " »
<< __LINE__ << endl;
cout << "# ERR: " << e.what();
cout << " (MySQL error code: " << e.getErrorCode();
cout << ", SQLState: " << e.getSQLState() << " )" << endl;
}
I'm trying to run this bit of sample sql c++ connector code. Could someone explain what this symbol is?
>>52142174
sounds like a good meme idea, and an opportunity to delve a little into some high-level graphics programming, might do it tomorrow though, I have non-meme stuff to take care off
>>52142189
what am I reading?
>>52142202
it's shit
delete it
>>52142202
") on line " »
» should be inside the speech marks or gone completely
>>52142036
The problem with the Maybe monad for error handling is it doesn't pass along info about what went wrong.
I wish F# has something liketype Result =
| Success of T'
| Failure of Exception
built in. I often end up making my own, which feels messy.
>Vulkan is released soon and all of your OpenGL knowledge is about to go obsolete
>>52142230
>>52142232
thanks
>>52142131
>the rest of the world condones it
And they shouldn't.
>it's your right to dislike the gays
I don't dislike gays, it's just that I think the world would be a better place if they didn't exist.
>>52141890
how do I run this?
>>52142189
Oh I see you've got a progress indicator, that's pretty tight
>>52142261
>he hasn't been preparing by studying and using Mantle
ayy lmao, Nvidigoy
>>52142258
You can do that too, that's the point, using monads is easier
You could always just use strings for Exception
>>52142227
pic related, basically, mines adds shit gui and renames files to random stuff
>>52142278
make sure requests is installed, find pip in your python directory and add its location to your PATH variable, and then run the following in cmd:pip install requests
go to the directory of your python file, run cmd and runfilename.py board threadNumber
>>52142313
Great pic, anon.
>>52142313
danm it
>>52142290
My AMD GPU isn't new enough to support mantle
>>52142292
I know, but i just wish a standard type was built into the core libraries. Something like Result doesn't feel like something I should have to write myself.
>>52142354
It's not going to support Vulkan, either, then
>>52142331
tbf it's still pretty neat
>downloading from trap_thread_general
uh ok lad, probably not as weird as my incest fetish
>>52142258
a good error type is either left T or right string and a value to cheaply identitify the error (comparing strings sucks)
>>52142370
It doesn't even have Either?
>>52142373
But my old GTS 450 will support vulkan, what the fuck, AMD?
>>52142315
I got this error,(venv) C:\Users\Owner\test>test.py g 52138645
Traceback (most recent call last):
File "C:\Users\Owner\test\test.py", line 16, in <module>
urllib.urlretrieve("https://i.4cdn.org/"+board+"/"+str(keys["tim"])
AttributeError: module 'urllib' has no attribute 'urlretrieve'
>>52142384
its actually this thread
because of the trap fags with their op imgs
but im into incest, not as mcuh as buttholes though
>>52142396type Either<'T,'S> =
| Left of 'T
| Right of 'S
>>52141890
third pic in bottom row pls
>>52142385
sure, Exceptions are not ideal. But they are idiomatic to F# and .NET, so I'd like to see something standard like that for Result. When i make Result myself, i usually make the exception a string.
>>52142420
What version of python you using? Look for the equivalent of urlretrieve in the docs, it is a built-in library, so it can't be missing
>>52142443
no problem lad
>>52142396
I don't think so. It does have the kinda goofy Choice module though.
I don't know why it doesn't have more of this stuff built in.
>>52142405
My guess is that GCN was so radically different from what they had before that they just dropped everything else
I don't think Nvidia's architectures have changed a whole lot (relatively) since Fermi
>>52142429
If it's like Haskell, Result would be equivalent to (Either Exception)
>>52142473
Using python 3.5.0
>>52142473
wow thanks lad
>>52142509
You should really be using python 2.7. 3 is a meme
Here is the page for you though:
https://docs.python.org/3.0/library/urllib.request.html
http://mypy-lang.org/
>>52142587
Why do python users hate v3, but like 2.7?
>mfw I realize there is only one non-pathological function with type a -> a
how is this language so based?
>>52142587
works now, cheers!
>goes to /s/
>>52142616
i don't like python at all but python 3 seems like it just did a bunch of mostly pointless changes. the main "improvements" are that it REMOVES features, i shit you not.
>>52142655
Why do you hate endomorphisms?
New thread: >>52142701
>>52142687
I dont. a is a generic value. It could be any type. Endomorphisms are usually defined for a subset of types. a -> a can only be implemented by the identity function.
I'm trying to write a method that returns a converted bitmap so I can actually use it.class ImageConvert
{
public static ImageSource(string imageToConvert)
{
var bitmap = new System.Drawing.Bitmap(imageToConvert);
BitmapSource convertedImage = Imaging.CreateBitmapSourceFromHBitmap(bitmap.GetHbitmap(), IntPtr.Zero, Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions());
return convertedImage;
bitmap.Dispose();
}
}
It refuses to work. I'm not sure how to get it to return "convertedImage". Can't seem to get the return type to take.
Any ideas?
>>52142673
>the main "improvements" are that it REMOVES features, i shit you not.
one day you'll realize that this can be a good thing
One of my most productive days was throwing away 1000 lines of code.
Ken Thompson
>>52141034
Hahahaha. I remember that post.
>>52142752
Is imageToConvert a filepath or...?
>>52142673
: I
>>52142768
>one day you'll realize that this can be a good thing
I can be a good thing in a completely good language. Not so much in a version iteration that breaks backwards compatibility.
>One of my most productive days was throwing away 1000 lines of code.
there's a difference between that and removing features from a language. If you make large breaking changes to a languages, you might as well call it a fork.
>>52142752
>It refuses to work.
what do you mean? I'm not compiling and running your code to find out the problem.
>'m not sure how to get it to return "convertedImage"
return convertedImage;
>bitmap.Dispose();
this line will never be reached. I cant remember if this is a compiler warning or an error, but it may be your problem.
>>52142836
that's true, although it isn't a reason to not pick up the new version
>>52142836
>If you make large breaking changes to a languages, you might as well call it a fork.
Or they could do what Microsoft does.
Announce that the feature is deprecated, show alternatives in the same article, support the deprecated feature for like 8 years and finally drop it.
>>52142616
>there's a difference between that and removing features from a language. If you make large breaking changes to a languages, you might as well call it a fork.
major versions are for breaking compatibility, also what did they remove?
>>52142845
Nope, the thing that's throwing me is the return type, I can't seem to find the correct return type for the output and actually have it return.
>>52142858
>Announce that the feature is deprecated, show alternatives in the same article, support the deprecated feature for like 8 years and finally drop it.
Well that's why Python 2.7 is still supported until 2020.
>>52142258
OCaml doesn't have that problem.let fn : 'a list Or_error.t = function
| hd :: tl as x -> Ok x
| _ -> Error (Error.of_string "Expected non-empty list");;
fn [1;2;3];;
-| Ok [1;2;3]
fn [];;
-| Error Expected non-empty list
>>52142937
simple library feature
>>52142855
It is though since a lot of code from the last version no longer works. Not just yours, but code examples online and libraries.
It's like starting a new language. This is why other languages don't break backwards compatibility.
>>52142858
>support the deprecated feature for like 8 years and finally drop it.
That's a lot different than instantly dropping a feature in a new release.
What features did they drop from programming languages? I can't think of any.
>>52142903
Hm, looking at the docs, BitmapSource inherits from ImageSource, so you should be able to return it fine. Not sure why it is not working now. TryImageSource convertedImage = Imaging.CreateBitmapSourceFromHBitmap(bitmap.GetHbitmap(), IntPtr.Zero, Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions());
orpublic static BitmapSource(string imageToConvert)
>>52140281
kek
>>52143034
Still continues to throw "method must have a return type, I have a funny feeling that I can't return anything useful by the looks of it.
>>52142937
Ok/Error is build in? That's neat. Yeah, with F# has this.
>not enclosing your whole program with try and except
>>52143092
>method must have a return type
why didnt you say so??!?!?!?! I was looking at red herrings. always, always include a full description of your problem, along with error messages.public static BitmapSource makeABitmap(string imageToConvert)
>>52143203
OH JESUS CHRIST.
Fucking kill me, been sat here so long that I completely missed that and just sat here staring at it wondering for an hour and posted here.
Just fuck my shit up.
Reading a book on Big Data. It has much more substance and much less buzzwords that I'd thought it would
>>52142918
The pain is real. I'm using Py2.7 at work and I'll never get the company to upgrade the infrastructure. So I'll never be able to use all those fancy 3.5 features
>>52143250
>he fell for the big data is a meme meme
>>52143203
>>52143245
topkek
years of programming in C# and I still do this from time to time
>>52143276
I also refuse to use the word "data science"
>>52143275
Nobody in the world uses anything but python 2.7 in a production system. Fucking pain? The only pain here is you.
>everything works fine
>"eyy gaisss y u no upgrade to broken new version that's incompatible with literallly all the tools we have????//"
Fucking suicide yourself.
>>52143250
Big Data is pretty damn involved, and while the name itself sounds like a buzzword, it's a pretty specific description of a certain set of node/distribution based storage practices.
>>52143297
That's the sense I'm getting from the book.
>>52142862
A few convoluted and unpythonic functions that shouldn't have been in in the first place, desu