[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

/dpt/ - Daily Programming Thread

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 314
Thread images: 19

File: 1481234393653.png (102KB, 1000x1071px) Image search: [Google]
1481234393653.png
102KB, 1000x1071px
What are you working on, /g/?

Old thread: >>58197507
>>
first for java a best
>>
Functional programming thread:

>>58174033
>>
Daily reminder that if your language isn't functional, it's dysfunctional.
>>
>>58208600
Daily reminder that you are unemployable
>>
>>58208600
Daily reminder that if your language isn't multi paradigm, it's dysfunctional.
>>
>>58208629
Kek.
>>
>>58208637
Are you saying a functional language is not a functional language?
>>
static inline char
bitch(_Bool st)
{
return (char []){'0','1')[st];
}


hehheh im a retarded child every1
>>
>>58208600

Daily reminder that there is more requirement for Pascal programmers than functional
>>
>>58208600
>tfw omni-paradigm masterrace
>>
>>58208637
>t. realizes pure functional is superior but isn't good enough to use it, so pretends OO has any use
>>
>>58208713
pure OOP
>>
>>58208698
OO is like Midas except everything it touches turns to shit.
>>
>>58208722
>UX without OOP

Good luck.
With that.
>>
>>58208651
>>58208713
Stop mansplaining paradigms to me.
Seriously though, pure functional is fucking trash. That's why it never caught on.
>>
help with c#

in an inherited class, when i call a base function from within an overriden function, it uses the baseclass variables instead of the childs

the virtual function in the base class looks something like this

public virtual void f(){
if(a == 0) return;
}


the override function in the inheriting class looks like this
public override void f(){
base.f();
dosomethingelse();
}

when base.f() is called, a has changed from its default value but it's still use the default because that's what it is in the base class. please hlpe
>>
>I don't want the compiler to tell me if I've fucked up
Dynamic typing babbies
>>
>>58208741
it's okay, the runtime will tell me :^)
>>
>>58208736
Not difficult at all.
>>
>>58208736
just blit everything and fuck me up
>>
>>58208753

I didn't mean making a meme buzz that displays fizz in one text box and buzz in another.
>>
>>58208737
Pure functional only seems trash if you've been told lies about it, possibly by people who have a vested interest in other programming styles sticking around.

Pure functional programming is the most practical type of programming.
>>
>>58208782
so practical it's not practiced
>>
>>58208798
Functional programming is like communism, it just hasn't been properly tried, and now is being kept down by 'da mann', duhh.
>>
Hope this video helps.

https://www.youtube.com/watch?v=uqsZa36Io2M
>>
>>58208782
purely functional is me scribing math formulas in a notebook wearing only boxers. body all covered in grease stains, i.e. useless as all hell
>>
>>58208782
Pure functional programming languages are notoriously bad for doing I/O. Problem is: most problems require I/O.
>>
>>58208815
Pure FP is like national socialism
>>
>>58208840
This is a demonstrably and obviously untrue claim.
>>
>>58208840
>Pure functional programming languages are notoriously bad for doing I/O
People who say this are notorious for being wrong

"Haskell is the best imperative language"
>>
Anyone else need to change their editor themes once in a while to remain focused?
>>
>>58208815
>it just hasn't been properly tried
No it's not.
It has been tried, and it works successfully in its sphere.
>>
>>58208861
No. Try not having ADHD
>>
>>58208852
>>58208857
Now tell me why all (((popular))) databases are NOT written in a pure functional language.
>>
>>58208867
And in other spheres too, which is why for the past 10 years every mainstream language has added lambdas
>>
If functional languages are good why aren't you employed because of it?
Checkmate
>>
>>58208872

Sorry sire
>>
>>58208873
>why are all popular databases NOT written in a pure functional language
SQL is (mostly pure) functional

checkmate
>>
>>58208873
Because people fell for the OOP hype and bullshit.

>>58208878
I am though.
>>
>>58208861
Nope. Infact I find shit like that distracting.
>>
>>58208884
Databases are not written in SQL. You interact with a database in SQL. Sucks to be retarded desu.
>>
>>58208892

Must be my autismo then
>>
>>58208927
Have you tried not having "autismo"?
>>
>>58208890
stop lying on the internet
>>
>>58208950
>what is Erlang
>>
File: baka_big.png (2MB, 2000x2000px) Image search: [Google]
baka_big.png
2MB, 2000x2000px
>using functional or OOP or any other paradigm exclusively
>not using all paradigms within the same language to suit the task at hand
>arguing pointlessly that OOP or functional is inherently bad or good

Different tools, different jobs.

Nearly every language advocated in these threads is fine.

Programming in a functional way can be incredibly useful. Utilizing objects can be very effective.

Use a language that lets you do whatever you want and go create something.

Stop being faggots.
>>
>>58208894
This. And SQL is literally never used anywhere.
>>
>>58208997
I use OOP where it is appropriate, which is nowhere.
>>
>>58208998
>And SQL is literally never used anywhere
I don't know what you mean by this.
>>
>>58208998
>And SQL is literally never used anywhere.
Are you talking about ORMs?
>>
>>58208939

The priest said that if I prayed hard enough it would go away.

Not sure if he said it about my autismo or me liking boys though.
>>
>>58209007
What about....
>>
What's better for transferring text data from server to mobile app? Json or xml?
>>
>>58209051
gzip the plain text
>>
>>58209051
XSONL, it has a lower life path

http://acronymsmeanings.com/full-meaning-of/xsonl/xsonl-stands-for-xsonl-means
>>
Hey /dpt/,

Does anyone ever find themselves getting stressed out by setting themselves over ambitious projects, or even just ambitious projects?

I find myself getting stressed just planning out very large projects, and worrying is the thing even going to work properly after putting in the huge amount of work it will seem to need. Also hoping i don't overlook something critical and waste tons of precious hours working on something that won't work how I want.
>>
I was writing a little shell script for android that involved playing an mp3 file multiple times
I play it using
am start -a android.intent.action.VIEW -d file:///file.mp3 -t audio/mp3

but sometimes it tells me that "Activity not started, its current task has been brought to the front", and the music app does indeed get brought to the front, but doesn't play the file.
I've since used a different approach, but I'm still wondering what the problem was, any ideas?
>>
>C++ is better than C because OOP
Bruh C has structs since 20th century
>>
>>58209113
nice bait bjarne
>>
>>58208426
a pair of tighty whities that doesn't stain after a few hours of programming
>>
>>58209067
Lol how did you even find that link?
>>
>>58209144
It's literally the first result on google
>>
>>58209051
JSON
>>
>>58209062
Never talk to me or my wife's json again.
>>
>>58209073
>stressed out
I wouldn't call it that. I either underestimate (time wise) a project and lose interest or the idea didn't work out as expected.
So I either write toy programs or solve puzzles.
>>
yall fake niggas, i program all my software in straight up set theory notation, on a blackboard, wearing strictly ill fitted oxfords
>>
Someone post a programming challenge.
>>
>>58209374
Create a method that returns a JSON object representing an Azure Data Factory Dataset.
>>
File: 1443647604474s.jpg (6KB, 250x213px) Image search: [Google]
1443647604474s.jpg
6KB, 250x213px
>>58208998
>>
void fn(void * restrict p)
{
(void)*(char *)p;
}


Does the restrict qualifier propagate through casts or is it strictly discarded? If the cast is restrict qualified instead, does it constitute a different non-aliased pointer from ptr?
>>
the standard methods for parsing XML in java are so fucking horrible.

you have to define custom functions for everything.
>>
>>58209393
ptr = p rather what have you
>>
>>58209396
Welcome to Java. Use Jackson.
>>
>>58209393
>>58209426
rather:
void fn(void * restrict a, void * restrict b)
{
// is this ever true?
(void)((char *)a == (char *)b);
}
>>
>>58209480
No.
>>
>>58208992
A waste of time.
>>
File: productive as HELL.png (34KB, 931x663px) Image search: [Google]
productive as HELL.png
34KB, 931x663px
what the fuck are those cunts doing
>>
>>58209480
second pathological case
void fn(void * restrict ptr)
{
// is this always true?
(void)((char *)ptr != (char *)ptr)
}
>>
>>58209514
Trying to act smart.
>>
>>58209433

is there really no better default solution in java for parsing structured text data?
>>
>>58209549
There's DOM, SAX and JAXP. I don't like them.
>>
>>58209514
(.) is (->) a 's (<$>)
>>
>>58209523
>>58209523
fucking suits me right thinking of this sort of thing while drunk, "can this be true" better
drinking and logical qualifiers don't mix well with my mind
note that this is a strictly semantical bother
>>
>>58209561

jackson sounds like the best option, then
kinda horrible. how do companies handle their large textfiles?
>>
>>58209572
><$>
shit operator
hate it
>>
File: async-javascript.jpg (43KB, 640x230px) Image search: [Google]
async-javascript.jpg
43KB, 640x230px
Hi, OP from here >>58209631

I have a preexisting PHP website. If I wanted to install lazy load, to boost landing page response time with images... How difficult a job is it?

Is it as simple as adding the script into the .phtml pages coding and or would it require overhauling the entire design?
>>
>>58209592
SQL?
>>
>>58209794
<$>
is fucking glorious. `fmap` is for philistines.
>>
>>58209794
>>58209870
i use both
>>
>>58209586
You sound pretty drunk, bro. Perhaps you better step away from the compiler.

>>58209830
Jesus Christ, my eyes.
>>
>>58209870
I use <$> because it makes me feel smarter. Still not as cool as (<=<), though.
>>
What path/route should I take to learn basic math required for comp sci?
>>
>>58209794
>>58209870
>>58209907
I agree bros

Hey I know let's go discuss the best ways to prettify our Haskell programs on /fpt/
>>
>>58209914
the path of least resistance.
>>
what's the most phallic programming language?
>>
>>58209947
C--
>>
>>58209947
cplusequality.
>>
Wordpress shit x.x
>>
>HaskLEL is useless and, pure functional and stateless languages are a meme
>Lisp is only used for third class text editors
>SICP is not a good book and this is why it's given away for free
>Anime is shit
>Maki a slut
>C++ is much better than C
>Java is the language of the future
>JS is a good choice for server side
>The best software engineers are indians
>>
>>58209926
And that is?
>>
New thread:

>>58197507
>>58197507
>>58197507
>>
>>58210014
Add to that Lua is the best scripting language and I'd agree whole heartedly
>>
>>58210025
wat
>>
I want to do so much and then that fucking Dota 2 icon on the screen looks so enticing, whyyyyy
>>
>>58208600
agreed


def tree_sixty():
print("Good Choice")
functional =True
return functional

def three_four_still_moar():
print("Error Finding Truing Completness")
funtional = False
return funtional

def two_by_two_hands_of_blue():
import sys
print("Fatal Error, Core Dumped!")
sys.exit()



def which_python(language):
case_switch= {
'3.6':tree_sixty,
'3.4':three_four_still_moar,
}
if language[6] == '3':
functional = case_switch[language[6:9]]()
elif language[6] == '2':
two_by_two_hands_of_blue()
else:
"Could Not Locate Item in Memory"
funtional = False
return functional




def is_functional(language):
if 'python' in language:
functional = which_python(language)
else:
"Sorry funtional == False"
functional = False
return functional


def main():
language = input("Please Enter Your Launguage\n>")
funtional = is_functional(language)
print("And The Question Is:\n Your Launguage Is Funtional\n What is,",funtional,"!")

main()
>>
>>58210144
That will go away as you get older.
>>
File: fucking epic.jpg (74KB, 426x450px) Image search: [Google]
fucking epic.jpg
74KB, 426x450px
I want to get better at C.

I'm wondering if there are moderately-sized programs that are not only open-source, but have guided breakdowns explaining what everything is doing so you can learn from it. It would be cool if somebody did that for Quake or Doom or whatever.
>>
>>58210160

Sure will
>>
Does anybody here know of an Emacs theme that is optimized for red colorblindness (mild protan)?
>>
>>58210160
Tell that to the old guy who shows up at dota events talking about playing dota and coming up with the ~perfect~ MMR computation algorithm.
>>
>>58210163
http://fabiensanglard.net/doomIphone/doomClassicRenderer.php
http://fabiensanglard.net/quakeSource/
You're welcome.
>>
>>58210163
the unix version 7 source is excellent
>>
>>58210354
sixth rather, lions' commentary
>>
Ended up replacing an asymptotically faster algorithm with an asymptotically slower one because the latter is superior for real-life dataset sizes and now I feel dead inside.
>>
>>58210387
thats computer science for you, a social engineering programme designed for autists with a penchant for masochism
>>
>>58210030
But that one's actually reasonable.
>>
>>58210387
Implement both, algorithm to be chosen at runtime with
if (is_this_the_real_life()) { ... }
.
>>
>>58210030
>>58210427
lua is extremely good
>>
>>58210387
How simple is the problem?
You can always do


if (log(n) > n*n)
>>
>>58210503
input data sets have P(n) more characteristics than their magnitude
>>
>>58210379
Many colleges have courses on xv6 a 6th edition unix clone for modern hardware
>>
>>58210531
Well you've just gotta do an additional test to calculate if calculating the better implementation could take longer than the difference between implementations
>>
>>58210566
yeah obviously
>>
>>58210503
>if (log(n) > n*n)

This is always false.

Asymptotic advantages break down due to constant overheads/characteristics of typical datasets unaccounted for in the algorithm (e.g. when most real data is sorted but the algorithm is for unsorted data).
>>
>>58210503
>>58210531
>>58210589
snark notwithstanding there are heuristics
>>
>>58210589
>This is always false.

Not strictly true. It is merely false for real numbers > 0. Otherwise it's undefined.

Also for complex logarithms there is a log(n) = n*n solution too.
>>
>>58210645
the problem domain (of a physical computing device) is strictly countable though
>>
What three programming languages everyone should know?
>>
>>58210670
having a bijection with the natural numbers rather
>>
Rate my clamp:

input = input <  lower ? lower :
input == 0 ? 0 :
input > upper ? upper :
0 ;
>>
>>58210680
PHP, Fortran and PHP
>>
>>58210680
C [native]
Python [interpreted, n
Java
>>
>>58210670
Computer science doesn't care about specific, currently existing computing toys. Those exist for software engineering babbies who can't handle more complex (pun intended) abstractions.
>>
>>58210680
asm, C, high level scripting language of your choosing.
>>
>>58210680
C
Python (or Cython if you gotta go fast)
D
>>
>>58210680
There are no three languages that everyone should know.

The languages one should learn greatly depends on their temperament and their ideal projects.

I would not recommend assembly to someone who wishes to create websites.

I would not recommend Scala to someone who wants to write hardware drivers.

I would not recommend Haskell to anyone, for any reason.
>>
>>58210694
Haskell
clamp low high = max low . min high
>>
>tfw I have to teach young people Perl because employers in my field still require it
>>
>>58210724
Disgusting.

Go mix bleach and ammonia and mainline it, or come back with a useful language.
>>
>>58210694
Why the middle statement if you're returning 0 at the end anyway
>>
>>58210680
C, C++, Nasm
>>
>>58210750
Because it looks pretty.
>>
>>58210696
chrome for osx, how you say, ``not so good``

to continue, python is interpreted at runtime from a human readable syntactic form while java is interpreted as compiled virtual source

these 3 use cases (C, java, python) cover most of practical needs in todays software development

you may add a functional language as an extra but they are still mostly a intellectual (however recommended) curio (by mean).
>>
>>58210446

I always hear this, but why is that?
>>
I had an interview question (in September) asking me to explain MD5 hashing. What on earth was I meant to say to that?
>>
>>58210721
>I would not recommend assembly to someone who wishes to create websites.

I definitely would, it will help him understand how computers work.
>>
>>58210778
Websites are not how computers work
>>
>>58210778
Who gives a shit if you're doing frontend tool logic?
>>
>>58210773
just mention hash size, broken, fast and you should be good
>>
>>58210769
to reiterate, the ways of implementation are isomorphic to all the three major use cases and as a developer bring you an understanding of how computing works out in practice
>>
>>58210773
"MD5 is a cryptographic hash function with known vulnerabilities and thus probably should not be used"
>>
>>58210773
stuff goes in, hash comes out
>>
>>58210773
"that thing i cracked when i was twelve because clueless web developers used it for encrypting human language passwords?"
>>
File: 1429771509435.jpg (174KB, 1421x1920px) Image search: [Google]
1429771509435.jpg
174KB, 1421x1920px
>>58210793
>>58210805
>>
>>58210867
you can't explain that
>>
>>58210793
>>58210805
Who cares what he's doing?

The question was "What three programming languages everyone should know?"

It's not my fault you didn't understand it.
>>
>>58210873
rudesempai
>>
>>58210888
>Three programming languages everyone should know
ASM, C and Erlang. Prove me wrong.

Pro tip: blabla can't
>>
>>58210888
Not everyone should know Assembly.

For many people, it would be virtually useless to waste any amount of your time on it.
>>
>>58210902
you ain't wrong but i disagree with your pragmatics
>>
>>58210905
Hey man, stop trying to be reasonable on this godforsaken website, go learn Haskell and write a FizzBuzz in Rust and then you will be /dpt/ material.
>>
>>58210905
You still have your midwit mind stuck on utility even though it has fuck all to do with the question.

"Everyone" includes my grandma who has never owned a computer.
>>
>>58210921
are you going to cry
>>
>>58210934
yes bring me tissues and ice cream
>>
>>58210949
I'll bring you my warmest cuddles.
>>
>>58210930
That's why it's a question based on a false premise, and thus absolutely useless.

The question assumes that there are 3 languages that "everyone" should know, and this simply isn't the case.

The only correct response to this question is to recognize its intellectual inadequacies and request another, less shitty question.

One should have an idea of what they want to accomplish with their knowledge of a given programming language, before they decide on a language.
>>
>>58210921
>Rust
At least use a meme that wasn't already debunked
>>
>>58210930
no one strictly needs to learn how to program a computer

theres are reason why human beings create layers of abstraction, i.e. its a bit shit
>>
>>58210902
Replace Erlang with Python

Erlang's message passing and functional programming style are cool, but it's nowhere near as prevalent as Python
>>
>>58210987
Rust wasn't debunked you reprobate
>>
>>58210979
>and thus absolutely useless.

Stopped reading here and refer you back to "midwit mind stuck on utility" and won't reply to any more of your posts.

Please don't try to argue hypotheticals or consider thought experiments if your IQ is below ~115, it's embarassing to watch.
>>
>>58208600

must admit that was a good burn
>>
>>58211007
Of course it was. The safety checks make it slower than Go, and they're still no safer than C++ already is.
>>
I need to make a neural layer that interprets strings, then I can sync it with the bottom visualization layer and teach it how some words look and ask for unknown ones, shit would be interesting, sadly I don't think my 4770k can pull it's weight and OpenCL seems to be very slow, so I don't think I'll be able to scale it up very much.
>>
>>58210680
C
x86 assembly
Perl5
>>
Is it possible to create an array of strings of restricted length?

Like, Array = String[4], String[11], String[6] ...
>>
File: 1454459568259.jpg (42KB, 600x361px) Image search: [Google]
1454459568259.jpg
42KB, 600x361px
Whats the best way to save user preferences from a windows form in C#? Making my first "big" project and wonder if creating an XML file is the right way or not, being created from application settings that are written to as a user progresses through a wizard.
>>
File: polite conversation.png (311KB, 2072x1984px) Image search: [Google]
polite conversation.png
311KB, 2072x1984px
>>58211024
Well, here's your (You).

A question based on a false premise can only be answered in a way that is dishonest, and potentially even harmful to an observer's outlook on a subject, granted they take the call-and-answer at face value.

I'm hoping that at least some people here will begin to identify the root purpose of their question, and ask about those more simple things first.

In this particular case, I believe >>58210680 is trying to get an idea of where to start with his first or early programming languages, in which case he should have specified his intentions for being able to program in the first place.

This allows us to give more beneficial responses, rather than spouting off either memelangs, or "beyond-reproach" classics that many anons were forced to learn in high school or CS101, with or without their consent, and without regard for where their career paths may be headed.
>>
>>58210919
>ASM teachs how computers really work. It's really simple and easy so there is virtually no reason to skip this step.
>Erlang is certainly the most useful one and very underrated by web developers. It allows networked applications to scale efficiently without having to worry about speed and unrecoverable failures.
>C is simply the best for high performance on both CPU and GPU

>>58210998
Python is a good scripting language for quick, useless and boring stuff but doesn't replace Erlang.
>>
>>58210919

How can you specifically disagree with "pragmatics"?

???
>>
>>58211093
userprefs.cfg
or whatever.

You can use XML, JSON, or your own basic format.

I recommend creating an object that represents your settings, and serializing/deserializing from JSON with JSON.NET.

Install-Package Newtonsoft.Json


You do know how to use NuGet, right?

Now, you simply read the settings file when the application is started into a global object that can be access any time a setting is important to a piece of the application.
>>
>>58211163

I do know how to use that (using AeroWizard for the wizard) but I've never encountered what JSON is before. That method of loading the settings into a global object sounds appropriate though, so I'll check it out (thanks)
>>
>>58208426
Can someone link to some advanced front-end lessons or resources? I feel like I've plateaued in terms of what I can do on my own so I think it's time to finally learn some more.
>>
>>58210769
Java is mostly JIT'd though, not interpreted.
>>
>>58211100
>C is simply the best for high performance on both CPU and GPU
fortran is the still fastest high level language for a certain class of computational tasks (mainly distributed number crunching) due to its reference semantics and background as a form of translation of mathematical calculations.

in practice the larger use case of c has given way to far more sophisticated compilers, compared to those of fortran. however c is still strictly a "systems language" and can't be said to be simply fastest as a increasing number of problems require parallel solutions.
>>
>>58211342
C is lower level than Fortran. It's entirely up to the programmer using it whether the program will run fast or not.
>>
>>58211360
this is fucking nonsense
>>
>>58211100
>>C is simply the best for high performance on both CPU and GPU
GPUs don't run C programs
>>
>>58211376
Sometimes the truth is hard to understand. The reality is, C works the same way as the CPU itself and you can't get any lower-level than that.
>>
>>58211396
"C-like"
>>
>>58211396
i know you are being pedantic but the typical gpu abi is defined by c semantics (even if by transitively way of os level semantics) and as such is the de facto communication layer.
>>
>>58211046
>Safety Checks
>Make it slower
>Not safer then C++
Wow! Unless you're a trolI, would genuinely be very very interested in your sources.
>>
>>58211401
only a few freemason know william shockley invented the semiconductor with the godly presumption that it would only be used to implement the unix operating system #realfacts
>>
>>58211401
We have a good troll here guys...
>>
>>58211401 (You)
>>58211516 (You)
Samefags
>>
>>58211516
i bought von neumann's brain off ebay and it keeps printing "penor" over and over again help
>>
>>58211401
>C works the same way as the CPU itself and you can't get any lower-level than that

I know this is bait, but there are literally people who believe this.
>>
>>58211570
well it was true in the 70s at least
>>
>>58211580
>>58211570
>>
>>58211401
>The reality is, C works the same way as the CPU itself
Not even close.
C has no concept of simd for example, which leaves a massive chuck of the total computational power off the table.
>>
>>58211587
honestly im surprised there isnt a cult of programmers who deny C90 as an abomination and strictly develop for pre-standard, near one-to-mapped compilers
>>
`   Ding        {   Sneer
~ Twiddle } Smirk
! Bang [ Uh
@ At ] Duh
# Hash | Pole
$ Bucks \ Back
% Ears : Eyes
^ Hat ; Wink
& And " Quote
* Star ' My
( Frown < Mouth
) Smile > Nose
_ Under , Tear
- Dash . Dot
+ Plus ? Hook
= Equals / Slash
>>
>>58211610
Struggling to think of a language with any concept of SIMD
>>
>>58211614
djb is a proponent of something like it:
https://groups.google.com/forum/m/#!msg/boring-crypto/48qa1kWignU/o8GGp2K1DAAJ
he's not necessarily concerned with 1:1 mapping, but consistent and completely 'deterministic' code gen.
>>
Should I take this course next semester?
>Algorithms, Data Structures and their Efficient Implementation in C Language
>>
>>58211617
>(
>(:

>)
>):

Try again retard
>>
>>58211649
make one
>>
>>58211649
fmap :: Functor f => (a -> b) -> (f a -> f b)


barring
(->) x
>>
>>58211649
HLSL
GLSL
>>
>>58211649
x86 assembly
>>
>>58211676
Fair play. Won't go to the umpire on that one.
>>
How does one interact with MS Office outside of Excel with Python? I've been searching around for some answers and I read http://www.blog.pythonlibrary.org/2010/07/16/python-and-microsoft-office-using-pywin32/ which says it's possible with pywin32 but has a lot of "your mileage may vary" issues, but this was written in 2010 and this is one of the more recent articles. Has this kind of thing gotten better/easier over the years?

There are a bunch of libraries for Excel but not for the other office products; some of those tutorials date pretty damn far back or interact solely with O365 with web stuff.
>>
>>58211784
COM >:D
>>
>>58211676
>>58211696
im not a graphics or a hpc nerd but shader languages are fascinating and its a shame they near all exist in a proprietary hellscape
>>
>>58211784
i feel sorry for you, honest, i do
>>
>>58211784
I assume C, C++ or C#
>>
File: 1475003360062.jpg (101KB, 735x705px) Image search: [Google]
1475003360062.jpg
101KB, 735x705px
>tfw still have no idea how the fuck pointers work
>>
should I learn C before learning C++?
>>
>>58211915
They point to things
kinda rude desu sempai
>>
>>58211915
It's a memory cell like any other
The value/number in it is not the content of a variable though - it's the adress number of another cell.
>>
>>58211935
Yes.
>>
>>58211915
>Maki poster
Found the problem.
>>
>>58211915
If the time you studied them is 2 > days, you should hang yourself
>>
>>58211824
GNU/Linux + Intel integrated GPU + Mesa + GLSL is 100% free software, and all open specs if you want to write your own GL driver.
>>
>>58211935
Learning C++ implies learning basically everything from C (sans a few C99 features).
>>
>>58211978
>2 > days
Are you saying she didn't study enough, or is this a typo?
>>
>>58211784
Really easy with .NET libraries.

What are you actually trying to do? I've done many things interacting with office product, active directory, Exchange, Azure, etc.
>>
New functional programming thread: >>58212017
>>
File: 1466885183005.png (491KB, 650x698px) Image search: [Google]
1466885183005.png
491KB, 650x698px
C++ seems like a terrible language for someone who follows UNIX philosophy.
>>
>>58212052
C++ seems like a terrible language from any perspective
>>
Do you consider it necessary to watch the 1986 MIT lectures along with reading SICP? Don't get me wrong, the lectures are very informative but I feel like the book teaches the concepts in a more natural order and I enjoy the self paced learning.
>>
>>58212052
The UNIX philosophy is meant for applications, not languages.
>>
>>58211989
loosely interpreted (i know, bear with me) that definition implies C# is free software, but as if we know when the non-profit community is excluded from language development the resulting implementations are, in practice, straight up shit or at least lagging good half a decade behind

theres more to a language than what its licensed under. if the main developing bodies are private money minded the resulting language standard and ecosystem are hostile to copyleft development
>>
>>58211915
[code=asm]
pointer: dq 42

mov rax, [pointer] ; rax = 42
mov rcx, pointer ; rcx = some address, i.e the numeric value of the pointer label
[/code]

That's all there is to it.
>>
>>58212077
they are both brilliant but you would do well just watching or reading the another, they mostly tread the very same ground with 2 different approaches with a slight bit of non intersection.
>>
>>58212092
Can we apply unix philosophy to the kitchen?
>>
>>58212098
The Khronos Group (the ones responsible for the OpenGL spec, including GLSL) is a non-profit organization.
>>
Here's a stylesheet to add (You)s back to 4chan
https://userstyles.org/styles/136990/here-s-a-you-friend
>>
goto
>>
File: 1455777222858.jpg (28KB, 400x400px) Image search: [Google]
1455777222858.jpg
28KB, 400x400px
>finished ncurses book

what cool stuff can I do with my newly acquired knowledge /dpt/?
>>
>>58212227
jmp

https://www.youtube.com/watch?v=vfblUSCaAQk
>>
the unix philosophy is an anachronism of the way gone era.

all inter program data having to be in a textual form (god forbid its not ascii) is a constant source of security weaknesses and was largely solved in the 80s by more advanced command line environments

the unix philosophy may be the most destructive example of cargo cult programming there has ever been

its bad
>>
>>58212239
If you have to ask that, you didn't read the book correctly.

Go learn another language and actually do a useful, nontrivial project.
>>
>>58212225
They're gone?

Why aren't you using AppChan X anyway?
>>
>>58212239
kys
>>
>>58212265
strong, dependently typed OS when
>>
Task: write the function foo in one line
f = {
'a.txt': 'R',
'b.py': 'S',
'c.txt': 'R'
}
def foo(f):
g = {}
for x,y in f.items():
g.setdefault(y,[]).append(x)
return g

print foo(f)


output
{'S': ['b.py'], 'R': ['c.txt', 'a.txt']}


what do?
>>
>>58212273
dude curses is dead simple
>>
>>58212302
Can't be done in Python.
>>
>>58212315
i mean, its possible

you can re write the function foo however you want, if it still does the same thing
>>
>>58212302
f = [("a.txt", 'R'), ("b.py", 'S'), ("c.txt", 'R')]
foo f = foldr (\k xs -> if k `notElem` map fst xs then (,) k [ v | (v,k') <- f, k' == k ] : xs else xs) [] (map snd f)
>>
>>58212291
>dependently typed OS
Not possible.
Since an OS needs to able to continuously launch arbitrary programs in an infinite loop you run into undecidability problems pretty quickly.
>>
>>58212167
yeah, majorly chaired by corporations, for devices for sold by those corporations.

this is not a moral but a strictly pragmatic issue where its inconsequential who holds a chair in a committee as all possible decision have to be made in the frameworks of who provide the funding.
>>
>>58212167
Hmm
>>
>>58212423
do you get some kind of sick pleasure for being this pedantic
>>
>>58212484
This is one of the few situations where pedantry is warranted.
>>
>>58212468

You would have to influence every member of the board of those Major Fortune 500 companies, I'd say they represent the 'Industry' very fairly unless you are Gadaffi or some drug lord, and can afford to 'influence' 50% of them, that is.
>>
>>58212434
>as all possible decision have to be made in the frameworks of who provide the funding.
The people who provide the funding are also the ones making the hardware or have significant software investments.
Who else would even be qualified to make any relevant contributions?

All the specs are completely open and royalty free.
There exists free software implementations and drivers.

What more do you want?
>>
can everyone learn to code if they try really hard?
>>
>>58212410
if a Data.Map import is allowed

invert = foldr (\(k,v) -> insertWith mappend v [k]) mempty . assocs



>>58212562
yes
>>
>>58212562
No.
>>
>>58212562
Yes. usually you dont even have to try very hard.

if there's something you want to accomplish with programming, then learn what you need to get there.

i can't say the same for people who try to learn without clear goals in mind
>>
>>58212468
it wouldn't be a problem if there was an economic device to hold corporations responsible

however they way the world is, the manufacturing of processing units and memory devices is by physical limitations an inverted pyramidical structure

(and for this very reason i support a worldwide pseudo-UN communism regarding all computer device manufacturing, including a high level of involvement and top level decision power by all top institutes of research)
>>
>>58212587
>Communism in IT

You literally can't make this shit up, omfg
>>
>>58211360
>>58211401
10/10
>>
>>58212570
>>58212577
What about someone with the incapability of seeing, hearing, or feeling, who also unfortunately has no arms or legs, and most major external muscles are atrophied?

I'd imagine it would be impossible for this person to learn how to program.
>>
>>58212618
1
>>
>>58212611
>a code monkey happy for scraps
>>
>>58208426
does anyone know any good resources for android shit

im trying to get into android dev but theres so much shit to look through
>>
>>58212587
>by all top institutes of research)
That would be the guys in this image: >>58212468
>>
File: opengl_colors.png (71KB, 1030x679px) Image search: [Google]
opengl_colors.png
71KB, 1030x679px
Why my OpenGL colors are wrong?

Want to use this color as a background: http://www.color-hex.com/color/002b36, so I divided all the components by 255 to get float values OpenGL understands, and I got {0.0, 0.1686, 0.2117, 1.0}. I try to clear with this values and get picrel, which is somewhat close but definitely off. I don't use any lighting yet.
>>
fpt is in a meme-spouting mood right now, so maybe you guys can help. I know that SICP is more about math/theory than scheme, and I am fine with that, but I also want to learn Scheme. Can you guys rec me a book to accelerate my scheme learning while reading SICP? Just something to focus on scheme alone?
>>
>>58212731
because its not RGB.

its probably ABGR or something
>>
>>58212650
i'm sorry about your autism, anon.

certainly you didn't think I or anyone else meant "everyone" as "literally every person on the planet", right? do you understand what a colloquialism is?
>>
>>58212743
SICP is a meme book, and Scheme is a functional language so go ask /fpt/.
>>
>>58209113

Too bad they do not have contructors.
>>
File: 1460115987647.png (30KB, 246x200px) Image search: [Google]
1460115987647.png
30KB, 246x200px
>>58211810
>>58211839
It's an abstract kind of hell.

>>58211883
I kind of wanted to keep it in Python but if I can't do it without pissing away time learning/struggling with Python's win32com, it'd be in C# and that I can do.

>>58212032
Well it's easy enough with .NET libraries but I'm trying to keep everything as language-unified as possible for the office. I'll probably end up giving up the goose and just using the MS included libraries for Office and do what I need to. I just wanted to do some mail merge automation and the one tutorial I found isn't too clear but it's much more accurate and reliable than minor GUI automation (the hacked-together method we're using for that now).
>>
>>58212719
i doubt, while being major contributors to research, most of these companies are motivated by research only secondary to reacting to temporally relative small market fluctuations.
you can't sell me on that bullshit with the glaring lack of any public or even semi-public (american) universities.
>>
>>58212776
SO, I have been here for a while now and I keep getting mixed reviews on SICP. This question is addressed to everyone here who knows their shit. Would it be useful to read SICP at all? Where else would I learn any comp sci theory in depth from individual study? I am a CE major, not a comp sci major, and I want to focus on math in my electives, not comp sci.
>>
File: opengl_colors.png (19KB, 620x354px) Image search: [Google]
opengl_colors.png
19KB, 620x354px
>>58212766
It's definitely RGBA, border values like {1.0, 1.0, 0.0, 1.0} work as expected.
>>
>>58212846
if you like mathematics its excellent
if youre more into banging out code 1-to-z its less useful or interesting
its a good book but not for everyone
>>
>>58212856
>>58212731
Your gamma correction is wrong. You're decoding the color in the wrong color space. Read up on OpenGL support for sRGB.
>>
Ok I hope someone here can help me. I'm using c++. The problem is:
I have three classes one class called "Person", one class that expands "Person" called "Man" and the third called "Sight"
Person has a position (float) and a Sight, Man has a function Move that adds 1 to his position, Sight has a range (float) and should have a pointer to the position of the Person

ghostbin.com/paste/yh8ae


The problem is that the Sight of every Man I initialise seems to have the same pointer for the pos

e.g.:
I Initialise 10 Man and when I check their Positions they all have different ones but the position the pointer of Sight is pointing to is the one of the last Man I initialised (also .Move() has no effect on the value Sight.pos is pointing to)
>>
>>58212423
Coinduction.
>>
>>58212818
You are clueless.
If you've ever been to SIGGRAPH you'd know a lot of the guys presenting new research there are from one of those companies listed.
>>
>>58212846
Do you want to:
a) learn how to program (using Scheme)
b) learn Scheme, since you already know how to program

If a), read 'How to Design Programs'. Fantastic book.
If b), carve through The Little Schemer and The Seasoned Schemer, since they cover the main things that differ in Scheme cf. more mainstream languages: recursion, higher-order functions and continuations.
>>
>>58212768
That's hyperbole, not colloquialism.
>>
>>58212951
And how would that help in encoding for example the "exec(program, input)" return type?
>>
>>58212960
yes we agree on that, i asserted that.
i'm talking about the pragmatics of scientific responsibility (which there in this field threre is none).
>>
>>58213035
the point is that "everyone" was used colloquially in >>58212562 as "reasonably everyone" as opposed to the literal definition of "everyone".

neither of which are hyperbole, retard
>>
>>58213014
alright, thanks man. Gonna check both out.
>>
>>58213081
What do you mean by 'scientific responsibility'?
Are you implying the research is flawed? Bad data? Fraudulent results?
>>
File: imrs.jpg (212KB, 1484x1029px) Image search: [Google]
imrs.jpg
212KB, 1484x1029px
>>58213109
>hyperbole
>hʌJˈpəːbəli
>noun
>exaggerated statements or claims not meant to be taken literally

That's my pedantry fix for today, cheers.
>>
>>58213136
that still doesn't apply to my post and you're still wrong
>>
>>58213154
>certainly you didn't think I or anyone else meant "everyone" as "literally every person on the planet", right?

>hyperbole
>exaggerated statements or claims not meant to be taken literally

I'm not even the dude you started talking to, I'm just enjoying myself.
>>
>>58210842
^ steam game giveaway over here, get your steam URLs ready boys
>>
>>58213190
but "literally every person" fits the definition of "everyone", so it's not a hyperbole
>>
>>58208736
don't need luck... it's well-covered area these days
>>
>>58213135
framing of the input and output domains of problems
even if the study is completely fine otherwise, the problem context will skew the resulting data necessarily by exclusion
>>
File: img.jpg (194KB, 2000x1225px) Image search: [Google]
img.jpg
194KB, 2000x1225px
>>58213217
But you said you didn't mean it literally, ooooooo
>>
>>58212882
Looks like you're right, thanks.
>>
>>58212936
please? someone?
>>
>>58213080
Because coinduction permits infinity in a still well-behaved way.

In a dependently-typed OS all the programs would be inductive or coinductive in the first place.
>>
>>58208736
What modern UI tookit is based on OO these days?
They are closer to FRP in the forms of markup languages (XAML, QML) with async data-bindings or things like React.js which pretty much is an FRP paradigm.
>>
>>58213314
Infinity doesn't solve the halting problem.
>In a dependently-typed OS all the programs would be inductive or coinductive in the first place.
You don't understand the problem.

How would you define execProcess and terminateProcess?
terminateProcess should take as input whatever execProcess returns,and give a compiler error if you tried to terminate the wrong process.
It would involve trying to prove whether two processes are identical or not.
>>
>>58213237
Give an example of such a paper.
>>
>>58211401
Holy shit fuck off please, you have no idea what you're talking about.
>C works the same way as the CPU itself
WRONG
>and you can't get any lower-level than that.
What the fuck is assembly?
What the fuck is machine code?
>>
>>58212052
Unix philosophy was a mistake.
>>
>>58213417
what, when i'm talking of problem set exclusion you ask for a paper that would proof my argument. did you make a mistake or are you just dense?
>>
>>58213424
You are responding angrily to a jokepost.
>>
>>58213558
Yeah, I realized that afterwards.
>>
>>58213518
I'm challenging your assumption that there even is such a problem in the first place.
I've read quite a few SIGGRAPHpapers over the years, and they cover plenty of domains.
>>
New thread:

>>58213663
>>58213663
>>58213663
Thread posts: 314
Thread images: 19


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.